haiku.rag/docs/index.md
2026-05-20 12:46:48 +03:00

3.9 KiB

haiku.rag

Agentic RAG built on LanceDB, Pydantic AI, and Docling.

New: vision and multimodal search. Picture-aware ingestion captures embedded figure bytes; vision-capable QA models receive them alongside text. Multimodal embedders (vLLM with Qwen3-VL-Embedding-8B or jinaai/jina-embeddings-v4) put picture vectors in the same space as text, enabling text-as-query → figure hits and image-as-query retrieval.

Features

  • Hybrid search — Vector + full-text with Reciprocal Rank Fusion
  • Multimodal & cross-modal search — Multimodal embedders (vLLM) put picture vectors in the same space as text; supports text-as-query → figure hits and image-as-query
  • Question answering — RAG skill with citations (page numbers, section headings)
  • Vision QA — Vision-capable models receive figure bytes alongside chunk text via pydantic-ai BinaryContent when qa.model.vision = true
  • Reranking — MxBAI, Cohere, Zero Entropy, or vLLM
  • Analysis skill — Complex analytical tasks via sandboxed Python code execution (aggregation, computation, multi-document analysis)
  • 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, LM Studio, vLLM (multimodal). QA: any model supported by Pydantic AI
  • 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
  • File monitoring — Watch directories and auto-index on changes
  • Time travel — Query the database at any historical point with --before
  • Inspector — TUI for browsing documents, chunks, and search results

Quick Start

Install haiku.rag:

uv pip install haiku.rag

Use from Python:

from haiku.rag.client import HaikuRAG

async with HaikuRAG("database.lancedb", create=True) as client:
    # Add a document
    doc = await client.create_document("Your content here")

    # Search documents
    results = await client.search("query")

    # Ask questions (returns answer and citations)
    answer, citations = await client.ask("Who is the author of haiku.rag?")

Or use the CLI:

haiku-rag add "Your document content"
haiku-rag add "Your document content" --meta author=alice
haiku-rag add-src /path/to/document.pdf --title "Q3 Financial Report" --meta source=manual
haiku-rag search "query"
haiku-rag ask "Who is the author of haiku.rag?"
haiku-rag chat  # Interactive conversation mode

Documentation

License

This project is licensed under the MIT License.