index_repo
Build or incrementally refresh a semantic search index for a local repository, re-embedding only changed files so updates stay fast and current.
Instructions
Build or incrementally refresh a semantic search index for a local repository.
Walks the repo, chunks every supported-language file by AST boundaries,
embeds the chunks via a local Ollama server, and stores them in a per-repo
LanceDB table. After the first build this is INCREMENTAL: only files whose
content changed since the last run are re-embedded, so refreshing is cheap —
run it freely (e.g. when index_status reports "stale"). A changed embedding
model or force=True does a full rebuild. Requires a running Ollama (the
semantic layer is built in; run myopic doctor to set it up) at
MYOPIC_OLLAMA_URL (default http://localhost:11434) with the
model pulled (MYOPIC_EMBED_MODEL).
Args: root: Absolute path to the repository to index. force: Rebuild the whole index even if an up-to-date one exists.
Returns: {mode, indexed_chunks, files, skipped, changed_files, deleted_files, git_sha, model} on success, or {"error": "..."} on failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | Yes | ||
| force | No |