pypi haiku-ragstdioMITupdated 8d ago
Agentic RAG that answers questions about your own documents with citations to page numbers and section headings. Runs locally on an embedded database, no server required.
haiku rag 能做什么?
haiku.rag
Agentic RAG that answers questions about your own documents with citations to page numbers and section headings. Runs locally on an embedded database, no server required.
Built on LanceDB, Pydantic AI, and Docling. Full documentation at ggozad.github.io/haiku.rag.
Features
- Hybrid search — Vector + full-text with Reciprocal Rank Fusion
- 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
- Question answering — RAG capability with citations (page numbers, section headings)
- Vision QA — Vision-capable models receive figure bytes alongside chunk text; attach your own images to questions in
ask,analyze, MCP, and the chat TUI - Reranking — local cross-encoders, Cohere, Zero Entropy, or vLLM
- Analysis capability — Complex analytical tasks via sandboxed Python code execution (aggregation, computation, multi-document analysis)
- Evidence compaction — Optional capability that replaces earlier questions' search results on the request with the evidence they cited, so long conversations stop resending everything they retrieved
- Citation policy — Optional capability that requires every answer to declare what grounds it, including declaring that nothing does
- Conversational RAG — Chat TUI and web application for multi-turn conversations with session memory
- Document structure — Stores full DoclingDocument, enabling structure-aware context expansion
- Multiple providers — Embeddings: Ollama, OpenAI, VoyageAI, Cohere, LM Studio, vLLM (multimodal via
multimodal: trueon vLLM/VoyageAI/Cohere). QA: any model supported by Pydantic AI - Multi-database search — Search, ask, analyze, or chat across named databases with source attribution on results and citations
- Local-first — Embedded LanceDB, no servers required. Also supports S3, GCS, Azure, and LanceDB Cloud
- CLI & Python API — Full functionality from command line or code
- MCP server — Expose as tools for AI assistants (Claude Desktop, etc.)
- Visual grounding — View chunks highlighted on original page images
- Production ingester — Long-lived
haiku-ingesterservice 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. - Tags — Name database states with
haiku-rag tagand roll back to them - Inspector — TUI for browsing documents, chunks, and search results
Installation
Python 3.12 or newer required
Full Package (Recommended)
pip install haiku.rag
Includes all features: document processing, all embedding providers, and rerankers.
Using uv? uv pip install haiku.rag
Slim Package (Minimal Dependencies)
pip install haiku.rag-slim
Install only the extras you need. See the Installation documentation for available options.
Quick Start
Note: Requires an embedding provider (Ollama, OpenAI, etc.). See the Tutorial for setup instructions.
# Index a PDF
haiku-rag add-src paper.pdf
# Search
haiku-rag search "attention mechanism"
# Ask questions with citations
haiku-rag ask "What datasets were used for evaluation?"
# Ask about an image (vision-capable model)
haiku-rag ask "Does this figure match the spec in the design doc?" --image figure.png
# Analyze — complex analytical tasks via code execution
haiku-rag analyze "How many documents mention transformers?"
# Interactive chat — multi-turn conversations with memory
haiku-rag chat
# Continuously ingest from configured sources (FS, HTTP, S3, WebDAV)
haiku-ingester serve
See Configuration for customization options.
Python API
from haiku.rag.client import HaikuRAG
async with HaikuRAG("knowledge.lancedb", create=True) as rag:
# Index documents
await rag.create_document_from_source("paper.pdf")
await rag.create_document_from_source("https://arxiv.org/pdf/1706.03762")
# Search — returns chunks with provenance
results = await rag.search("self-attention")
for result in results:
print(f"{result.score:.2f} | p.{result.page_numbers} | {result.content[:100]}")
# QA with citations
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]}")
For direct agent composition, see the capabilities documentation.
MCP Server
Use with AI assistants like Claude Desktop:
haiku-rag mcp --stdio
Add to your Claude Desktop configuration:
{
"mcpServers": {
"haiku-rag": {
"command": "haiku-rag",
"args": ["mcp", "--stdio"]
}
}
}
Provides tools for document management, search, QA, and analysis directly in your AI assistant.
Examples
See the examples directory for working examples:
- Docker Setup - Complete Docker deployment with continuous ingestion (
haiku-ingester) and MCP server - Web Application - Full-stack conversational RAG with CopilotKit frontend
Documentation
Full documentation at: https://ggozad.github.io/haiku.rag/
- Quickstart - Provider setup and first ingestion
- Installation - Packages and extras
- Configuration - YAML reference
- CLI - Command reference
- Python API - Complete API docs
- Capabilities - Native Pydantic AI RAG and analysis capabilities
- Tuning - Retrieval and answer-quality tuning
- Ingester - Production ingester for continuous indexing from FS, HTTP, S3, and WebDAV
- MCP - Model Context Protocol integration
- Remote processing - Offload conversion to docling-serve
- Applications - Chat TUI, web app, and inspector
- Benchmarks - Performance benchmarks
- Changelog - Version history
License
This project is licensed under the MIT License.
mcp-name: io.github.ggozad/haiku-rag
安装
把 haiku rag 添加到你的客户端。选择你正在使用的那个。
claude mcp add haiku-rag -- uvx haiku-ragcodex mcp add haiku-rag -- uvx haiku-ragamp mcp add haiku-rag -- uvx haiku-rag{
"mcpServers": {
"haiku-rag": {
"command": "uvx",
"args": [
"haiku-rag"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"haiku-rag": {
"command": "uvx",
"args": [
"haiku-rag"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"haiku-rag","command":"uvx","args":["haiku-rag"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"haiku-rag": {
"command": "uvx",
"args": [
"haiku-rag"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"haiku-rag": {
"command": "uvx",
"args": [
"haiku-rag"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"haiku-rag": {
"command": "uvx",
"args": [
"haiku-rag"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"haiku-rag": {
"type": "local",
"command": "uvx",
"args": [
"haiku-rag"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"haiku-rag": {
"command": {
"path": "uvx",
"args": [
"haiku-rag"
]
}
}
}
}Add to your Zed `settings.json`.
uvx haiku-ragRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
评分
39 / 100
不完整
- 文档21/25
- 维护25/25
- 可信度13/20
- 能力0/15
- 安装体验12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 0 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
版本历史
| 版本 | 发布于 |
|---|---|
| 0.35.0 | 2026年3月24日 |
| 0.34.1 | 2026年3月16日 |
| 0.34.0 | 2026年3月13日 |
| 0.33.3 | 2026年3月12日 |
| 0.33.2 | 2026年3月11日 |
| 0.33.1 | 2026年3月6日 |
| 0.33.0 | 2026年3月4日 |
| 0.32.3 | 2026年3月3日 |
| 0.32.2 | 2026年2月28日 |
| 0.32.0 | 2026年2月24日 |
| 0.31.1 | 2026年2月20日 |
| 0.31.0 | 2026年2月20日 |
| 0.30.2 | 2026年2月19日 |
| 0.30.1 | 2026年2月17日 |
| 0.30.0 | 2026年2月16日 |
| 0.29.1 | 2026年2月10日 |
| 0.29.0 | 2026年2月6日 |
| 0.28.0 | 2026年1月31日 |
| 0.27.2 | 2026年1月29日 |
| 0.27.1 | 2026年1月27日 |
| 0.27.0 | 2026年1月26日 |
| 0.26.9 | 2026年1月22日 |
| 0.26.8 | 2026年1月22日 |
| 0.26.7 | 2026年1月20日 |
| 0.26.6 | 2026年1月19日 |
| 0.26.5 | 2026年1月16日 |
| 0.26.4 | 2026年1月15日 |
| 0.26.3 | 2026年1月15日 |
| 0.26.2 | 2026年1月13日 |
| 0.26.1 | 2026年1月13日 |
| 0.26.0 | 2026年1月13日 |
| 0.25.0 | 2026年1月12日 |
| 0.24.2 | 2026年1月8日 |
| 0.24.1 | 2026年1月8日 |
| 0.24.0 | 2026年1月7日 |
| 0.23.2 | 2026年1月5日 |
| 0.23.1 | 2025年12月29日 |
| 0.23.0 | 2025年12月26日 |
| 0.22.0 | 2025年12月19日 |
| 0.20.2 | 2025年12月12日 |
| 0.20.0 | 2025年12月10日 |
| 0.19.6 | 2025年12月3日 |
| 0.19.5 | 2025年12月1日 |
| 0.19.4 | 2025年11月28日 |
| 0.19.2 | 2025年11月27日 |
| 0.19.1 | 2025年11月26日 |
| 0.19.0 | 2025年11月25日 |
| 0.18.0 | 2025年11月21日 |
| 0.17.2 | 2025年11月19日 |
| 0.17.1 | 2025年11月18日 |
| 0.16.1 | 2025年11月14日 |
| 0.16.0 | 2025年11月13日 |
| 0.15.0 | 2025年11月7日 |
| 0.14.1 | 2025年11月6日 |
| 0.14.0 | 2025年11月5日 |
| 0.13.3 | 2025年10月30日 |
| 0.13.2 | 2025年10月29日 |
| 0.13.1 | 2025年10月28日 |
| 0.12.1 | 2025年10月16日 |
| 0.11.4 | 2025年10月8日 |