haiku.rag
haiku.rag indexes PDFs, web pages, and whole directories, retrieves with hybrid search, and answers with citations down to the page number and section heading. It runs on an embedded database with open models, so your documents stay on your machine and there is no server to operate.
uv pip install haiku.rag
haiku-rag init
haiku-rag add-src ~/Documents/some-paper.pdf
haiku-rag ask "what does it conclude?"
Quickstart covers provider setup and the first ingestion.
Why haiku.rag
Answers you can check. Every answer carries citations with page numbers and section headings. Visual grounding shows the cited chunk highlighted on the original page image. An optional capability requires every answer to declare what grounds it, including declaring that nothing does.
Local-first, no server. Embedded LanceDB and open models through Ollama by default. No database to run and no API keys required. The same code runs against S3, GCS, Azure, LanceDB Cloud, or any provider Pydantic AI supports.
Built for agents. Native Pydantic AI capabilities compose into your own agents. An MCP server exposes the same database to Claude Desktop and other assistants. The capability runs sandboxed Python across documents for questions that need computation rather than retrieval.
Benchmarked. Retrieval and answer quality are tracked against public benchmarks with runnable configs. See Benchmarks.
What it does
- Ingest. PDFs, office documents, HTML, Markdown and images, converted by Docling in-process or on docling-serve. One-shot from the CLI, or continuously from filesystem, S3, HTTP and WebDAV sources with the ingester.
- Search. Hybrid vector and full-text search, optional reranking, section-aware context expansion, and image search with a multimodal embedder. Across several databases at once.
- Answer. The RAG capability searches, runs sandboxed Python over the documents, and cites what it used. Evidence compaction and a citation policy are optional.
- Integrate. A Python API, Pydantic AI capabilities for your own agents, an MCP server, and a web app to start from.
- Operate. Storage on local disk, S3, GCS, Azure or LanceDB Cloud, tags and rollback, vacuum,
haiku-rag doctorhealth checks, and an ingester with a job queue, retries and a dashboard.
Start here
- Quickstart: install, index, chat.
- Installation: packages and extras.
- Architecture: how a document becomes a cited answer.
- Capabilities: native capabilities for Pydantic AI agents.
- Python API: use haiku.rag from code.
- MCP server: expose haiku.rag to Claude Desktop or other AI assistants.
- Configuration: every setting.
MIT licensed. Source on GitHub.