Offline by design

personal retrieval that stays on your machine.

ragkit turns notes, specs, code, and docs into a searchable local knowledge base. It combines dense vectors and lexical search, keeps everything in SQLite, and exposes the result through a CLI and MCP server — with a built-in eval harness so you can prove your retrieval is actually good, not just guess.

What it does

Local ingestion

Scan folders, chunk content, embed with Ollama, and store everything in SQLite with reproducible paths.

Hybrid retrieval

Search by meaning and exact terms together, then fuse the result with ranked scoring for better recall.

Agent-ready output

Use the CLI or MCP server to feed agents a clean context block, cited sources, and explainable retrieval traces.

Measured retrieval

Score the retriever against a golden dataset with objective metrics — no LLM, deterministic, ready to gate CI.

Measured retrieval

Good RAG is good retrieval, not prompt magic. ragkit eval runs a golden dataset through the hybrid retriever and reports objective numbers, so a change to chunking, fusion, or topK is a measured decision instead of a guess.

Hit Rate @k Did a relevant source land in the top-k results at all?
MRR How high did the first relevant source rank across queries?
nDCG @k Quality of the whole ranking, discounted by position.
Precision · Recall Share of retrieved chunks that are relevant, and of relevant sources found.
Source-anchored golden set relevance keyed to the document, not chunk ids — stable across chunkers

Workflow

01 · Init Create the config, choose your roots, and point ragkit at local Ollama.
02 · Ingest Index files into SQLite using stable chunks and cached embeddings.
03 · Query Blend vector and lexical search, then inspect the explain output when needed.
04 · Eval Score retrieval against a golden dataset — Hit Rate, MRR, and nDCG, deterministic and CI-ready.
05 · Serve Expose the same knowledge base to Claude or any MCP-compatible client.