
quillrag
io.github.Ayush-yadav11由 GitHub 帳號 Ayush-yadav11 發布v0.1.3更新於 Oct 25, 2026
Single-binary local RAG MCP server in Rust. MiniLM compiled in, hybrid search, zero deps.
概覽
以 Rust 撰寫的單一檔案本機 RAG 伺服器,讓助理索引筆記、文件與程式碼資料夾,並以稠密向量加 BM25 的混合檢索查詢。
- 可以做什麼
- 增量索引目錄或檔案,略過未變更的檔案、只重新嵌入差異部分,清理範圍限於所索引的根目錄,並會跟隨符號連結。以 MiniLM 向量與 BM25 關鍵字的混合檢索查詢索引,回傳附來源路徑的排序片段。回報文件與片段數量、已索引位元組數和檔案類型分布。依需求清空整個儲存區。
- 適用情境
- 適合讓助理在同一台機器上針對個人或專案的筆記、文件與原始碼語料回答問題,且不想執行 Node、Python 或獨立的模型服務。最適合片段數在數萬以內的語料,此時檢索仍維持互動速度。
- 執行需求
- 以本機 stdio 程序在使用者機器上執行(僅桌面端)。可安裝 Linux、macOS 或 Windows 的預先編譯二進位檔,或以 Rust 工具鏈從原始碼建置;Linux 二進位檔需要 glibc 2.39 或更新版本。資料目錄透過環境變數 QUILLRAG_DATA 指定。不需帳號、API 金鑰或網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 quillrag,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
quillrag
One file. Zero dependencies. Ready before your editor finishes loading.
A local RAG engine in a single static binary — MiniLM embeddings compiled inside, hybrid dense + BM25 retrieval, MCP-native. No Node, no Python, no model download on first query.
[release] [platforms] [license]
[quillrag terminal demo: serve, index, search]Why quillrag
Quick start
Or wire it straight into Claude Desktop / Cursor and let the AI search your notes mid-conversation — config below.
Why it's fast
The embedding model is lazy: the MCP handshake and rag_status never touch
it, so editors see an instant server.
Install
Download a prebuilt archive from the latest release — Windows x86_64, macOS Apple Silicon, and Linux x86_64 are all built by CI on every version tag:
Linux requirement: v0.1.6 binaries are built on Ubuntu 24.04 runners and link glibc 2.39 (
pidfd_spawnp/pidfd_getpid). On older distros (glibc < 2.39, e.g. Ubuntu 22.04), build from source with your local toolchain instead:cargo install --path ..
Or build from source:
Cross-compile targets used by CI: x86_64-unknown-linux-gnu,
aarch64-apple-darwin, x86_64-pc-windows-msvc.
Wire it into your editor
Claude Desktop / Cursor / any MCP client:
Or just run ./quillrag serve and point any stdio client at it.
Tools
CLI equivalents (same engine):
Design
- Embeddings: candle (pure Rust)
running
sentence-transformers/all-MiniLM-L6-v2— masked mean pooling + L2 norm, numerically matching sentence-transformers on CPU. Weights areinclude_bytes!-ed into the binary and mmap'd from a materialized cache on first load. - Storage: single redb file — chunk text, raw f32 vectors, document metadata. Atomic commits; crash-safe.
- Keywords: tantivy BM25 sidecar index rebuilt per indexing pass (cheap at pocket scale).
- Fusion: Reciprocal Rank Fusion (
Σ 1/(60+rank)) — no score-scale tuning, robust to heterogeneous rankings. - Chunking: paragraph-first with 1000-char cap and 120-char overlap; oversized paragraphs hard-split at sentence boundaries.
File types indexed by default
md markdown txt rst json yaml yml toml csv tsv html htm xml log rs py js jsx ts tsx go c h cpp hpp java rb sh bash zsh sql proto graphql dockerfile makefile ini cfg conf env — extend with -e ext1,ext2 / "extensions": [...].
Ignored dirs: every dot-directory (.git .obsidian .vscode …) plus
node_modules target dist build venv __pycache__ vendor.
Optional formats (library features)
Applications embedding the engine (default-features = false) can index more
through IndexHooks extractors:
Files that are readable but contain no text are recorded as empty documents,
so unchanged ones are not re-OCR'd on every pass (IndexOptions::retry_empty
re-checks them).
Indexing behavior
- Pruning is scoped to the index root. Docs indexed from
~/work-docssurvive a laterquillrag index ~/personal-notesagainst the same data dir. Only files that lived under the directory being walked and have since disappeared get pruned. Existing files excluded by extensions or size stay indexed.--no-prunedisables deletion, including through MCP'sno_prune.--forcere-embeds only the selected sources. Useclearexplicitly to wipe a store. An empty successful scan warns and may prune that root's last file. - Symlinks are followed. Staging trees built from symlinked source dirs index normally. Cycles, broken links, and unreadable directories abort the walk before changing the store. Paths retain symlink aliases, so indexing both an alias and its target creates separate entries.
- Progress is logged per 128-chunk embedding batch (stderr), so a long CPU indexing run is visibly alive.
Upgrading existing indexes
Older batched indexing could associate document paths with the wrong chunks.
The fix cannot reconstruct those associations from the stored index alone.
Build a fresh data directory from your source files, verify search results,
then switch your client to it. Keep the old directory until verification passes.
This also removes legacy relative-path keys, which the new indexer preserves
rather than guessing their original working directory. New keys are absolute.
Paths containing .. resolve through the filesystem; use a stable spelling
for symlink-based roots. Re-indexing refreshes the BM25 sidecar as well.
Privacy & footprint
Everything runs locally: embeddings, storage, search. Nothing leaves the machine — there is no network code path at all after installation.
Binary ≈ 105 MB (the model lives inside). RAM ≈ 120 MB resident while idle, spiking to ~250 MB during batch embedding.
Scaling & limits
quillrag stores everything in a single redb file and runs dense retrieval as
an exact, single-threaded linear scan over all vectors — no ANN index yet.
That makes the relevant limit query latency, not storage. Storage scales to
millions of chunks; retrieval speed is O(N) per query.
Verified on a corpus of 1K chunks (5/5 tests including real JSON-RPC-over-stdio
e2e); figures above 1K are extrapolated from the O(N) dense-scan cost, not
measured. A synthetic scale probe (src/bin/quillbench.rs) exists to measure
the curve on your own hardware — run cargo build --release && ./target/release/quillbench.
What this means in practice:
- Great fit: personal/local knowledge bases, project docs, notes, code — up to low-tens-of-thousands of chunks where sub-second-to-interactive latency holds.
- Away from the sweet spot: corpora in the hundreds of thousands+ where you need interactive (<200 ms) retrieval — you'll want an ANN index (see Roadmap).
How it compares to common alternatives on the relevance axis:
- Embedding-only (e.g. raw FAISS flat / simple vector store): same
all-MiniLM-L6-v2ceiling as quillrag's dense path, but quillrag adds BM25 + RRF fusion, which wins on keyword-heavy queries (error codes, IDs, exact tokens). quillrag has no reranker or metadata filtering, which llama-index offers on top. - llama-index local backends: functionally similar hybrid retrieval (BM25 + vector + RRF). quillrag trades llama-index's rich reranking/parent-child chunking/query-expansion for a zero-dependency single binary and instant startup. Relevance on a standard dataset (BEIR/MS MARCO) is not yet benchmarked — see the open issue tracking ANN + a relevance baseline.
Roadmap
quillrag is deliberately minimal today. The big unlock is an approximate nearest-neighbor index:
- ANN (HNSW / IVF) over the dense vectors — turns O(N) scan into sub-millisecond ANN lookup, pushing the interactive ceiling from ~10K to millions of chunks on a single machine.
- Quantization (PQ / SQ) — drops vector RAM from 4 bytes/dim to ~1 byte/dim, so 1M chunks ≈ 380 MB instead of 1.5 GB.
- Multi-threaded scan — parallelize the current exact path as a stopgap.
- Reranker hook — optional cross-encoder rerank of the fused top-k.
- Relevance benchmark — BEIR / MS MARCO nDCG@10 vs. llama-index baselines.
Track the ANN work here: issue #1 — "ANN index for <1M chunks."
FAQ
Is it really one file? Yes. The MiniLM weights + tokenizer are compiled in
via include_bytes!. No npm install, no Python, no model download on first
query. The binary is ~105 MB because the model lives inside it.
Why is startup so fast? The embedding model is lazy. The MCP handshake and
rag_status never touch it — editors see a ready server in ~20 ms. The model
only loads on the first rag_search / rag_index (~300 ms one-time).
What's the largest corpus it handles? Verified at 1K chunks (~25 ms/query). The architecture scales to millions of stored chunks; interactive retrieval holds up to low-tens-of-thousands today, and an ANN index (Roadmap) extends that to 1M+.
How is this different from llama-index? Similar hybrid retrieval quality, but quillrag is a single static binary with no runtime/dependency footprint and instant startup. llama-index adds rerankers, sophisticated chunking, and query expansion that quillrag doesn't have yet.
What file types are indexed? md markdown txt rst json yaml yml toml csv tsv html htm xml log rs py js jsx ts tsx go c h cpp hpp java rb sh bash zsh sql proto graphql dockerfile makefile ini cfg conf env — extend with -e.
Does it phone home? No. There is no network code path after installation.
Changelog
- v0.1.6: root-scoped pruning, working
--no-prune, source-scoped--force, symlink traversal with failure-safe discovery, absolute source keys, and correct partial-batch progress. Fixes shuffled document/chunk associations in batched writes and missing BM25 result paths. Rebuild old indexes into a fresh directory as described above. - v0.1.5: withdrawn draft. Initial safety fixes were incomplete; do not use this tag for production.
- v0.1.4 — multi-thread inference + batched indexing.
- v0.1.3 — MCP tool descriptions rewritten for clarity, parameter semantics, and behavioral transparency (read-only/destructive flags, usage guidance); server.json shipped in-repo for MCP Registry publishing.
- v0.1.2 — skip all dot-directories when indexing (
.obsidianplugin configs no longer pollute results); first fully automated 3-platform CI release. Upgrade note: runquillrag clearonce and re-index. - v0.1.1 — CI-built release artifacts for linux/macos/windows with checksums.
- v0.1.0 — initial public release; renamed from pocketrag.
Development
License: MIT. The optional OCR models under assets/ocr/ are CC BY-SA 4.0;
see assets/ocr/NOTICE.md.
來源:README.md,提交 59af470
工具
0版本歷史
1- v0.1.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分