projects.refresh_index
Reconcile the full-text search index with disk changes: ingest new or modified markdown files, refresh drifted content, and prune stale rows for removed files. Use after external edits or when drift is reported.
Instructions
Reconcile the FTS index against disk. For a project (project_id set), re-runs discoverFiles. For the KB (project_id null/omitted), walks knowledge/, ingests new .md files, reindexes any whose content hash drifted, and PRUNES rows for files no longer on disk. SIDE-EFFECTFUL: writes/updates/deletes file and FTS rows (the prune is destructive on stale index rows but never deletes files from disk). Idempotent — running twice is a near no-op. Skips files >5MB and standard junk dirs (node_modules, .git, dist, build, etc.). No external auth or rate limits. Returns {scope, newly_indexed, refreshed, pruned}. Use after editing files outside Kontexta, or when files.diff_against_disk reports drift.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Project ID. Pass null or omit to reindex the Knowledge Base. |