# haiku-rag [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/ggozad/haiku.rag  
**GitHub Stars:** 669  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/haiku-rag

## Description
Agentic Retrieval Augmented Generation (RAG) with LanceDB

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "haiku-rag": {
    "command": "uvx",
    "args": ["haiku.rag"]
  }
}
```

## Documentation

## What haiku-rag does

haiku-rag turns a LanceDB document collection into MCP-accessible knowledge for AI assistants. The server lets an assistant search indexed content, read relevant document material, and execute sandboxed Python against the documents for tasks such as counting and aggregation. Answers can cite source page numbers and section headings, making it possible to trace a response back to the indexed material.

The underlying project is an agentic retrieval-augmented generation system rather than a general-purpose file browser. Documents must first be indexed with haiku-rag, after which the MCP interface can retrieve and analyze their stored representations. The project stores Docling-processed document data, including structure such as headings, tables, pictures, and page provenance.

## How it works

Run the server over standard input and output with:

```bash
haiku-rag mcp --stdio
```

An MCP-compatible client starts the process and communicates with it through the stdio transport. The assistant can then use the exposed document search and reading functions, along with the Python sandbox, to gather evidence and perform calculations.

Retrieval combines vector and full-text search. Optional reranking and section-aware context expansion can improve the material supplied to an answer, while image-capable retrieval and vision models support collections containing figures. Searches can span multiple named databases. The RAG workflow can also use the retrieved documents for numerical questions instead of relying only on generated text.

The database is embedded LanceDB storage by default. LanceDB data can also be hosted on S3, GCS, Azure, or LanceDB Cloud. Ollama is the default route for embeddings and answers, so a local setup can run without an API key or separate model server managed by haiku-rag. Providers supported by Pydantic AI can replace it.

## Setup and configuration

Install Python 3.12 or newer, then install the package:

```bash
pip install haiku.rag
```

A slim package is also available when you want to select optional components yourself:

```bash
pip install haiku.rag-slim
```

Create and populate a database before launching the MCP process. For example, the CLI can initialize storage and index a PDF, URL, or directory:

```bash
haiku-rag init
haiku-rag add-src paper.pdf
```

The default configuration uses Ollama for embeddings and answer generation. Other model providers, S3 access, and the continuous-ingestion service are optional installation choices. Claude Code can register the server through the haiku-rag plugin; separate setup instructions are available for Codex and Claude Desktop.

## Tools and capabilities

The MCP interface provides:

- Search across indexed documents using hybrid retrieval.
- Read document content selected from the indexed collection.
- Run sandboxed Python for document-based counting and aggregation.
- Produce grounded answers with page and section citations.
- Work with several named databases in a search operation.
- Use document figures with vision-capable models where the configured retrieval and model providers support them.

The wider haiku-rag package also includes a Python API, CLI search and chat, document ingestion for PDFs, office files, HTML, Markdown, and images, plus citation inspection. Those functions are part of the surrounding project; the MCP entry point is specifically intended to make document search, reading, and Python analysis available to assistants.

## Limitations and notes

The server operates on indexed content rather than automatically discovering arbitrary files at query time. Document ingestion is a separate step, either through the CLI or the optional `haiku-ingester` service. Local operation depends on the models configured for Ollama, while alternative providers may require their own packages, services, or credentials. A client must support MCP over stdio, and the database must be accessible to the process that launches the server.

_Full upstream README: https://allmcps.com/mcp/haiku-rag/readme_

