Ragmir is an open-source retrieval layer for coding agents and user-delivered RAG systems. It provides a TypeScript library, CLI, and MCP server that can run locally or on your own server.
Purpose: convert code, specifications, Office files, PDFs, and scanned documents into a local search index for querying by Claude Code, Codex, Cursor, LangChain, LlamaIndex, or self-built applications, returning passages with citations. The agent handles planning, reasoning, and writing, while Ragmir handles finding evidence.
Key capabilities:
- Supports multiple file types: code, Office files, PDFs, scanned documents, EPUB, and more.
- Provides an MCP server exposing tools such as ragmir_search, ragmir_expand, ragmir_sources, ragmir_status, ragmir_audit, and ragmir_ingest.
- Supports Claude Code, Codex, and Cursor plugins, Gemini CLI and Qwen Code extensions, and Agent Skills for any agent.
- Provides a TypeScript API, LangChain.js retriever, Python client, LangChain/LangGraph toolkit, and LlamaIndex retriever.
- Citations can point to source code lines, PDF pages, slides, table cells, EPUB chapters, or exported objects.
- Results mark whether a file has changed since indexing (sourceStatus) and whether the evidence is weak (weakEvidence).
- Questions that cannot be answered return empty results rather than noise.
- Provides the rgr evaluate tool to assess retrieval quality using recall, MRR, nDCG, citation accuracy, and false positive rate, with comparison against a baseline and threshold setting in CI.
- By default, local hash retrieval runs offline on CPU, requiring no GPU, embedding API, or database server; the index is stored in an embedded LanceDB in the .ragmir/ folder.
- Optional local semantic models and OCR engines (Tesseract, OCRmyPDF, etc.).
- Supports WebGPU-accelerated embeddings (ingestEmbeddingDevice: "webgpu").
- Provides the rgr doctor diagnostic tool and rgr hooks for automatic index refresh.
- Cross-platform support for macOS, Linux, and Windows.
Usage:
- Requires Node.js 22.12 or later.
- Install using the project package manager, e.g. pnpm.
- Agents such as claude, codex, kimi, opencode, and cline can be specified via the --agents parameter.
- The configuration file ragmir.config.json can be committed to Git for sharing.
- Invoke via MCP, CLI (rgr), TypeScript, or Python.
- Provides a Docker image that can run in offline environments.
Use cases:
- Coding agents need to retrieve large amounts of documentation and codebases.
- Teams need to deploy RAG on their own infrastructure to meet data privacy and security review requirements.
- RAG applications that require precise citations and traceable answers.
- Personal corpus retrieval, such as research materials, historical records, bank statements, etc., can be paired with local models (e.g. Ollama) to keep data local.
Limitations:
- Does not bundle a chat or generation model.
- Does not host documents, does not provide hosted storage, and has no telemetry.
- Does not open HTTP ports.
- Confidentiality depends on the entire consumption path (application, model, tools, logs).
- Sensitive file exclusion and local permission checks cannot replace source selection and access control.
- OCR is slow on first processing of scanned documents.
- Semantic retrieval requires installing optional runtimes and local models.
- Open source license is AGPL-3.0-only, with a separate commercial license.