$git clone https://github.com/ggozad/haiku.ragAgentic RAG built on LanceDB, Pydantic AI, and Docling.
| 1 | # Haiku RAG |
| 2 | |
| 3 | [](https://github.com/ggozad/haiku.rag/actions/workflows/test.yml) |
| 4 | [](https://codecov.io/gh/ggozad/haiku.rag) |
| 5 | |
| 6 | Agentic RAG built on [LanceDB](https://lancedb.com/), [Pydantic AI](https://ai.pydantic.dev/), and [Docling](https://docling-project.github.io/docling/). |
| 7 | |
| 8 | > **New: vision and multimodal search.** Picture-aware ingestion captures embedded figure bytes; vision-capable QA models receive them alongside text. Multimodal embedders put picture vectors in the same space as text, enabling text-as-query → figure hits and image-as-query retrieval. |
| 9 | |
| 10 | ## Features |
| 11 | |
| 12 | - **Hybrid search** — Vector + full-text with Reciprocal Rank Fusion |
| 13 | - **Multimodal & cross-modal search** — Multimodal embedders (vLLM, VoyageAI, Cohere) put picture vectors in the same space as text; supports text-as-query → figure hits and image-as-query |
| 14 | - **Question answering** — RAG skill with citations (page numbers, section headings) |
| 15 | - **Vision QA** — Vision-capable models receive figure bytes alongside chunk text |
| 16 | - **Reranking** — local cross-encoders, Cohere, Zero Entropy, or vLLM |
| 17 | - **Analysis skill** — Complex analytical tasks via sandboxed Python code execution (aggregation, computation, multi-document analysis) |
| 18 | - **Conversational RAG** — Chat TUI and web application for multi-turn conversations with session memory |
| 19 | - **Document structure** — Stores full [DoclingDocument](https://docling-project.github.io/docling/concepts/docling_document/), enabling structure-aware context expansion |
| 20 | - **Multiple providers** — Embeddings: Ollama, OpenAI, VoyageAI, Cohere, LM Studio, vLLM (multimodal via `multimodal: true` on vLLM/VoyageAI/Cohere). QA: any model supported by Pydantic AI |
| 21 | - **Local-first** — Embedded LanceDB, no servers required. Also supports S3, GCS, Azure, and LanceDB Cloud |
| 22 | - **CLI & Python API** — Full functionality from command line or code |
| 23 | - **MCP server** — Expose as tools for AI assistants (Claude Desktop, etc.) |
| 24 | - **Visual grounding** — View chunks highlighted on original page images |
| 25 | - **Production ingester** — Long-lived `haiku-ingester` service with persistent SQLite queue, async worker pool with retries and a dead-letter queue, FS / HTTP / S3 / WebDAV source adapters, FastAPI control plane, and a browser dashboard for operators. See [docs/ingester.md](docs/ingester.md). |
| 26 | - **Tags** — Name database states with `haiku-rag tag` and roll back to them |
| 27 | - **Inspector** — TUI for browsing documents, chunks, and search results |
| 28 | |
| 29 | ## Installation |
| 30 | |
| 31 | **Python 3.12 or newer required** |
| 32 | |
| 33 | ### Full Package (Recommended) |
| 34 | |
| 35 | ```bash |
| 36 | pip install haiku.rag |
| 37 | ``` |
| 38 | |
| 39 | Includes all features: document processing, all embedding providers, and rerankers. |
| 40 | |
| 41 | Using [uv](https://docs.astral.sh/uv/)? `uv pip install haiku.rag` |
| 42 | |
| 43 | ### Slim Package (Minimal Dependencies) |
| 44 | |
| 45 | ```bash |
| 46 | pip install haiku.rag-slim |
| 47 | ``` |
| 48 | |
| 49 | Install only the extras you need. See the [Installation](https://ggozad.github.io/haiku.rag/installation/) documentation for available options. |
| 50 | |
| 51 | ## Quick Start |
| 52 | |
| 53 | > **Note**: Requires an embedding provider (Ollama, OpenAI, etc.). See the [Tutorial](https://ggozad.github.io/haiku.rag/tutorial/) for setup instructions. |
| 54 | |
| 55 | ```bash |
| 56 | # Index a PDF |
| 57 | haiku-rag add-src paper.pdf |
| 58 | |
| 59 | # Search |
| 60 | haiku-rag search "attention mechanism" |
| 61 | |
| 62 | # Ask questions with citations |
| 63 | haiku-rag ask "What datasets were used for evaluation?" |
| 64 | |
| 65 | # Analyze — complex analytical tasks via code execution |
| 66 | haiku-rag analyze "How many documents mention transformers?" |
| 67 | |
| 68 | # Interactive chat — multi-turn conversations with memory |
| 69 | haiku-rag chat |
| 70 | |
| 71 | # Continuously ingest from configured sources (FS, HTTP, S3, WebDAV) |
| 72 | haiku-ingester serve |
| 73 | ``` |
| 74 | |
| 75 | See [Configuration](https://ggozad.github.io/haiku.rag/configuration/) for customization options. |
| 76 | |
| 77 | ## Python API |
| 78 | |
| 79 | ```python |
| 80 | from haiku.rag.client import HaikuRAG |
| 81 | |
| 82 | async with HaikuRAG("knowledge.lancedb", create=True) as rag: |
| 83 | # Index documents |
| 84 | await ra |