haiku.rag/examples
Yiorgis Gozadinos ce69a8c989
Remove the MCP write tools; the server opens read-only
add_document_from_file, add_document_from_url, add_document_from_text
and delete_document are gone. create_mcp_server and _covering lose
read_only; the client always opens with read_only=True, so the
--read-only flag before `mcp` is redundant and the docs, Dockerfiles and
compose example drop it.

Ingestion is `haiku-rag add`/`add-src`/`delete` and haiku-ingester. No
known consumer used the write tools; one stdio server per client window
made multi-writer the accidental default, and streamable HTTP has no auth.

The test_app stub drops a comment and __init__ that described run_mcp
constructing the client positionally; every path goes through _covering.

Refs #599
2026-09-04 12:59:48 +03:00
..
docker Remove the MCP write tools; the server opens read-only 2026-09-04 12:59:48 +03:00
samples Use biome on the frontend for linting, add to CI 2026-01-16 15:03:41 +02:00
custom_agent.py Register the optional capabilities where agents are composed 2026-08-13 15:04:05 +03:00
custom_agent_agui.py Remove the environment overrides and the last unnamed-database wording 2026-09-03 15:12:09 +03:00
README.md Remove the environment overrides and the last unnamed-database wording 2026-09-03 15:12:09 +03:00

haiku.rag Examples

This directory contains example scripts demonstrating various features of haiku.rag.

Docker Example

Directory: docker/

Complete Docker setup for running haiku.rag with all services:

  • Continuous ingestion from a watched directory via haiku-ingester
  • MCP server for AI assistant integration

See docker/README.md for setup instructions.

Custom Agent

Script: custom_agent.py

Uses the eagerly loaded RAG capability to build a conversational agent.

uv run python examples/custom_agent.py /path/to/db.lancedb

Custom Agent with AG-UI Streaming

Script: custom_agent_agui.py

A Starlette app that adapts a native RAG-capable agent to AG-UI. The configuration places the database (HAIKU_RAG_CONFIG_PATH, or ./haiku.rag.yaml):

uv run uvicorn examples.custom_agent_agui:app --reload --port 8000