reindex_documents
Synchronize the knowledge base index with files on disk after manual edits or model changes. Choose force for incremental sync or full rebuild for index corruption.
Instructions
Index or reindex all documents in the knowledge base.
Runs in background — returns immediately. Use get_reindex_status() to monitor progress.
Args: force: If True, smart reindex (detects changed files + rebuilds BM25 index). Use after manually editing files on disk outside of add_document(). full_rebuild: If True, nuclear rebuild — deletes all vectors and re-embeds everything from scratch. Use only if the embedding model changed or the index is corrupted.
Returns: JSON string with operation status. Poll get_reindex_status() for reindex.active, reindex.progress, and reindex.percent until reindex.active becomes false.
Usage: Normal workflow does not require this — add_document(), update_document(), and add_from_url() all auto-index on call. Use force=True only after direct filesystem edits. Use full_rebuild=True only for model upgrades or index corruption. No arguments runs a fast incremental pass.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | ||
| full_rebuild | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |