reindex_embeddings
Builds the vector index needed for semantic and hybrid terminal-history search by embedding indexed command texts that lack vectors, processing batches until none remain.
Instructions
Builds the vector index behind search_history semantic/hybrid modes and ask_history. Embeds distinct indexed command texts (identical commands share one vector) that have no vector yet for the configured model, newest first, in batches of 64, via the OpenAI-compatible endpoint in TERMINAL_HISTORY_LLM_BASE_URL (default Ollama at http://localhost:11434/v1, model nomic-embed-text from TERMINAL_HISTORY_EMBED_MODEL). Non-localhost endpoints are refused unless TERMINAL_HISTORY_ALLOW_REMOTE_LLM=1. Sends only already-redacted text read from the local index. Changing the embedding model re-embeds everything for the new model. Run reindex first, then call until remaining is 0. Returns embedded / skipped / failed / remaining counts.
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": "reindex_embeddings"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of distinct command texts to embed in this call. Default 2000. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | First error seen, if any. | |
| model | No | Embedding model the vectors were built with. | |
| failed | No | Texts the endpoint rejected or failed on this call. | |
| skipped | No | Distinct texts already embedded for this model (or blank). | |
| embedded | No | Vectors written this call. | |
| remaining | No | Distinct texts still without a vector for this model. |