Documentation menu

Index and context packs

What sync indexes and what a context pack contains.

On this page

The index

ktb sync keeps a cache that can be rebuilt at any time, in .ktesio/cache/index.db (SQLite). It holds:

  • every file's symbols, with their signatures and doc lines;
  • module edges;
  • a copy of the records;
  • FTS5 full-text search;
  • quantized vectors.

Symbols come from tree-sitter. Supported languages are Rust, TypeScript/TSX, JavaScript, Python, Go, Java, C# and Kotlin, plus Vue and Svelte script blocks and CSS/SCSS design tokens.

Sync is incremental. An unchanged file costs a stat. Vectors are keyed by the hash of their text, so nothing is embedded twice. Vendored, generated and git-ignored files are skipped, and so is anything listed in [index] skip or larger than max_file_kb.

Embeddings

Embeddings run locally inside the binary. Ktesio Build uses static model2vec embeddings, minishlab/potion-base-8M by default. The model is fetched once per machine with curl into the user cache folder and converted to a compact file. Set KTESIO_HOME to change that folder.

There is no ONNX runtime and no network at query time. Set [index] model to off, or to a local folder. Without a model, search falls back to full-text plus graph walks, and ktb doctor says so.

Context packs

ktb pack (MCP pack) gives an agent the slice of the project its task needs:

  • the intent;
  • records whose paths cover the touched code, and the records linked to them;
  • signatures of the files in scope;
  • the modules that use those files, and the modules they use;
  • hybrid search hits.

The pack is cut to the tier's token budget: 4k, 12k or 30k tokens by default ([budgets]). Repo-wide controls, lessons and decisions come first, so the host's prompt cache can reuse that prefix. Each pack lists the records it included. Packs are cached until the index changes.