Hybrid search over your documents, tickets and notes. One Rust binary builds an on-disk index and returns one ranked list. Dense vectors find other wordings, and BM25 finds exact codes and names. The same engine is available as a Rust library and as a macOS app.
Install · Quick start · Claude Code · Ways to use it · Benchmarks · Reference · Operations
Real output from the quick start below: 8 sample records and the offline hash embedder. Rendered by scripts/demo/render_hero.py.
3.3 ms median, 6.0 ms p95 for semantic search over 300,000 chunks with every cache off: HNSW index, synthetic 1024-dim vectors, full HTTP round trip, 4 concurrent clients on a 4-vCPU cloud VM. How it was measured.
Status: early (0.1).
Install with Homebrew (Apple Silicon macOS and Linux x86_64/ARM64):
brew install fntune/tap/ragrepOr run the HTTP server container image (serves the sample handbook index on port 8080; see Container image for volumes and auth):
docker run --rm -p 8080:8080 ghcr.io/fntune/ragrep:latestOr build from source with Rust stable:
git clone https://github.com/fntune/ragrep && cd ragrep
cargo install --path rust --lockedThe checkout pins Rust 1.99.0 in rust-toolchain.toml; Rustup selects it
automatically. The minimum compiler version is 1.97.1, required by Rig.
Run ragrep --version to verify the install. For a prebuilt CLI archive, select your operating system and CPU on the releases page.
If you used the v0.1.0 default indexes, keep their original configuration when you upgrade. The new sample writes to a separate directory. See the upgrade instructions.
This runs offline, with no API key, in a fresh directory:
mkdir ragrep-demo && cd ragrep-demo
base=https://raw.githubusercontent.com/fntune/ragrep/main/examples/quickstart
curl -fsSLO "$base/config.toml" # uses the offline hash embedder
mkdir -p data/quickstart/raw/handbook
curl -fsSL "$base/handbook.jsonl" -o data/quickstart/raw/handbook/records.jsonl # 8 sample records
ragrep ingest # chunk, embed, publish an indexThen search it:
ragrep "I can't log in" # hybrid: finds "How sign-in works"
ragrep "I can't log in" -m grep # exact substring: 0 matches
ragrep "RL-1007" # exact codes still rank first
ragrep "account" -f team=identity --json # metadata filter, JSON for scripts and agentsServe the same index over HTTP:
ragrep serve --port 8080 & # JSON API on port 8080
curl "http://localhost:8080/search?q=refund+policy&mode=hybrid&n=3" # the same search, as JSONThe hash embedder shows the workflow, not real semantic quality. For that, set [embedding] provider to voyage, openai or gemini and put the key in .env, or point openai at a model server on your own machine. See Providers.
Install the skill so Claude Code can use ragrep --json:
mkdir -p "${HOME}/.claude/skills/ragrep"
curl -fsSL https://raw.githubusercontent.com/fntune/ragrep/main/integrations/claude-code/ragrep/SKILL.md -o "${HOME}/.claude/skills/ragrep/SKILL.md"For Codex, Cursor or any agent that reads AGENTS.md, add a line like this:
To search project knowledge, run `ragrep "<question>" --json -n 8` and cite results by title and id.The knowledge service also supports MCP clients.
The quick start above is the whole workflow: ragrep ingest builds the index,
ragrep "<query>" searches it, and ragrep serve puts the same search behind a
JSON API with auth, metrics and readiness probes. See the
reference for flags, named indexes, connectors and the HTTP API.
ragrep-engine, in rust/engine, runs the same index and search in your own
process. It has no HTTP server or CLI dependencies and builds for iOS. You
supply documents through the Source trait:
let embedder = embed::make_configured(&cfg.embedding)?;
let engine = Engine::open(cfg, Some(embedder))?;
engine.publish("notes", ¬es, None, &|_| {})?; // `notes` implements `Source`
let query: Query = serde_json::from_value(serde_json::json!({ "q": "RL-1007", "mode": "hybrid", "n": 2 }))?;
for hit in engine.search(&query, None)?.hits {
println!("{} {}", hit.rank, hit.result.title);
}Run the complete example with
cargo run --manifest-path rust/Cargo.toml -p ragrep-engine --example library.
The engine contract describes publishing, locks and upgrades.
ragrep service adds the parts that a personal search tool needs: source
plugins (local folders, GitHub, Notion, Jira, Chrome bookmarks, YouTube and
more), a permission setting for each source, Ask with cited passages, and
relevance feedback. The macOS app is a native GPUI client of that service. It
keeps API keys in Keychain and adds Spotlight results and Shortcuts actions.
Search needs a source with published records. Start the service, then configure
and sync a source in the macOS app or with ragrep sources configure and
ragrep sources sync. Wait for the source to report ready. Ask also needs a
running model at the endpoint in the service settings. See the
source and model settings.
cargo build --manifest-path rust/Cargo.toml --release --features local-embeddings --bin ragrep
./rust/target/release/ragrep service --ready-json
# In another terminal, after the source is ready:
./rust/target/release/ragrep search "onboarding decisions" --experience enhanced
./rust/target/release/ragrep ask "What changed, and why?"To build the app, see macOS setup. Other clients: TypeScript and Python SDKs, CLI and MCP, the versioned HTTP contract, and a Raycast extension. To check a local setup, see the verification guide.
| grep / ripgrep | Vector database | ANN library | ragrep | |
|---|---|---|---|---|
| Finds a passage that uses other words | No | Yes | Yes | Yes |
| Ranks exact codes and names first | Yes | Only with hybrid set up | No | Yes, BM25 fused with dense |
| What you run | A binary | A service plus a client SDK | A library in your code | One binary: CLI and HTTP server |
| Chunking, embedding, incremental re-index | Not needed | You write it | You write it | Built in |
| Filters, dates, several indexes | Paths and globs | Yes | You write it | Yes |
| Auth, metrics, readiness probes | No | Varies | No | Built in |
flowchart LR
R[JSONL records, HTTP writes or a source plugin] --> C[Chunk]
C --> E[Embed, cached by content hash]
E --> G[(New generation on disk: vectors + BM25)]
G -->|atomic flip of CURRENT| S[Live index]
Q[Query] --> D[Dense search, flat or HNSW]
Q --> B[BM25]
S -.-> D
S -.-> B
D --> F[Reciprocal Rank Fusion]
B --> F
F --> X[Optional rerank]
X --> O[Results]
- Paraphrase and exact tokens in one list. Dense vectors catch other wordings, BM25 catches codes, SKUs and function names, and Reciprocal Rank Fusion merges the two lists by rank, so neither score needs calibrating.
- No half-built indexes. Each ingest writes a new generation directory, then flips
CURRENT. - Re-index only what changed. A content-hash cache skips chunks that were already embedded.
- Three modes.
hybrid(default),semantic(dense only) andgrep(exact substring).
See benchmark methods, limitations, and commands in docs/BENCHMARKS.md.
Latency, p50 / p95 in ms, caches off, over HTTP with 4 concurrent clients on a 4-vCPU cloud VM, synthetic 1024-dim vectors (2026-11-29). HNSW is an approximate nearest-neighbor graph index; flat is exact search.
| Chunks | Index | semantic | hybrid | hybrid + broad filter | grep |
|---|---|---|---|---|---|
| 10,000 | flat | 5.1 / 13.9 | 5.4 / 15.6 | 3.4 / 8.4 | 1.3 / 3.0 |
| 300,000 | flat | 94.5 / 308 | 97.2 / 258 | 84.3 / 183 | 10.1 / 65 |
| 100,000 | hnsw | 3.1 / 6.2 | 3.3 / 6.7 | 31.4 / 92 | 3.5 / 21 |
| 300,000 | hnsw | 3.3 / 6.0 | 4.4 / 7.9 | 26.7 / 50 | 8.5 / 54 |
The grep timings use the previous workload. The current command,
python3 scripts/bench/latency.py --caches off, uses a new corpus and grep term
list. It does not reproduce this historical baseline. Synthetic vectors measure
speed, not relevance.
Quality against vector databases on BEIR, every system fed the same Voyage voyage-4-large vectors, 200 labeled queries per dataset (2026-06-09):
| Dataset | ragrep semantic nDCG@10 | Other systems, same vectors |
|---|---|---|
| SciFact | 0.812 | 0.813 |
| NFCorpus | 0.428 | 0.423 to 0.429 |
| FiQA | 0.797 | 0.798 to 0.802 |
Given the same vectors, ragrep's dense search matches Qdrant, Weaviate, Milvus Lite, Chroma, FAISS, hnswlib and the rest within 0.006 nDCG@10, and adds BM25, filters, auth and an HTTP API.
- For a platform without a release archive, build the CLI from source. The macOS CLI archive contains the command-line program. Build the desktop app separately.
- The default
flatindex slows down as your corpus grows. Setdense_kind = "hnsw"for large corpora; HNSW builds take about 4 minutes for 300,000 chunks on 4 vCPUs. - A broad metadata filter is slow with HNSW, because HNSW filters after the vector search.
- Hybrid is not always better than semantic. On the BEIR question sets above it scored lower, so measure on your own data.
- One writer per index, and no built-in replication. Serve read-only replicas from a published generation.
- A request that times out does not cancel search work already accepted.
The full list, and what is planned, is in docs/ROADMAP.md.
The index, the embedding cache and the raw records live in directories you choose, and ragrep sends no telemetry. Outbound calls go only to the embedding and rerank providers you configure, and to the upstream systems of any source plugin you install.
Watch the reranker: if config.toml has no [reranker] table, it defaults to Voyage, and each hybrid query and its top passages go to Voyage whenever VOYAGE_API_KEY is set. With the offline hash embedder or a local OpenAI-compatible server (Ollama, vLLM, TEI, LM Studio), plus [reranker] provider = "none", nothing leaves the machine. The quick start config already sets both.
- Reference: search flags, named indexes and connectors, HTTP API, providers, index upgrades.
- Engine: the
ragrep-enginelibrary contract for embedding the engine in another application. - Operations: auth, readiness, metrics, on-disk layout, container image.
- Knowledge service, clients and MCP, and verification.
- Benchmarks, Source plugins, Roadmap, Decisions.
- Changelog, Contributing, Security, Code of conduct.
git clone https://github.com/fntune/ragrep && cd ragrep
make hooks # once per clone: rustfmt pre-commit hook
make check # fmt and clippy
make test # cargo testSee CONTRIBUTING.
Ragrep uses the MIT License. The macOS app includes a modified copy of Zed Industries’ GPUI library under the Apache License 2.0. See the GPUI source and modification record.
