vdb-cleanup
VDB Cleanup Agent
Role
You remove stale and orphaned chunks from the ChromaDB vector store. A chunk is stale when its source file no longer exists on disk. Running this after deletes/renames keeps the vector index accurate and prevents false search results.
This is a write (delete) operation. Always dry-run first.
When to Run
- After deleting or renaming files that were previously ingested
- After a major refactor that moved directories
- When
query.pyreturns results pointing to non-existent files - Periodically as housekeeping
Prerequisites
Verify server is running
If not already up, see plugins/vector-db/skills/vector-db-launch/SKILL.md.
For first-time setup (dependencies + profile config): plugins/vector-db/skills/vector-db-init/SKILL.md.
curl -sf http://127.0.0.1:8110/api/v1/heartbeat
Execution Protocol
1. Dry run -- show what will be removed
python3 plugins/vector-db/skills/vector-db-agent/scripts/cleanup.py \
--profile knowledge --dry-run
Report: "Found N orphaned chunks from X deleted files: [list of paths]"
2. Apply -- only after confirming with user
python3 plugins/vector-db/skills/vector-db-agent/scripts/cleanup.py \
--profile knowledge --apply
3. Verify store integrity (optional)
python3 plugins/vector-db/skills/vector-db-agent/scripts/vector_consistency_check.py \
--profile knowledge
4. Smoke test search still works
python3 plugins/vector-db/skills/vector-db-agent/scripts/query.py \
"test query" --profile knowledge --limit 3
Rules
- Always dry-run first. Never apply without showing the user what will be deleted.
- Never delete from
.vector_data/directly -- always usecleanup.py. - Never read
.sqlite3files with raw shell tools -- will corrupt context. - Source Transparency Declaration: state which profile was cleaned and how many chunks removed.
More from richfrem/agent-plugins-skills
markdown-to-msword-converter
Converts Markdown files to one MS Word document per file using plugin-local scripts. V2 includes L5 Delegated Constraint Verification for strict binary artifact linting.
52excel-to-csv
>
32zip-bundling
Create technical ZIP bundles of code, design, and documentation for external review or context sharing. Use when you need to package multiple project files into a portable `.zip` archive instead of a single Markdown file.
29learning-loop
(Industry standard: Loop Agent / Single Agent) Primary Use Case: Self-contained research, content generation, and exploration where no inner delegation is required. Self-directed research and knowledge capture loop. Use when: starting a session (Orientation), performing research (Synthesis), or closing a session (Seal, Persist, Retrospective). Ensures knowledge survives across isolated agent sessions.
26ollama-launch
Start and verify the local Ollama LLM server. Use when Ollama is needed for RLM distillation, seal snapshots, embeddings, or any local LLM inference — and it's not already running. Checks if Ollama is running, starts it if not, and verifies the health endpoint.
26spec-kitty-checklist
A standard Spec-Kitty workflow routine.
26