vector-db-cleanup)
Removes stale and orphaned chunks from the ChromaDB vector store when source files no longer exist on disk.
Contents
- Critical Constraints
- Quick start
- Workflow
- Verification
Critical Constraints
- Write Operation: Always specify the target
--profileto prune the intended semantic space. - API Integrity: NEVER manipulate SQLite files directly; always execute
scripts/cleanup.py. - Transparency: Report which profile was pruned and the total number of chunks removed.
Quick start
Execute in-process cleanup for the default wiki profile:
python3 scripts/cleanup.py --profile wiki
Workflow
- Identify Profile: Verify active profiles in
.agent/learning/vector_profiles.json(default:wiki). - Execute Cleanup: Run
scripts/cleanup.pywith the mandatory--profileflag. - Report Output: State the target profile and total chunks removed.
Verification
Verify store integrity and index consistency after cleanup:
python3 scripts/vector_consistency_check.py --profile wiki --topic .agent/learning/