中文

haiku.rag: Agentic RAG

haiku.rag is agentic RAG that answers questions about your own documents with citations to page numbers and section headings.

Verified

Core facts

Read by a script from the official API, not rewritten by a model.

License
MIT
Languages
Python
Maintainer
ggozad
Verified

What it is

haiku.rag is agentic RAG that answers questions about your own documents with citations to page numbers and section headings. It runs on an embedded LanceDB database with open models through Ollama by default. No server or API key is needed with that setup. A provider that Pydantic AI supports works in place of the open models through Ollama.

Main features

  1. haiku.rag ingests PDFs, office documents, HTML, Markdown and images with Docling, in-process or on docling-serve.

  2. haiku.rag search uses hybrid vector and full-text retrieval.

  3. haiku.rag search offers optional reranking with cross-encoders, Jina, Cohere, Zero Entropy, vLLM and OpenRouter.

  4. With the RAG capability, it searches, runs sandboxed Python over the documents for counting and aggregation, and cites page numbers and headings.

  5. haiku.rag checks a citation by drawing its chunk on the page image, from the CLI, the chat TUI or Python.

  6. haiku.rag integrates through an MCP server for Claude Code, Codex and Claude Desktop, and a reference web app.

Getting started

  1. The default configuration uses Ollama for embeddings and answers.

  2. Continuous ingestion from configured sources runs as a separate service.

  3. The MCP server gives an assistant search, document reading and a Python sandbox over the documents.

From the README · bash
pip install haiku.rag        # Docling, the VoyageAI and Cohere embedders, every reranker, the TUI
pip install haiku.rag-slim   # the core, with extras chosen by you
From the README · bash
haiku-rag init                                  # create the database
haiku-rag add-src paper.pdf                     # index a file, URL or directory
haiku-rag search "attention mechanism"
haiku-rag ask "What datasets were used for evaluation?"
haiku-rag ask "How many documents mention transformers?"
haiku-rag ask "Does this figure match the spec?" --image figure.png
haiku-rag chat                                  # multi-turn chat in the terminal
From the README · bash
haiku-ingester serve
From the README · bash
haiku-rag mcp --stdio
From the README · bash
claude plugin marketplace add ggozad/haiku.rag
claude plugin install haiku-rag

Who it is for

haiku.rag requires Python 3.12 or newer. The ingester, S3 access and model providers other than Ollama and OpenAI-compatible endpoints are extras. The same database can live on S3, GCS, Azure or LanceDB Cloud.

The stored DoclingDocument keeps headings, tables, pictures and page provenance. haiku.rag search includes section-aware context expansion. haiku.rag search includes image search with a multimodal embedder (vLLM, OpenRouter, VoyageAI, Cohere).

Search runs across several named databases at once. Vision models receive the figures. Optional capabilities compact earlier evidence in long conversations and require every answer to declare its grounding.

haiku.rag also integrates through plugin hooks that observe document writes and transform searches. haiku.rag also integrates through the Python API and native Pydantic AI capabilities. The ingester service offers filesystem, HTTP, S3 and WebDAV sources, a SQLite or Postgres job queue with retries, a control plane and dashboard.

The Docker setup example covers docling-serve, the ingester and the MCP server. The web application example provides chat, ingestion, inspector and doctor in the browser.

Sources

This page is written from the official sources below. Open them to check the original text.

Verified ·

This page is written by AI from the official sources above and checked automatically. This site has not tested it. Found a mistake? Tell us.