haiku.rag

io.github.ggozad由 GitHub 账号 ggozad 发布v0.109.0更新于 Nov 7, 2026

Local-first agentic RAG with citations - hybrid search, reranking, multimodal document retrieval

概览

AI 生成的概览

本地优先的 RAG 服务器,让助手检索、阅读并基于你自己的文档回答问题,并给出页码与标题级引用。

可以做什么
  • 以向量与全文混合检索搜索已索引文档,可选重排序与按章节扩展上下文,并可同时查询多个命名数据库。
  • 阅读并回答已入库文档的问题,答案附带页码与标题引用。
  • 在文档上运行沙箱 Python 进行计数与聚合,并把图表交给视觉模型。
  • 导入 PDF、办公文档、HTML、Markdown 与图片,保留标题、表格、图片与页码来源。
适用场景
当你希望助手基于私有文档集(如论文、报告或手册)作答,并能指出每个答案的出处时使用。也适合文档需留在本机、偏好本地离线运行的场景。
运行要求
以 stdio 本地进程运行,通过 uvx 或 pip 从 PyPI 安装,需要 Python 3.12 或更高版本。默认使用 Ollama 提供嵌入与回答,需先在本地拉取模型;其他模型提供方以及 S3、GCS、Azure 或 LanceDB Cloud 存储为可选扩展。需先初始化数据库并索引文档。
安装前请注意
回答与检索质量取决于已索引的语料,且服务器可在你的文档上运行沙箱 Python。改用非默认模型提供方或远程存储会把文档内容与查询发送给这些第三方。ingester 服务可持续从文件系统、HTTP、S3 与 WebDAV 来源抓取内容。

安装

在 SourceWeft 中

  1. 打开 控制台中的 haiku.rag,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

haiku.rag

[PyPI] [Python] [Downloads] [Docs] [Tests] [codecov]

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, so no server or API key is needed. Any provider Pydantic AI supports works in their place, and the same database can live on S3, GCS, Azure or LanceDB Cloud.

Built on LanceDB, Pydantic AI and Docling. Documentation: ggozad.github.io/haiku.rag.

Features

  • Ingest PDFs, office documents, HTML, Markdown and images with Docling, in-process or on docling-serve. The stored DoclingDocument keeps headings, tables, pictures and page provenance.
  • Search with hybrid vector and full-text retrieval, optional reranking (cross-encoders, Jina, Cohere, Zero Entropy, vLLM, OpenRouter), section-aware context expansion, and image search with a multimodal embedder (vLLM, OpenRouter, VoyageAI, Cohere). Across several named databases at once.
  • Answer with the RAG capability: it searches, runs sandboxed Python over the documents for counting and aggregation, and cites page numbers and headings. Vision models receive the figures. Optional capabilities compact earlier evidence in long conversations and require every answer to declare its grounding.
  • Check a citation by drawing its chunk on the page image, from the CLI, the chat TUI or Python.
  • Integrate through the Python API, native Pydantic AI capabilities, plugin hooks that observe document writes and transform searches, an MCP server for Claude Code, Codex and Claude Desktop, and a reference web app.
  • Operate with the haiku-ingester service (filesystem, HTTP, S3 and WebDAV sources, a SQLite or Postgres job queue with retries, a control plane and dashboard), tags and rollback, vacuum, and haiku-rag doctor health checks.

Installation

Python 3.12 or newer.

bash
pip install haiku.rag        # Docling, the VoyageAI and Cohere embedders, every reranker, the TUIpip install haiku.rag-slim   # the core, with extras chosen by you

The ingester, S3 access and model providers other than Ollama and OpenAI-compatible endpoints are extras. See Installation.

Quick start

The default configuration uses Ollama for embeddings and answers. The quickstart covers the models to pull and using OpenAI instead.

bash
haiku-rag init                                  # create the databasehaiku-rag add-src paper.pdf                     # index a file, URL or directoryhaiku-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.pnghaiku-rag chat                                  # multi-turn chat in the terminal

Continuous ingestion from configured sources runs as a separate service, with the ingester extra (pip install 'haiku.rag[ingester]'):

bash
haiku-ingester serve

Python API

python
from haiku.rag.client import HaikuRAG
async with HaikuRAG("knowledge.lancedb", create=True) as rag:    await rag.create_document_from_source("paper.pdf")    await rag.create_document_from_source("https://arxiv.org/pdf/1706.03762")
    results = await rag.search("self-attention")    for result in results:        print(f"{result.score:.2f} | p.{result.page_numbers} | {result.content[:100]}")
    answer, citations = await rag.ask("What is the complexity of self-attention?")    print(answer)    for cite in citations:        print(f"  [{cite.chunk_id}] p.{cite.page_numbers}: {cite.content[:80]}")

To compose your own agent, see Capabilities.

MCP server

bash
haiku-rag mcp --stdio

The server gives an assistant search, document reading and a Python sandbox over the documents. In Claude Code, the plugin registers it with a skill:

bash
claude plugin marketplace add ggozad/haiku.ragclaude plugin install haiku-rag

Codex and Claude Desktop setup is in the MCP docs.

Examples

Documentation

License

MIT.

mcp-name: io.github.ggozad/haiku-rag

来源:README.md,提交 ee0c087

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

27
  1. v0.109.0最新Nov 7, 2026
  2. v0.108.0Nov 5, 2026
  3. v0.107.0Nov 4, 2026
  4. v0.106.0Nov 3, 2026
  5. v0.105.0Nov 3, 2026
  6. v0.104.0Oct 30, 2026
  7. v0.103.0Oct 29, 2026
  8. v0.101.1Oct 26, 2026
  9. v0.101.0Oct 23, 2026
  10. v0.100.0Oct 22, 2026
  11. v0.99.0Oct 21, 2026
  12. v0.98.0Oct 16, 2026
  13. v0.97.0Oct 12, 2026
  14. v0.96.1Oct 9, 2026
  15. v0.96.0Oct 9, 2026
  16. v0.95.0Oct 8, 2026
  17. v0.94.0Oct 7, 2026
  18. v0.93.0Oct 6, 2026
  19. v0.92.0Oct 2, 2026
  20. v0.91.0Sep 30, 2026
  21. v0.90.0Sep 28, 2026
  22. v0.89.0Sep 25, 2026
  23. v0.88.2Sep 24, 2026
  24. v0.88.1Sep 23, 2026
  25. v0.88.0Sep 21, 2026
  26. v0.87.0Sep 17, 2026
  27. v0.86.0Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分