Skip to main content

indexkit

Offline hybrid retrieval: build a local semantic + lexical index over your files and query it. Chunks and embeds a corpus through ollama, indexes it with turbovec (a quantized vector index), and fuses that with SQLite FTS5/BM25 for opt-in hybrid search.

No API key and no network egress by default — the embedding endpoint is localhost. A configured remote CONTEXT_KIT_OLLAMA_HOST receives corpus chunks and queries, so that is the one setting that sends data off the machine.

Notes-first but corpus-agnostic: loaders are pluggable, so the same engine can index Markdown notes, code, or any text corpus.

Formerly local-rag. The old name claimed a deployment property that a supported setting falsifies, and understated an engine that also does lexical retrieval. Pre-rename environment variables are still honored.

Install

pip install indexkit          # or: uv tool install indexkit
ollama pull nomic-embed-text  # once

That is the whole setup — no plugin host, no bootstrap step. Indexes default to ${XDG_DATA_HOME:-~/.local/share}/indexkit.

indexkit index ~/notes --name notes
indexkit query "how did we handle retry backoff" --name notes --k 8

To work from a clone instead — for contributing, or to run an unreleased revision:

# From a clone of https://github.com/mbeacom/context-kit
pip install ./plugins/indexkit    # or: uv tool install ./plugins/indexkit

As a context-kit plugin

Claude Code and GitHub Copilot CLI auto-bootstrap the bundled scripts/indexkit launcher from the plugin's SessionStart hook, into ${CLAUDE_PLUGIN_DATA}/venv — for Copilot, ~/.copilot/plugin-data/<marketplace>/indexkit/venv. In that mode the host controls where indexes live.

The launcher prefers that bootstrapped venv, then falls back to an indexkit already on your PATH, then to any importable indexkit module. So a pip-installed copy satisfies the plugin too, and a missing venv is not fatal.

Requirements

  • ollama running with an embedding model pulled:

    ollama pull nomic-embed-text
    
  • uv — only for the plugin bootstrap path. A pip install needs nothing beyond Python 3.10+.

For APM or manual plugin usage — or on any host where the venv is missing or stale — bootstrap it yourself into a neutral data location:

export CONTEXT_KIT_DATA="$HOME/.local/share/context-kit"
bash scripts/bootstrap.sh
export PATH="$PWD/scripts:$PATH"

To check readiness without installing anything:

bash scripts/bootstrap.sh --check   # exit 0 ready, 3 needs bootstrap

It prints KEY=VALUE lines: status (ready, missing, stale, uv-missing), the raw venv_status and uv availability as separate fields, the resolved home/venv paths, and the exact bootstrap_command. A stale venv was built from different pyproject.toml metadata and would run outdated code, so it is reported as clearly as a missing one. Because uv is only needed to build the venv, an already-usable venv reports ready even when uv is absent. Dependent tooling uses this to detect an unusable runtime on hosts that do not deploy plugin hooks, such as APM. (Claude Code and GitHub Copilot CLI both run this plugin's SessionStart bootstrap.)

Usage

Index a corpus, then query it:

indexkit index <path> --name X
indexkit query "your question" --name X
indexkit query "exact terms and intent" --name X --hybrid
indexkit status --name X
indexkit list
indexkit remove --name X --yes

Each named index is persisted under <data-dir>/indexes/<name>/, so queries are fast and survive across sessions. The data directory resolves in this order:

  1. CONTEXT_KIT_DATA (or the PRODUCTIVITY_SKILLS_DATA alias)
  2. CLAUDE_PLUGIN_DATA, set by a plugin host
  3. ${XDG_DATA_HOME:-~/.local/share}/indexkit — the standalone default

An existing ~/.claude/plugins/data/indexkit directory still wins over the standalone default while that default has not been created, so upgrading a plugin install does not orphan indexes you already built.

Index lifecycle

Index names remain backward-compatible with earlier releases: any non-empty single path component except . or .. is accepted, including names with spaces or more than 80 characters. Path separators (/ and \) and NUL are rejected. These containment rules apply consistently to index, query, status, and remove.

indexkit remove --name X --yes permanently removes one named index. The command is non-interactive and refuses to run without --yes; missing indexes fail clearly. Indexing, querying, status inspection, and removal share a per-index process lock, so removal fails clearly while that index is in use. Once locked, removal moves only the selected index out of the active namespace, then unlinks its flat artifact files without recursive directory deletion. Other indexes are untouched, and incomplete cleanup is reported with the quarantined artifact location rather than silently ignored.

Portable environment variables:

Variable Purpose Claude fallback
CONTEXT_KIT_DATA venv and index storage CLAUDE_PLUGIN_DATA
CONTEXT_KIT_INDEXKIT_HOME venv location only, when it must differ from index storage — (defaults to CONTEXT_KIT_DATA)
CONTEXT_KIT_EMBED_MODEL ollama embedding model CLAUDE_PLUGIN_OPTION_EMBED_MODEL
CONTEXT_KIT_OLLAMA_HOST ollama base URL CLAUDE_PLUGIN_OPTION_OLLAMA_HOST
XDG_DATA_HOME relocates the standalone default data directory —

None of these are required for a standalone install; all have defaults. The pre-rename CONTEXT_KIT_LOCAL_RAG_HOME is still read as a fallback for CONTEXT_KIT_INDEXKIT_HOME.

CONTEXT_KIT_DATA normally holds both the venv and the indexes. Set CONTEXT_KIT_INDEXKIT_HOME only when a caller needs to redirect index data to an isolated store while still using one shared bootstrapped venv — the memory plugin does this to keep each project's index inside its own project-isolated provider directory. When it is unset, behavior is unchanged.

The pre-rename PRODUCTIVITY_SKILLS_* names still resolve as a deprecated alias (CONTEXT_KIT_* → PRODUCTIVITY_SKILLS_* → Claude fallback).

Hybrid retrieval

Semantic-only retrieval remains the default. --hybrid adds SQLite FTS5 lexical BM25 candidates and fuses them with turbovec semantic candidates using deterministic reciprocal-rank fusion: 1.0 / (60 + semantic_rank) + 1.0 / (60 + lexical_rank). Each source retrieves 3 × k candidates before fusion, so the candidate depth is greater than the requested final result count. JSON results include source offsets and per-source rank/score metadata; text output remains compact.

indexkit query also accepts an --allowlist of candidate documents (read from a file, or - for stdin), which applies to both semantic and lexical candidates. For example, feeding Obsidian backlinks into a hybrid query:

obsidian backlinks file="X" | indexkit query "..." --hybrid --allowlist -

FTS5 is detected and backfilled automatically for existing indexes. indexkit status reports its fts5 capability. If the SQLite build lacks FTS5, semantic retrieval continues to work but --hybrid exits with a clear error.

MIT © Mark Beacom.

Metadata

Release files for indexkit 0.6.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for indexkit 0.6.6
File Size Uploaded Provenance Actions
indexkit-0.6.6.tar.gz 62.1 kB With provenance Details for indexkit-0.6.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for indexkit 0.6.6
File Interpreter ABI Platform Actions
indexkit-0.6.6-py3-none-any.whl Python 3 none any Details for indexkit-0.6.6-py3-none-any.whl

Total release size: 83.4 kB

Release files / indexkit-0.6.6.tar.gz

Download URL indexkit-0.6.6.tar.gz
Size 62.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2605e26aa06b3d0941f9f453d84554d3fce7d394c0b4d11d8c62d14352b9cfd3
BLAKE2b-256 checksum
How to use checksums
ac9eaa83d28a8fcd3e39e332d5ea636eb3f018e4d47d4071289d6ab27d7d3d6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / indexkit-0.6.6-py3-none-any.whl

Download URL indexkit-0.6.6-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28bc5c33a77561865c62c183fcc0db29c02a18a9435cd7ad5c680ada52f1a33f
BLAKE2b-256 checksum
How to use checksums
ad3145d027f08965dc8abc97547bea184ef13690d84a27a87c585a8dcd9ae9da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for indexkit 0.6.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for indexkit-0.6.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page