### Skill Generation and Installation Example
Source: https://ggozad.github.io/haiku.rag/cli
Example workflow for generating a custom skill, installing it, and using it with haiku-skills.
```bash
# Generate a skill with specific tools and custom preamble
haiku-rag create-skill \
--name medic \
--db /path/to/medic.lancedb \
--tools search,cite \
--config-file /path/to/haiku.rag.yaml \
--description "Military medic knowledge base" \
--preamble "You are a military medic expert."
# Install the generated package
uv pip install -e ./medic-skill
# Use with haiku-skills
haiku-skills chat --use-entrypoints --skill medic
```
--------------------------------
### Install and run a custom skill
Source: https://ggozad.github.io/haiku.rag/skills/custom
Install the generated package in editable mode and verify its availability before starting a chat session.
```bash
uv pip install -e ./recipes-skill
haiku-skills list --use-entrypoints
# recipes — Recipe and cooking knowledge base
haiku-skills chat --use-entrypoints --skill recipes
```
--------------------------------
### Start the development environment
Source: https://ggozad.github.io/haiku.rag/apps
Use Docker Compose to build and start the application services in the background.
```bash
cd app
docker compose -f docker-compose.dev.yml up -d --build
```
--------------------------------
### Install and Configure Cohere Reranking
Source: https://ggozad.github.io/haiku.rag/configuration/providers
Install the required extra and configure the provider settings with the API key.
```bash
uv pip install haiku.rag-slim[cohere]
```
```yaml
reranking:
model:
provider: cohere
name: rerank-v3.5
```
```bash
export CO_API_KEY=your-api-key
```
--------------------------------
### Initialize and run haiku.rag
Source: https://ggozad.github.io/haiku.rag/overview
Commands to install the package, pull required models, initialize the environment, add a document, and start the chat interface.
```bash
uv pip install haiku.rag
ollama pull qwen3-embedding:4b
ollama pull gpt-oss
haiku-rag init
haiku-rag add-src ~/Documents/some-paper.pdf
haiku-rag chat
```
--------------------------------
### Install a custom skill locally
Source: https://ggozad.github.io/haiku.rag/skills/custom
Use the uv package manager to install the skill in editable mode.
```bash
uv pip install -e .
```
--------------------------------
### Install and Configure Zero Entropy Reranking
Source: https://ggozad.github.io/haiku.rag/configuration/providers
Install the required extra and configure the provider settings with the API key.
```bash
uv pip install haiku.rag-slim[zeroentropy]
```
```yaml
reranking:
model:
provider: zeroentropy
name: zerank-1 # Currently the only available model
```
```bash
export ZEROENTROPY_API_KEY=your-api-key
```
--------------------------------
### Setup Development Environment
Source: https://ggozad.github.io/haiku.rag/development
Commands to clone the repository and synchronize dependencies using uv.
```bash
git clone https://github.com/ggozad/haiku.rag.git
cd haiku.rag
uv sync
```
--------------------------------
### Install Full Package
Source: https://ggozad.github.io/haiku.rag/installation
Installs the full haiku.rag package including all features and dependencies.
```bash
uv pip install haiku.rag
```
--------------------------------
### Install and Configure Jina AI Reranking (Local Mode)
Source: https://ggozad.github.io/haiku.rag/configuration/providers
Install the local jina extra and configure the provider for local inference.
```bash
uv pip install haiku.rag-slim[jina]
```
```yaml
reranking:
model:
provider: jina-local
name: jinaai/jina-reranker-v3
```
--------------------------------
### Install Slim Package
Source: https://ggozad.github.io/haiku.rag/installation
Installs the slim version of the package with optional extras for specific functionality.
```bash
# Minimal installation (no document processing)
uv pip install haiku.rag-slim
# With document processing
uv pip install haiku.rag-slim[docling]
# With specific providers
uv pip install haiku.rag-slim[docling,voyageai,cross-encoder]
```
--------------------------------
### Install Ingester Package
Source: https://ggozad.github.io/haiku.rag/ingester
Install the ingester component using pip with either the slim or full package options.
```bash
pip install 'haiku.rag-slim[ingester]'
# or, for the full package:
pip install 'haiku.rag[ingester]'
```
--------------------------------
### Configure WebDAV Source
Source: https://ggozad.github.io/haiku.rag/ingester
Example configuration for a WebDAV source using basic authentication.
```yaml
ingester:
sources:
- type: webdav
id: nextcloud
base_url: https://nextcloud.example.com/remote.php/dav/files/alice/Documents/
username: alice
password: ${NEXTCLOUD_APP_PASSWORD}
ignore_patterns: ["**/Trash/**"]
poll_interval_s: 600
```
--------------------------------
### Complete configuration example
Source: https://ggozad.github.io/haiku.rag/configuration
A full reference for all configurable parameters including storage, ingestion, vector database, reranking, search, and processing options.
```yaml
# haiku.rag.yaml
environment: production
storage:
data_dir: "" # Empty = use default platform location
vacuum_retention_seconds: 86400
ingester:
sources:
- type: fs
id: local-docs
root: /path/to/documents
ignore_patterns: [] # Gitignore-style patterns to exclude
include_patterns: [] # Gitignore-style patterns to include
delete_orphans: true
lancedb:
uri: "" # Empty for local, or db://, s3://, az://, gs://
api_key: ""
region: ""
embeddings:
model:
provider: ollama
name: qwen3-embedding:4b
vector_dim: 2560
reranking:
model:
provider: "" # Empty to disable, or cross-encoder, cohere, zeroentropy, vllm
name: ""
qa:
model:
provider: ollama
name: gpt-oss
enable_thinking: true
temperature: 0.3
max_searches: 3
search:
limit: 10 # Default number of results to return
max_context_chars: 5000 # Maximum characters in expanded context
vector_index_metric: cosine # cosine, l2, or dot
vector_refine_factor: 30
doctor:
duplicates: # Near-duplicate document detection (doctor command)
similarity_threshold: 0.97 # cosine cutoff on document embedding centroids
min_chunks: 3 # documents with fewer chunks are excluded
prompts:
domain_preamble: "" # Prepended to skill instructions
processing:
converter: docling-local # docling-local or docling-serve
chunker: docling-local # docling-local or docling-serve
chunker_type: hybrid # hybrid or hierarchical
chunk_size: 256
chunking_tokenizer: "Qwen/Qwen3-Embedding-0.6B"
chunking_merge_peers: true
chunking_use_markdown_tables: false
auto_title: false # Auto-generate titles on ingestion
title_model:
provider: ollama
name: gpt-oss
enable_thinking: false
temperature: 0.3
max_tokens: 100
conversion_options:
do_ocr: true
force_ocr: false
ocr_lang: []
do_table_structure: true
table_mode: accurate
table_cell_matching: true
images_scale: 2.0
providers:
ollama:
base_url: http://localhost:11434
docling_serve:
base_url: http://localhost:5001
api_key: ""
timeout: 300
```
--------------------------------
### Install Inspector Dependencies
Source: https://ggozad.github.io/haiku.rag/tuning
Command to install the required TUI extra for the inspector functionality.
```bash
pip install haiku.rag-slim[tui]
```
--------------------------------
### Launch interactive chat session
Source: https://ggozad.github.io/haiku.rag/cli
Start a multi-turn chat session with optional database path and enabled skills. Requires the tui extra installed via pip.
```bash
haiku-rag chat
haiku-rag chat --db /path/to/database.lancedb
# Enable analysis skill (code execution)
haiku-rag chat -s rag -s analysis
```
--------------------------------
### Configure VoyageAI Embedding Provider
Source: https://ggozad.github.io/haiku.rag/configuration/providers
Installation and configuration for VoyageAI, including API key setup.
```bash
uv pip install haiku.rag-slim[voyageai]
```
```yaml
embeddings:
model:
provider: voyageai
name: voyage-3.5
vector_dim: 1024
```
```bash
export VOYAGE_API_KEY=your-api-key
```
--------------------------------
### Configure OpenAI-Compatible Servers
Source: https://ggozad.github.io/haiku.rag/configuration/providers
Examples for connecting to vLLM or LM Studio using the OpenAI provider interface.
```yaml
# vLLM example
embeddings:
model:
provider: openai
name: mixedbread-ai/mxbai-embed-large-v1
vector_dim: 512
base_url: http://localhost:8000/v1
# LM Studio example
embeddings:
model:
provider: openai
name: text-embedding-qwen3-embedding-4b
vector_dim: 2560
base_url: http://localhost:1234/v1
```
--------------------------------
### Run docling-serve via Docker
Source: https://ggozad.github.io/haiku.rag/remote-processing
Commands to start the docling-serve container with or without the debugging web UI enabled.
```bash
docker run -p 5001:5001 quay.io/docling-project/docling-serve
```
```bash
docker run -p 5001:5001 -e DOCLING_SERVE_ENABLE_UI=true quay.io/docling-project/docling-serve
```
--------------------------------
### Install and Configure Cross-Encoder Reranking
Source: https://ggozad.github.io/haiku.rag/configuration/providers
Install the cross-encoder extra and configure a HuggingFace model for in-process reranking.
```bash
uv pip install haiku.rag-slim[cross-encoder]
```
```yaml
reranking:
model:
provider: cross-encoder
name: mixedbread-ai/mxbai-rerank-base-v2
```
--------------------------------
### Configure Metadata Provider
Source: https://ggozad.github.io/haiku.rag/ingester
Example configuration for attaching a custom metadata provider to a source.
```yaml
- type: webdav
id: handbook
base_url: https://dav.example.com/remote.php/dav/files/svc
metadata_provider: example-provider
```
--------------------------------
### CLI Usage Examples
Source: https://ggozad.github.io/haiku.rag/cli
Basic usage patterns for the haiku-rag CLI including global and per-command options.
```bash
haiku-rag --config /path/to/config.yaml list
haiku-rag --config /path/to/config.yaml list --db /path/to/custom.db
haiku-rag --read-only search "query"
haiku-rag add -h
```
--------------------------------
### Configure a plugin source
Source: https://ggozad.github.io/haiku.rag/ingester
Example YAML configuration for a custom source using the plugin type.
```yaml
- type: plugin
id: api-docs
plugin: git
options:
owner: acme
repo: api
branch: main
token: ${SCM_TOKEN}
```
--------------------------------
### View Ingester Service Logs
Source: https://ggozad.github.io/haiku.rag/ingester
Example output showing standard service logging via Rich handler.
```text
INFO Ingester running: 4 worker(s), 1 source(s)
INFO API listening on 127.0.0.1:8765
INFO Swept local-docs: 142 upsert, 0 delete, 8 unchanged
INFO Processing upsert file:///.../a.md (job 5d9a...)
INFO Job 5d9a... succeeded in 0.34s: file:///.../a.md
```
--------------------------------
### Configure Multimodal Embedding Providers
Source: https://ggozad.github.io/haiku.rag/configuration/providers
Configuration examples for multimodal support in vLLM, VoyageAI, and Cohere.
```yaml
embeddings:
model:
provider: vllm
name: Qwen/Qwen3-VL-Embedding-8B
vector_dim: 4096
base_url: http://localhost:8000/v1
multimodal: true
```
```yaml
embeddings:
model:
provider: voyageai
name: voyage-multimodal-3
vector_dim: 1024
multimodal: true
```
```yaml
embeddings:
model:
provider: cohere
name: embed-v4.0
vector_dim: 1536
multimodal: true
```
--------------------------------
### List discovered skills
Source: https://ggozad.github.io/haiku.rag/skills
Verify installed skills registered via Python entry points.
```bash
haiku-skills list --use-entrypoints
# rag — Search, retrieve and analyze documents using RAG.
# rag-analysis — Analyze documents using code execution in a sandboxed interpreter.
```
--------------------------------
### GET /sources
Source: https://ggozad.github.io/haiku.rag/ingester
Retrieves a list of configured data sources.
```APIDOC
## GET /sources
### Description
Lists all configured sources. Requires Authorization header if a token is configured.
### Method
GET
### Endpoint
http://localhost:8765/sources
```
--------------------------------
### GET /config
Source: https://ggozad.github.io/haiku.rag/ingester
Retrieves the full effective configuration as YAML.
```APIDOC
## GET /config
### Description
Retrieves the full effective configuration (defaults filled in) as YAML, with secrets redacted.
### Method
GET
### Endpoint
/config
```
--------------------------------
### Start MCP Server via CLI
Source: https://ggozad.github.io/haiku.rag/mcp
Commands to launch the MCP server using different transport protocols and configuration options.
```bash
# Default streamable HTTP transport on 127.0.0.1:8001
haiku-rag mcp
# Custom port
haiku-rag mcp --port 9000
# Bind to all interfaces (e.g. inside a container)
haiku-rag mcp --host 0.0.0.0 --port 8001
# stdio transport (for Claude Desktop)
haiku-rag mcp --stdio
# Read-only mode (excludes write tools)
haiku-rag --read-only mcp --stdio
```
--------------------------------
### Configure Remote Storage Backends
Source: https://ggozad.github.io/haiku.rag/configuration/storage
Configuration examples for various remote storage providers using the lancedb settings block.
```yaml
# LanceDB Cloud
lancedb:
uri: db://your-database-name
api_key: your-api-key
region: us-west-2 # optional
# Amazon S3
lancedb:
uri: s3://my-bucket/my-table
storage_options:
region: us-east-1
# Amazon S3 with explicit credentials
lancedb:
uri: s3://my-bucket/my-table
storage_options:
aws_access_key_id: YOUR_ACCESS_KEY
aws_secret_access_key: YOUR_SECRET_KEY
region: us-east-1
# S3-compatible (SeaweedFS, Tigris, etc.)
lancedb:
uri: s3://my-bucket/my-table
storage_options:
endpoint: http://localhost:8333
aws_access_key_id: YOUR_ACCESS_KEY
aws_secret_access_key: YOUR_SECRET_KEY
region: us-east-1
allow_http: "true"
# Azure Blob Storage
lancedb:
uri: az://my-container/my-table
# Google Cloud Storage
lancedb:
uri: gs://my-bucket/my-table
# HDFS
lancedb:
uri: hdfs://namenode:port/path/to/table
```
--------------------------------
### Configure WebDAV with Bearer Token
Source: https://ggozad.github.io/haiku.rag/ingester
Example configuration for a WebDAV source using a bearer token in the headers.
```yaml
- type: webdav
id: kdrive
base_url: https://kdrive.infomaniak.com/app/drive/123/
headers:
Authorization: Bearer ${KDRIVE_TOKEN}
```
--------------------------------
### Configure Additional Pydantic AI Providers
Source: https://ggozad.github.io/haiku.rag/configuration/providers
Examples for configuring other supported providers like Google Gemini, Groq, and Mistral.
```yaml
# Google Gemini
qa:
model:
provider: gemini
name: gemini-1.5-flash
# Groq
qa:
model:
provider: groq
name: llama-3.3-70b-versatile
# Mistral
qa:
model:
provider: mistral
name: mistral-small-latest
```
--------------------------------
### Set File Size Limit
Source: https://ggozad.github.io/haiku.rag/ingester
Example configuration for enforcing a maximum file size on a file system source.
```yaml
- type: fs
root: /data/docs
max_file_size: 104857600 # 100 MB
```
--------------------------------
### Compare document structure
Source: https://ggozad.github.io/haiku.rag/skills/analysis
Example of agent-generated code to iterate through documents and compare structural elements.
```python
from pathlib import Path
import json
for doc_id in ["doc-a-id", "doc-b-id"]:
toc = json.loads(Path(f'/documents/{doc_id}/toc.json').read_text())
print(f"\n=== {toc['title']} ===")
for node in toc['tree']:
if 'experiment' in node['title'].lower():
print(f" {node['title']} (pages {node['page_numbers']})")
await cite(node['chunk_ids'])
```
--------------------------------
### Enable remote services in docling-serve
Source: https://ggozad.github.io/haiku.rag/remote-processing
Command to start the container with outbound remote service calls enabled, required for VLM picture description.
```bash
docker run -p 5001:5001 \
-e DOCLING_SERVE_ENABLE_REMOTE_SERVICES=true \
quay.io/docling-project/docling-serve
```
--------------------------------
### Initialize Database
Source: https://ggozad.github.io/haiku.rag/cli
Creates a new database with configured settings. All other commands require an existing database.
```bash
haiku-rag init [--db /path/to/your.lancedb]
```
--------------------------------
### Initialize Database via Python
Source: https://ggozad.github.io/haiku.rag/configuration/storage
Asynchronous client initialization for local databases.
```python
# Create at custom path
async with HaikuRAG("/path/to/database.lancedb", create=True) as client:
...
# Create in default location
async with HaikuRAG(create=True) as client:
...
```
--------------------------------
### Initialize Database via CLI
Source: https://ggozad.github.io/haiku.rag/configuration/storage
Commands to initialize a database in the default location or at a custom path.
```bash
# Create in default location (see Configuration File Locations below)
haiku-rag init
# Create at custom path
haiku-rag init --db /path/to/database.lancedb
```
--------------------------------
### Initialize Document Toolset
Source: https://ggozad.github.io/haiku.rag/tools
Creates a toolset for document browsing, retrieval, and summarization.
```python
from haiku.rag.tools import create_document_toolset
docs = create_document_toolset(config)
```
--------------------------------
### Initialize and migrate queue database
Source: https://ggozad.github.io/haiku.rag/ingester
Manually prepare the SQLite queue database and apply schema migrations.
```bash
haiku-ingester queue init # create the DB and schema
haiku-ingester queue migrate # apply pending schema changes
```
--------------------------------
### Initialize configuration file
Source: https://ggozad.github.io/haiku.rag/configuration
Generates a default haiku.rag.yaml file in the current directory.
```bash
haiku-rag init-config
```
--------------------------------
### View Settings
Source: https://ggozad.github.io/haiku.rag/cli
Display the current configuration settings.
```bash
haiku-rag settings
```
--------------------------------
### GET /api/info
Source: https://ggozad.github.io/haiku.rag/apps
Retrieves database statistics.
```APIDOC
## GET /api/info
### Description
Database statistics.
### Method
GET
### Endpoint
/api/info
```
--------------------------------
### Get Document
Source: https://ggozad.github.io/haiku.rag/cli
Retrieve a specific document by its ID.
```bash
haiku-rag get 3f4a... # document ID
```
--------------------------------
### Initialize Search Toolset
Source: https://ggozad.github.io/haiku.rag/tools
Creates a hybrid search toolset with context expansion capabilities.
```python
from haiku.rag.tools import create_search_toolset
search = create_search_toolset(config)
```
--------------------------------
### GET /health
Source: https://ggozad.github.io/haiku.rag/apps
Performs a health check on the service.
```APIDOC
## GET /health
### Description
Health check.
### Method
GET
### Endpoint
/health
```
--------------------------------
### Run benchmarks with pre-built database
Source: https://ggozad.github.io/haiku.rag/benchmarks
Execute a benchmark run using a specific database and configuration file while skipping database updates.
```bash
evaluations run orb_multimodal_nemotron --skip-db --config configs/orb_multimodal_nemotron.yaml
```
--------------------------------
### GET /api/documents
Source: https://ggozad.github.io/haiku.rag/apps
Retrieves a list of all available documents.
```APIDOC
## GET /api/documents
### Description
List all documents.
### Method
GET
### Endpoint
/api/documents
```
--------------------------------
### GET /health
Source: https://ggozad.github.io/haiku.rag/ingester
Checks the health status of the Ingester service.
```APIDOC
## GET /health
### Description
Returns the health status of the service.
### Method
GET
### Endpoint
http://localhost:8765/health
```
--------------------------------
### GET /jobs
Source: https://ggozad.github.io/haiku.rag/ingester
Retrieves a filtered list of ingestion jobs.
```APIDOC
## GET /jobs
### Description
Retrieves a filtered list of ingestion jobs based on status, source_id, uri, limit, and offset.
### Method
GET
### Endpoint
/jobs
### Parameters
#### Query Parameters
- **status** (string) - Optional - Filter by job status
- **source_id** (string) - Optional - Filter by source ID
- **uri** (string) - Optional - Filter by URI
- **limit** (integer) - Optional - Limit the number of results
- **offset** (integer) - Optional - Offset for pagination
```
--------------------------------
### Initialize PostgreSQL queue schema
Source: https://ggozad.github.io/haiku.rag/ingester
Apply the schema to the configured PostgreSQL database.
```bash
haiku-ingester queue init
```
--------------------------------
### Configure environment variables
Source: https://ggozad.github.io/haiku.rag/apps
Create a .env file in the app directory to define API keys, database paths, and optional service URLs.
```text
# API Keys (at least one required)
ANTHROPIC_API_KEY=your-anthropic-key
OPENAI_API_KEY=your-openai-key
# Database path
DB_PATH=/path/to/your/haiku.rag.lancedb
# Optional: Ollama base URL (if using local models)
OLLAMA_BASE_URL=http://localhost:11434
# Optional: Logfire for observability
LOGFIRE_TOKEN=your-logfire-token
```
--------------------------------
### GET /jobs
Source: https://ggozad.github.io/haiku.rag/ingester
Retrieves a list of ingestion jobs, optionally filtered by status.
```APIDOC
## GET /jobs
### Description
Lists ingestion jobs. Supports filtering by status.
### Method
GET
### Endpoint
http://localhost:8765/jobs
### Parameters
#### Query Parameters
- **status** (string) - Optional - Filter jobs by status (e.g., 'dead')
```
--------------------------------
### Initialize database
Source: https://ggozad.github.io/haiku.rag/tutorial
Initialize the LanceDB database in the default or a custom location.
```bash
haiku-rag init
```
```bash
haiku-rag init --db /tmp/test.lancedb
```
--------------------------------
### GET /api/visualize/{chunk_id}
Source: https://ggozad.github.io/haiku.rag/apps
Retrieves visual grounding images for a specific chunk.
```APIDOC
## GET /api/visualize/{chunk_id}
### Description
Visual grounding images (base64).
### Method
GET
### Endpoint
/api/visualize/{chunk_id}
### Parameters
#### Path Parameters
- **chunk_id** (string) - Required - The ID of the chunk to visualize
```
--------------------------------
### Custom Picture Description Prompt
Source: https://ggozad.github.io/haiku.rag/configuration/prompts
Example of a custom prompt for VLM image descriptions.
```yaml
prompts:
picture_description: |
Describe this image for a document search system.
Focus on: image type, main content, any text, key visual elements.
Be concise and factual.
```
--------------------------------
### GET /stats
Source: https://ggozad.github.io/haiku.rag/ingester
Retrieves rolling throughput statistics, worker occupancy, and queue metrics.
```APIDOC
## GET /stats
### Description
Retrieves rolling throughput (5m / 30m / 1h succeeded), worker occupancy, oldest queued age, and per-source DLQ/backlog metrics.
### Method
GET
### Endpoint
/stats
```
--------------------------------
### Configure Minimum Ingester Source
Source: https://ggozad.github.io/haiku.rag/ingester
Define a basic filesystem source in the haiku.rag.yaml configuration file.
```yaml
ingester:
sources:
- type: fs
id: local-docs
root: /Users/you/docs
delete_orphans: true
```
--------------------------------
### Ask questions
Source: https://ggozad.github.io/haiku.rag/cli
Query the RAG system to get answers based on indexed documents.
```bash
haiku-rag ask "Who is the author of haiku.rag?"
```
--------------------------------
### Define application configuration
Source: https://ggozad.github.io/haiku.rag/apps
Mount a haiku.rag.yaml file to specify model provider and name settings.
```yaml
# app/haiku.rag.yaml
qa:
model:
provider: anthropic
name: claude-sonnet-4-20250514
```
--------------------------------
### Implement a basic custom document pipeline
Source: https://ggozad.github.io/haiku.rag/custom-pipelines
Demonstrates the manual sequence of converting, chunking, embedding, and importing a document using the client primitives.
```python
from haiku.rag.client import HaikuRAG
from haiku.rag.embeddings import embed_chunks
async with HaikuRAG("database.lancedb", create=True) as client:
# 1. Convert source to DoclingDocument
docling_doc = await client.convert("path/to/document.pdf")
# 2. Chunk the document
chunks = await client.chunk(docling_doc)
# 3. Generate embeddings
embedded_chunks = await embed_chunks(chunks, client.embedder)
# 4. Store the document with chunks
doc = await client.import_document(
docling_document=docling_doc,
chunks=embedded_chunks,
uri="file:///path/to/document.pdf",
title="My Document",
)
```
--------------------------------
### Configure Nginx Reverse Proxy
Source: https://ggozad.github.io/haiku.rag/ingester
Example Nginx configuration to serve the control plane under a sub-path.
```nginx
# Redirect the bare prefix to the trailing-slash form so the dashboard's
#
Paragraph