Overview
zebrarag is a local-first semantic code index and MCP server. It parses your codebase with tree-sitter, chunks it by structure, embeds everything on your own hardware, and exposes fast query tools for AI coding agents — no cloud, no API keys.
How it works
your repo
↓ tree-sitter
AST symbols + edges
↓ chunking
semantic chunks (symbol-aware or recursive)
↓ Candle (BERT/Jina)
float32 embeddings → TurboQuant (int8)
↓ LanceDB + usearch
vector + full-text index
↓ MCP stdio server
AI agent tools: searchQuery · searchDep · fileTree · …
Architecture
zebrarag is a workspace of focused Rust crates:
| Crate | Role |
|---|---|
zrag-daemon | Background process, handles IPC requests |
zrag-pipeline | Index + search pipeline orchestration |
zrag-dsl | Tree-sitter code parsing, chunking, call graphs |
zrag-embed | Candle-based embedding engine (BERT, Jina, BGE, …) |
zrag-ann | ANN index (usearch) + TurboQuant reranker |
zrag-store | LanceDB storage layer |
zrag-protocol | IPC request/response types |
zrag-tree-sitter | Language detection + tree-sitter frontends |
zrag-rerank | TurboQuant reranking (CPU & GPU) |
apps/zebrarag | CLI, TUI, and MCP server entry point |
Key properties
- Local-first — embeddings run on your CPU, Metal (macOS), or CUDA GPU
- Incremental — only changed files are re-embedded; daemon stays alive
- MCP-native — ships as a stdio server; works with Claude Code, Cursor, Zed, Windsurf, Continue.dev
- Multi-language — Rust, TypeScript, JavaScript, Python, Go, Dart, Solidity, OCaml
- 12 embedding models — from 22M-param MiniLM to 567M BGE-M3, auto-downloaded
Quick start
cargo install --git https://github.com/hicaru/zebra_tree_indexer
# index the current project
zebrarag index .
# search from the terminal
zebrarag search "retry logic"
# start as MCP stdio server for AI agents
zebrarag --mcp
See install for full setup and MCP config snippets.