Skip to content
Back to skills

Vector Db Cleanup

ASecurity

Removes stale and orphaned chunks from the ChromaDB vector store when source files have been deleted or renamed.

  • 7 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentspythonbashsqlapi

Works with

  • api

Security analysis

A100/100

Pro scans all 15 files and shows the line behind each finding

Scanned October 3, 2026

npx -y skills add richfrem/agent-plugins-skills --skill vector-db-cleanup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Vector Db Cleanup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Vector Db Cleanup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/richfrem-vector-db-cleanup-agent-plugins-skills/badge)](https://www.skillsdirectory.com/skills/richfrem-vector-db-cleanup-agent-plugins-skills)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: vector-db-cleanup
plugin: agent-memory
description: Removes stale and orphaned chunks from the ChromaDB vector store when source files have been deleted or renamed.
allowed-tools: Bash, Read, Write
---

# Vector DB Cleanup (`vector-db-cleanup`)

Removes stale and orphaned chunks from the ChromaDB vector store when source files no longer exist on disk.

## Contents

- [Critical Constraints](#critical-constraints)
- [Quick start](#quick-start)
- [Workflow](#workflow)
- [Verification](#verification)

## Critical Constraints

1. **Write Operation**: Always specify the target `--profile` to prune the intended semantic space.
2. **API Integrity**: NEVER manipulate SQLite files directly; always execute `scripts/cleanup.py`.
3. **Transparency**: Report which profile was pruned and the total number of chunks removed.

## Quick start

Execute in-process cleanup for the default wiki profile:

```bash
python3 scripts/cleanup.py --profile wiki
```

## Workflow

1. **Identify Profile**: Verify active profiles in `.agent/learning/vector_profiles.json` (default: `wiki`).
2. **Execute Cleanup**: Run `scripts/cleanup.py` with the mandatory `--profile` flag.
3. **Report Output**: State the target profile and total chunks removed.

## Verification

Verify store integrity and index consistency after cleanup:

```bash
python3 scripts/vector_consistency_check.py --profile wiki --topic .agent/learning/
```

Files in this skill

  • SKILL.md2.2 KB
  • assets/resources/architecture_sequence.mmd53 B
  • assets/resources/deployment_model.mmd48 B
  • assets/resources/rag_design_choices.md50 B
  • assets/resources/stabilizers/README.md53 B
  • assets/resources/stabilizers/vector_consistency_check.md71 B
  • evals/evals.json935 B
  • evals/results.tsv172 B
  • requirements.in21 B
  • requirements.txt22 B
  • scripts/cleanup.py27 B
  • scripts/init.py24 B
  • scripts/query.py25 B
  • scripts/vector_config.py33 B
  • scripts/vector_consistency_check.py44 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…