Update the knowledge base index
rhebok_update_indexUpdates the knowledge base index by reading new or changed files, embedding pending sections, or compacting the index to repair search and reclaim disk space.
Instructions
Update the user's knowledge base index: read new and changed files, embed sections that are still waiting, or compact the index.
Use it when the user has just added or edited files that a search does not find, when rhebok_get_status shows vectors_pending above 0, or when a search error asks for a compaction. Do not call it routinely: rhebok already indexes at the start of every session. Check rhebok_get_status first to see whether a run is already going.
Parameters: mode "changes" (the default) stats every configured source, reads only files whose size or modification time changed, and removes documents whose file is gone. "backfill" embeds waiting sections and starts no new batch after two minutes, though the batch under way and the final rebuild of the index can run past that; call it again while vectors_pending stays above 0. "compact" rebuilds the index from its own stored rows, which repairs a search that refuses its index and reclaims disk space, without reading any file or embedding anything.
Behavior: "changes" and "backfill" send new text to the configured embedding server, which can take minutes for many files. Search answers from the previous index until the new one is swapped in. While another index run holds the lock, it refuses and changes nothing.
Returns: the documents added, updated and deleted and the sections read, or for a backfill the sections embedded and still waiting; error says why a run failed or was refused.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "rhebok_update_index"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "changes" (the default) reads new and changed files. "backfill" embeds the sections still waiting for an embedding. "compact" rebuilds the index from its own stored rows without embedding anything. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when the run finished and its index is now live. | |
| mode | Yes | The mode that ran: "changes", "backfill" or "compact". | |
| added | Yes | Documents read for the first time. | |
| error | Yes | Why the run failed or was refused. Null when `ok` is true. | |
| chunks | Yes | For "changes", the sections of the documents this run read, so 0 when nothing changed; for "compact", every section in the index. Null for "backfill". | |
| deleted | Yes | Documents removed because their file is gone. | |
| updated | Yes | Documents re-read because their file changed. | |
| embedded | Yes | Sections embedded by a "backfill" run. 0 for the other modes. | |
| vectors_pending | Yes | Sections still waiting for an embedding after a "backfill" run; call it again while this is above 0. Null for the other modes. |