repair_index
Repair the local SQLite index by removing orphan embeddings, dropping the vector store, or rebuilding the FTS5 index. Runs in a transaction for safety.
Instructions
Apply a targeted repair to the local SQLite index. Modes: drop-orphans (delete embedding rows whose symbol_id no longer exists), drop-vec (drop the entire vector store — search falls back to BM25; embed_repo rebuilds), rebuild-fts (drop and reload symbols_fts from the symbols table). Each mode runs in a transaction so a partial failure leaves the DB unchanged. DESTRUCTIVE — verify_index first to find out which mode is needed. Returns JSON: { mode, ok, detail, affected }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Repair mode: drop-orphans, drop-vec (forces a re-embed), or rebuild-fts (refreshes the FTS5 inverted index from symbols). |