haiku.rag 0.14.0__py3-none-any.whl → 0.23.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
README.md CHANGED
@@ -1,25 +1,22 @@
1
1
  # Haiku RAG
2
2
 
3
- Retrieval-Augmented Generation (RAG) library built on LanceDB.
4
-
5
- `haiku.rag` is a Retrieval-Augmented Generation (RAG) library built to work with LanceDB as a local vector database. It uses LanceDB for storing embeddings and performs semantic (vector) search as well as full-text search combined through native hybrid search with Reciprocal Rank Fusion. Both open-source (Ollama) as well as commercial (OpenAI, VoyageAI) embedding providers are supported.
6
-
7
- > **Note**: Configuration now uses YAML files instead of environment variables. If you're upgrading from an older version, run `haiku-rag init-config --from-env` to migrate your `.env` file to `haiku.rag.yaml`. See [Configuration](https://ggozad.github.io/haiku.rag/configuration/) for details.
3
+ Agentic RAG built on [LanceDB](https://lancedb.com/), [Pydantic AI](https://ai.pydantic.dev/), and [Docling](https://docling-project.github.io/docling/).
8
4
 
9
5
  ## Features
10
6
 
11
- - **Local LanceDB**: No external servers required, supports also LanceDB cloud storage, S3, Google Cloud & Azure
12
- - **Multiple embedding providers**: Ollama, VoyageAI, OpenAI, vLLM
13
- - **Multiple QA providers**: Any provider/model supported by Pydantic AI
14
- - **Research graph (multi‑agent)**: Plan Search Evaluate Synthesize with agentic AI
15
- - **Native hybrid search**: Vector + full-text search with native LanceDB RRF reranking
16
- - **Reranking**: Default search result reranking with MixedBread AI, Cohere, Zero Entropy, or vLLM
17
- - **Question answering**: Built-in QA agents on your documents
18
- - **File monitoring**: Auto-index files when run as server
19
- - **40+ file formats**: PDF, DOCX, HTML, Markdown, code files, URLs
20
- - **MCP server**: Expose as tools for AI assistants
21
- - **A2A agent**: Conversational agent with context and multi-turn dialogue
22
- - **CLI & Python API**: Use from command line or Python
7
+ - **Hybrid search** Vector + full-text with Reciprocal Rank Fusion
8
+ - **Reranking** MxBAI, Cohere, Zero Entropy, or vLLM
9
+ - **Question answering** — QA agents with citations (page numbers, section headings)
10
+ - **Research agents** — Multi-agent workflows via pydantic-graph: plan, search, evaluate, synthesize
11
+ - **Document structure** Stores full [DoclingDocument](https://docling-project.github.io/docling/concepts/docling_document/), enabling structure-aware context expansion
12
+ - **Visual grounding** View chunks highlighted on original page images
13
+ - **Time travel** Query the database at any historical point with `--before`
14
+ - **Multiple providers** Embeddings: Ollama, OpenAI, VoyageAI, LM Studio, vLLM. QA/Research: any model supported by Pydantic AI
15
+ - **Local-first** Embedded LanceDB, no servers required. Also supports S3, GCS, Azure, and LanceDB Cloud
16
+ - **MCP server** Expose as tools for AI assistants (Claude Desktop, etc.)
17
+ - **File monitoring** Watch directories and auto-index on changes
18
+ - **Inspector** TUI for browsing documents, chunks, and search results
19
+ - **CLI & Python API** — Full functionality from command line or code
23
20
 
24
21
  ## Installation
25
22
 
@@ -31,7 +28,7 @@ Retrieval-Augmented Generation (RAG) library built on LanceDB.
31
28
  uv pip install haiku.rag
32
29
  ```
33
30
 
34
- Includes all features: document processing, all embedding providers, rerankers, and A2A agent support.
31
+ Includes all features: document processing, all embedding providers, and rerankers.
35
32
 
36
33
  ### Slim Package (Minimal Dependencies)
37
34
 
@@ -44,150 +41,84 @@ Install only the extras you need. See the [Installation](https://ggozad.github.i
44
41
  ## Quick Start
45
42
 
46
43
  ```bash
47
- # Add documents
48
- haiku-rag add "Your content here"
49
- haiku-rag add "Your content here" --meta author=alice --meta topic=notes
50
- haiku-rag add-src document.pdf --meta source=manual
44
+ # Index a PDF
45
+ haiku-rag add-src paper.pdf
51
46
 
52
47
  # Search
53
- haiku-rag search "query"
54
-
55
- # Search with filters
56
- haiku-rag search "query" --filter "uri LIKE '%.pdf' AND title LIKE '%paper%'"
57
-
58
- # Ask questions
59
- haiku-rag ask "Who is the author of haiku.rag?"
48
+ haiku-rag search "attention mechanism"
60
49
 
61
50
  # Ask questions with citations
62
- haiku-rag ask "Who is the author of haiku.rag?" --cite
51
+ haiku-rag ask "What datasets were used for evaluation?" --cite
63
52
 
64
- # Deep QA (multi-agent question decomposition)
65
- haiku-rag ask "Who is the author of haiku.rag?" --deep --cite
53
+ # Deep QA decomposes complex questions into sub-queries
54
+ haiku-rag ask "How does the proposed method compare to the baseline on MMLU?" --deep
66
55
 
67
- # Deep QA with verbose output
68
- haiku-rag ask "Who is the author of haiku.rag?" --deep --verbose
56
+ # Research mode iterative planning and search
57
+ haiku-rag research "What are the limitations of the approach?" --verbose
69
58
 
70
- # Multi‑agent research (iterative plan/search/evaluate)
71
- haiku-rag research \
72
- "What are the main drivers and trends of global temperature anomalies since 1990?" \
73
- --max-iterations 2 \
74
- --confidence-threshold 0.8 \
75
- --max-concurrency 3 \
76
- --verbose
59
+ # Interactive research human-in-the-loop with decision points
60
+ haiku-rag research "Compare the approaches discussed" --interactive
77
61
 
78
- # Rebuild database (re-chunk and re-embed all documents)
79
- haiku-rag rebuild
80
-
81
- # Start server with file monitoring
62
+ # Watch a directory for changes
82
63
  haiku-rag serve --monitor
83
64
  ```
84
65
 
85
- To customize settings, create a `haiku.rag.yaml` config file (see [Configuration](https://ggozad.github.io/haiku.rag/configuration/)).
66
+ See [Configuration](https://ggozad.github.io/haiku.rag/configuration/) for customization options.
86
67
 
87
- ## Python Usage
68
+ ## Python API
88
69
 
89
70
  ```python
90
71
  from haiku.rag.client import HaikuRAG
91
- from haiku.rag.research import (
92
- PlanNode,
93
- ResearchContext,
94
- ResearchDeps,
95
- ResearchState,
96
- build_research_graph,
97
- stream_research_graph,
98
- )
99
-
100
- async with HaikuRAG("database.lancedb") as client:
101
- # Add document
102
- doc = await client.create_document("Your content")
103
-
104
- # Search (reranking enabled by default)
105
- results = await client.search("query")
106
- for chunk, score in results:
107
- print(f"{score:.3f}: {chunk.content}")
108
-
109
- # Ask questions
110
- answer = await client.ask("Who is the author of haiku.rag?")
111
- print(answer)
112
72
 
113
- # Ask questions with citations
114
- answer = await client.ask("Who is the author of haiku.rag?", cite=True)
115
- print(answer)
73
+ async with HaikuRAG("research.lancedb", create=True) as rag:
74
+ # Index documents
75
+ await rag.create_document_from_source("paper.pdf")
76
+ await rag.create_document_from_source("https://arxiv.org/pdf/1706.03762")
77
+
78
+ # Search — returns chunks with provenance
79
+ results = await rag.search("self-attention")
80
+ for result in results:
81
+ print(f"{result.score:.2f} | p.{result.page_numbers} | {result.content[:100]}")
116
82
 
117
- # Multi‑agent research pipeline (Plan → Search → Evaluate → Synthesize)
118
- graph = build_research_graph()
119
- question = (
120
- "What are the main drivers and trends of global temperature "
121
- "anomalies since 1990?"
122
- )
123
- state = ResearchState(
124
- context=ResearchContext(original_question=question),
125
- max_iterations=2,
126
- confidence_threshold=0.8,
127
- max_concurrency=2,
128
- )
129
- deps = ResearchDeps(client=client)
130
-
131
- # Blocking run (final result only)
132
- result = await graph.run(
133
- PlanNode(provider="openai", model="gpt-4o-mini"),
134
- state=state,
135
- deps=deps,
136
- )
137
- print(result.output.title)
138
-
139
- # Streaming progress (log/report/error events)
140
- async for event in stream_research_graph(
141
- graph,
142
- PlanNode(provider="openai", model="gpt-4o-mini"),
143
- state,
144
- deps,
145
- ):
146
- if event.type == "log":
147
- iteration = event.state.iterations if event.state else state.iterations
148
- print(f"[{iteration}] {event.message}")
149
- elif event.type == "report":
150
- print("\nResearch complete!\n")
151
- print(event.report.title)
152
- print(event.report.executive_summary)
83
+ # QA with citations
84
+ answer, citations = await rag.ask("What is the complexity of self-attention?")
85
+ print(answer)
86
+ for cite in citations:
87
+ print(f" [{cite.chunk_id}] p.{cite.page_numbers}: {cite.content[:80]}")
153
88
  ```
154
89
 
90
+ For research agents and streaming with [AG-UI](https://docs.ag-ui.com/), see the [Agents docs](https://ggozad.github.io/haiku.rag/agents/).
91
+
155
92
  ## MCP Server
156
93
 
157
94
  Use with AI assistants like Claude Desktop:
158
95
 
159
96
  ```bash
160
- haiku-rag serve --stdio
97
+ haiku-rag serve --mcp --stdio
161
98
  ```
162
99
 
163
- Provides tools for document management and search directly in your AI assistant.
164
-
165
- ## A2A Agent
166
-
167
- Run as a conversational agent with the Agent-to-Agent protocol:
168
-
169
- ```bash
170
- # Start the A2A server
171
- haiku-rag serve --a2a
172
-
173
- # Connect with the interactive client (in another terminal)
174
- haiku-rag a2aclient
100
+ Add to your Claude Desktop configuration:
101
+
102
+ ```json
103
+ {
104
+ "mcpServers": {
105
+ "haiku-rag": {
106
+ "command": "haiku-rag",
107
+ "args": ["serve", "--mcp", "--stdio"]
108
+ }
109
+ }
110
+ }
175
111
  ```
176
112
 
177
- The A2A agent provides:
178
-
179
- - Multi-turn dialogue with context
180
- - Intelligent multi-search for complex questions
181
- - Source citations with titles and URIs
182
- - Full document retrieval on request
113
+ Provides tools for document management, search, QA, and research directly in your AI assistant.
183
114
 
184
115
  ## Examples
185
116
 
186
117
  See the [examples directory](examples/) for working examples:
187
118
 
188
119
  - **[Interactive Research Assistant](examples/ag-ui-research/)** - Full-stack research assistant with Pydantic AI and AG-UI featuring human-in-the-loop approval and real-time state synchronization
189
- - **[Docker Setup](examples/docker/)** - Complete Docker deployment with file monitoring, MCP server, and A2A agent
190
- - **[A2A Security](examples/a2a-security/)** - Authentication examples (API key, OAuth2, GitHub)
120
+ - **[Docker Setup](examples/docker/)** - Complete Docker deployment with file monitoring and MCP server
121
+ - **[A2A Server](examples/a2a-server/)** - Self-contained A2A protocol server package with conversational agent interface
191
122
 
192
123
  ## Documentation
193
124
 
@@ -198,8 +129,10 @@ Full documentation at: https://ggozad.github.io/haiku.rag/
198
129
  - [CLI](https://ggozad.github.io/haiku.rag/cli/) - Command reference
199
130
  - [Python API](https://ggozad.github.io/haiku.rag/python/) - Complete API docs
200
131
  - [Agents](https://ggozad.github.io/haiku.rag/agents/) - QA agent and multi-agent research
201
- - [MCP Server](https://ggozad.github.io/haiku.rag/mcp/) - Model Context Protocol integration
202
- - [A2A Agent](https://ggozad.github.io/haiku.rag/a2a/) - Agent-to-Agent protocol support
203
- - [Benchmarks](https://ggozad.github.io/haiku.rag/benchmarks/) - Performance Benchmarks
132
+ - [Server](https://ggozad.github.io/haiku.rag/server/) - File monitoring, MCP, and AG-UI
133
+ - [MCP](https://ggozad.github.io/haiku.rag/mcp/) - Model Context Protocol integration
134
+ - [Inspector](https://ggozad.github.io/haiku.rag/inspector/) - Database browser TUI
135
+ - [Benchmarks](https://ggozad.github.io/haiku.rag/benchmarks/) - Performance benchmarks
136
+ - [Changelog](https://ggozad.github.io/haiku.rag/changelog/) - Version history
204
137
 
205
138
  mcp-name: io.github.ggozad/haiku-rag
@@ -0,0 +1,162 @@
1
+ Metadata-Version: 2.4
2
+ Name: haiku.rag
3
+ Version: 0.23.0
4
+ Summary: Opinionated agentic RAG powered by LanceDB, Pydantic AI, and Docling
5
+ Author-email: Yiorgis Gozadinos <ggozadinos@gmail.com>
6
+ License: MIT
7
+ License-File: LICENSE
8
+ Keywords: RAG,docling,lancedb,mcp,ml,pydantic-ai,vector-database
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 10
14
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 11
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.12
20
+ Requires-Dist: haiku-rag-slim[cohere,docling,inspector,mxbai,voyageai,zeroentropy]==0.23.0
21
+ Provides-Extra: inspector
22
+ Requires-Dist: textual>=1.0.0; extra == 'inspector'
23
+ Description-Content-Type: text/markdown
24
+
25
+ # Haiku RAG
26
+
27
+ Agentic RAG built on [LanceDB](https://lancedb.com/), [Pydantic AI](https://ai.pydantic.dev/), and [Docling](https://docling-project.github.io/docling/).
28
+
29
+ ## Features
30
+
31
+ - **Hybrid search** — Vector + full-text with Reciprocal Rank Fusion
32
+ - **Reranking** — MxBAI, Cohere, Zero Entropy, or vLLM
33
+ - **Question answering** — QA agents with citations (page numbers, section headings)
34
+ - **Research agents** — Multi-agent workflows via pydantic-graph: plan, search, evaluate, synthesize
35
+ - **Document structure** — Stores full [DoclingDocument](https://docling-project.github.io/docling/concepts/docling_document/), enabling structure-aware context expansion
36
+ - **Visual grounding** — View chunks highlighted on original page images
37
+ - **Time travel** — Query the database at any historical point with `--before`
38
+ - **Multiple providers** — Embeddings: Ollama, OpenAI, VoyageAI, LM Studio, vLLM. QA/Research: any model supported by Pydantic AI
39
+ - **Local-first** — Embedded LanceDB, no servers required. Also supports S3, GCS, Azure, and LanceDB Cloud
40
+ - **MCP server** — Expose as tools for AI assistants (Claude Desktop, etc.)
41
+ - **File monitoring** — Watch directories and auto-index on changes
42
+ - **Inspector** — TUI for browsing documents, chunks, and search results
43
+ - **CLI & Python API** — Full functionality from command line or code
44
+
45
+ ## Installation
46
+
47
+ **Python 3.12 or newer required**
48
+
49
+ ### Full Package (Recommended)
50
+
51
+ ```bash
52
+ uv pip install haiku.rag
53
+ ```
54
+
55
+ Includes all features: document processing, all embedding providers, and rerankers.
56
+
57
+ ### Slim Package (Minimal Dependencies)
58
+
59
+ ```bash
60
+ uv pip install haiku.rag-slim
61
+ ```
62
+
63
+ Install only the extras you need. See the [Installation](https://ggozad.github.io/haiku.rag/installation/) documentation for available options
64
+
65
+ ## Quick Start
66
+
67
+ ```bash
68
+ # Index a PDF
69
+ haiku-rag add-src paper.pdf
70
+
71
+ # Search
72
+ haiku-rag search "attention mechanism"
73
+
74
+ # Ask questions with citations
75
+ haiku-rag ask "What datasets were used for evaluation?" --cite
76
+
77
+ # Deep QA — decomposes complex questions into sub-queries
78
+ haiku-rag ask "How does the proposed method compare to the baseline on MMLU?" --deep
79
+
80
+ # Research mode — iterative planning and search
81
+ haiku-rag research "What are the limitations of the approach?" --verbose
82
+
83
+ # Interactive research — human-in-the-loop with decision points
84
+ haiku-rag research "Compare the approaches discussed" --interactive
85
+
86
+ # Watch a directory for changes
87
+ haiku-rag serve --monitor
88
+ ```
89
+
90
+ See [Configuration](https://ggozad.github.io/haiku.rag/configuration/) for customization options.
91
+
92
+ ## Python API
93
+
94
+ ```python
95
+ from haiku.rag.client import HaikuRAG
96
+
97
+ async with HaikuRAG("research.lancedb", create=True) as rag:
98
+ # Index documents
99
+ await rag.create_document_from_source("paper.pdf")
100
+ await rag.create_document_from_source("https://arxiv.org/pdf/1706.03762")
101
+
102
+ # Search — returns chunks with provenance
103
+ results = await rag.search("self-attention")
104
+ for result in results:
105
+ print(f"{result.score:.2f} | p.{result.page_numbers} | {result.content[:100]}")
106
+
107
+ # QA with citations
108
+ answer, citations = await rag.ask("What is the complexity of self-attention?")
109
+ print(answer)
110
+ for cite in citations:
111
+ print(f" [{cite.chunk_id}] p.{cite.page_numbers}: {cite.content[:80]}")
112
+ ```
113
+
114
+ For research agents and streaming with [AG-UI](https://docs.ag-ui.com/), see the [Agents docs](https://ggozad.github.io/haiku.rag/agents/).
115
+
116
+ ## MCP Server
117
+
118
+ Use with AI assistants like Claude Desktop:
119
+
120
+ ```bash
121
+ haiku-rag serve --mcp --stdio
122
+ ```
123
+
124
+ Add to your Claude Desktop configuration:
125
+
126
+ ```json
127
+ {
128
+ "mcpServers": {
129
+ "haiku-rag": {
130
+ "command": "haiku-rag",
131
+ "args": ["serve", "--mcp", "--stdio"]
132
+ }
133
+ }
134
+ }
135
+ ```
136
+
137
+ Provides tools for document management, search, QA, and research directly in your AI assistant.
138
+
139
+ ## Examples
140
+
141
+ See the [examples directory](examples/) for working examples:
142
+
143
+ - **[Interactive Research Assistant](examples/ag-ui-research/)** - Full-stack research assistant with Pydantic AI and AG-UI featuring human-in-the-loop approval and real-time state synchronization
144
+ - **[Docker Setup](examples/docker/)** - Complete Docker deployment with file monitoring and MCP server
145
+ - **[A2A Server](examples/a2a-server/)** - Self-contained A2A protocol server package with conversational agent interface
146
+
147
+ ## Documentation
148
+
149
+ Full documentation at: https://ggozad.github.io/haiku.rag/
150
+
151
+ - [Installation](https://ggozad.github.io/haiku.rag/installation/) - Provider setup
152
+ - [Configuration](https://ggozad.github.io/haiku.rag/configuration/) - YAML configuration
153
+ - [CLI](https://ggozad.github.io/haiku.rag/cli/) - Command reference
154
+ - [Python API](https://ggozad.github.io/haiku.rag/python/) - Complete API docs
155
+ - [Agents](https://ggozad.github.io/haiku.rag/agents/) - QA agent and multi-agent research
156
+ - [Server](https://ggozad.github.io/haiku.rag/server/) - File monitoring, MCP, and AG-UI
157
+ - [MCP](https://ggozad.github.io/haiku.rag/mcp/) - Model Context Protocol integration
158
+ - [Inspector](https://ggozad.github.io/haiku.rag/inspector/) - Database browser TUI
159
+ - [Benchmarks](https://ggozad.github.io/haiku.rag/benchmarks/) - Performance benchmarks
160
+ - [Changelog](https://ggozad.github.io/haiku.rag/changelog/) - Version history
161
+
162
+ mcp-name: io.github.ggozad/haiku-rag
@@ -0,0 +1,6 @@
1
+ README.md,sha256=aFW4_ghsf-SUJzlYFq9RC2NO5nu7BFjqG6n5-cRYcyQ,5287
2
+ haiku_rag-0.23.0.dist-info/METADATA,sha256=txl5cEtHupw_PJPl3k-a4hj-s-7aYkLFXlKc4voHBmI,6279
3
+ haiku_rag-0.23.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
4
+ haiku_rag-0.23.0.dist-info/entry_points.txt,sha256=G1U3nAkNd5YDYd4v0tuYFbriz0i-JheCsFuT9kIoGCI,48
5
+ haiku_rag-0.23.0.dist-info/licenses/LICENSE,sha256=eXZrWjSk9PwYFNK9yUczl3oPl95Z4V9UXH7bPN46iPo,1065
6
+ haiku_rag-0.23.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,227 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: haiku.rag
3
- Version: 0.14.0
4
- Summary: Agentic Retrieval Augmented Generation (RAG) with LanceDB
5
- Author-email: Yiorgis Gozadinos <ggozadinos@gmail.com>
6
- License: MIT
7
- License-File: LICENSE
8
- Keywords: RAG,lancedb,mcp,ml,vector-database
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: Environment :: Console
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Operating System :: MacOS
13
- Classifier: Operating System :: Microsoft :: Windows :: Windows 10
14
- Classifier: Operating System :: Microsoft :: Windows :: Windows 11
15
- Classifier: Operating System :: POSIX :: Linux
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.13
18
- Classifier: Typing :: Typed
19
- Requires-Python: >=3.12
20
- Requires-Dist: haiku-rag-slim[a2a,cohere,docling,mxbai,voyageai,zeroentropy]
21
- Description-Content-Type: text/markdown
22
-
23
- # Haiku RAG
24
-
25
- Retrieval-Augmented Generation (RAG) library built on LanceDB.
26
-
27
- `haiku.rag` is a Retrieval-Augmented Generation (RAG) library built to work with LanceDB as a local vector database. It uses LanceDB for storing embeddings and performs semantic (vector) search as well as full-text search combined through native hybrid search with Reciprocal Rank Fusion. Both open-source (Ollama) as well as commercial (OpenAI, VoyageAI) embedding providers are supported.
28
-
29
- > **Note**: Configuration now uses YAML files instead of environment variables. If you're upgrading from an older version, run `haiku-rag init-config --from-env` to migrate your `.env` file to `haiku.rag.yaml`. See [Configuration](https://ggozad.github.io/haiku.rag/configuration/) for details.
30
-
31
- ## Features
32
-
33
- - **Local LanceDB**: No external servers required, supports also LanceDB cloud storage, S3, Google Cloud & Azure
34
- - **Multiple embedding providers**: Ollama, VoyageAI, OpenAI, vLLM
35
- - **Multiple QA providers**: Any provider/model supported by Pydantic AI
36
- - **Research graph (multi‑agent)**: Plan → Search → Evaluate → Synthesize with agentic AI
37
- - **Native hybrid search**: Vector + full-text search with native LanceDB RRF reranking
38
- - **Reranking**: Default search result reranking with MixedBread AI, Cohere, Zero Entropy, or vLLM
39
- - **Question answering**: Built-in QA agents on your documents
40
- - **File monitoring**: Auto-index files when run as server
41
- - **40+ file formats**: PDF, DOCX, HTML, Markdown, code files, URLs
42
- - **MCP server**: Expose as tools for AI assistants
43
- - **A2A agent**: Conversational agent with context and multi-turn dialogue
44
- - **CLI & Python API**: Use from command line or Python
45
-
46
- ## Installation
47
-
48
- **Python 3.12 or newer required**
49
-
50
- ### Full Package (Recommended)
51
-
52
- ```bash
53
- uv pip install haiku.rag
54
- ```
55
-
56
- Includes all features: document processing, all embedding providers, rerankers, and A2A agent support.
57
-
58
- ### Slim Package (Minimal Dependencies)
59
-
60
- ```bash
61
- uv pip install haiku.rag-slim
62
- ```
63
-
64
- Install only the extras you need. See the [Installation](https://ggozad.github.io/haiku.rag/installation/) documentation for available options
65
-
66
- ## Quick Start
67
-
68
- ```bash
69
- # Add documents
70
- haiku-rag add "Your content here"
71
- haiku-rag add "Your content here" --meta author=alice --meta topic=notes
72
- haiku-rag add-src document.pdf --meta source=manual
73
-
74
- # Search
75
- haiku-rag search "query"
76
-
77
- # Search with filters
78
- haiku-rag search "query" --filter "uri LIKE '%.pdf' AND title LIKE '%paper%'"
79
-
80
- # Ask questions
81
- haiku-rag ask "Who is the author of haiku.rag?"
82
-
83
- # Ask questions with citations
84
- haiku-rag ask "Who is the author of haiku.rag?" --cite
85
-
86
- # Deep QA (multi-agent question decomposition)
87
- haiku-rag ask "Who is the author of haiku.rag?" --deep --cite
88
-
89
- # Deep QA with verbose output
90
- haiku-rag ask "Who is the author of haiku.rag?" --deep --verbose
91
-
92
- # Multi‑agent research (iterative plan/search/evaluate)
93
- haiku-rag research \
94
- "What are the main drivers and trends of global temperature anomalies since 1990?" \
95
- --max-iterations 2 \
96
- --confidence-threshold 0.8 \
97
- --max-concurrency 3 \
98
- --verbose
99
-
100
- # Rebuild database (re-chunk and re-embed all documents)
101
- haiku-rag rebuild
102
-
103
- # Start server with file monitoring
104
- haiku-rag serve --monitor
105
- ```
106
-
107
- To customize settings, create a `haiku.rag.yaml` config file (see [Configuration](https://ggozad.github.io/haiku.rag/configuration/)).
108
-
109
- ## Python Usage
110
-
111
- ```python
112
- from haiku.rag.client import HaikuRAG
113
- from haiku.rag.research import (
114
- PlanNode,
115
- ResearchContext,
116
- ResearchDeps,
117
- ResearchState,
118
- build_research_graph,
119
- stream_research_graph,
120
- )
121
-
122
- async with HaikuRAG("database.lancedb") as client:
123
- # Add document
124
- doc = await client.create_document("Your content")
125
-
126
- # Search (reranking enabled by default)
127
- results = await client.search("query")
128
- for chunk, score in results:
129
- print(f"{score:.3f}: {chunk.content}")
130
-
131
- # Ask questions
132
- answer = await client.ask("Who is the author of haiku.rag?")
133
- print(answer)
134
-
135
- # Ask questions with citations
136
- answer = await client.ask("Who is the author of haiku.rag?", cite=True)
137
- print(answer)
138
-
139
- # Multi‑agent research pipeline (Plan → Search → Evaluate → Synthesize)
140
- graph = build_research_graph()
141
- question = (
142
- "What are the main drivers and trends of global temperature "
143
- "anomalies since 1990?"
144
- )
145
- state = ResearchState(
146
- context=ResearchContext(original_question=question),
147
- max_iterations=2,
148
- confidence_threshold=0.8,
149
- max_concurrency=2,
150
- )
151
- deps = ResearchDeps(client=client)
152
-
153
- # Blocking run (final result only)
154
- result = await graph.run(
155
- PlanNode(provider="openai", model="gpt-4o-mini"),
156
- state=state,
157
- deps=deps,
158
- )
159
- print(result.output.title)
160
-
161
- # Streaming progress (log/report/error events)
162
- async for event in stream_research_graph(
163
- graph,
164
- PlanNode(provider="openai", model="gpt-4o-mini"),
165
- state,
166
- deps,
167
- ):
168
- if event.type == "log":
169
- iteration = event.state.iterations if event.state else state.iterations
170
- print(f"[{iteration}] {event.message}")
171
- elif event.type == "report":
172
- print("\nResearch complete!\n")
173
- print(event.report.title)
174
- print(event.report.executive_summary)
175
- ```
176
-
177
- ## MCP Server
178
-
179
- Use with AI assistants like Claude Desktop:
180
-
181
- ```bash
182
- haiku-rag serve --stdio
183
- ```
184
-
185
- Provides tools for document management and search directly in your AI assistant.
186
-
187
- ## A2A Agent
188
-
189
- Run as a conversational agent with the Agent-to-Agent protocol:
190
-
191
- ```bash
192
- # Start the A2A server
193
- haiku-rag serve --a2a
194
-
195
- # Connect with the interactive client (in another terminal)
196
- haiku-rag a2aclient
197
- ```
198
-
199
- The A2A agent provides:
200
-
201
- - Multi-turn dialogue with context
202
- - Intelligent multi-search for complex questions
203
- - Source citations with titles and URIs
204
- - Full document retrieval on request
205
-
206
- ## Examples
207
-
208
- See the [examples directory](examples/) for working examples:
209
-
210
- - **[Interactive Research Assistant](examples/ag-ui-research/)** - Full-stack research assistant with Pydantic AI and AG-UI featuring human-in-the-loop approval and real-time state synchronization
211
- - **[Docker Setup](examples/docker/)** - Complete Docker deployment with file monitoring, MCP server, and A2A agent
212
- - **[A2A Security](examples/a2a-security/)** - Authentication examples (API key, OAuth2, GitHub)
213
-
214
- ## Documentation
215
-
216
- Full documentation at: https://ggozad.github.io/haiku.rag/
217
-
218
- - [Installation](https://ggozad.github.io/haiku.rag/installation/) - Provider setup
219
- - [Configuration](https://ggozad.github.io/haiku.rag/configuration/) - YAML configuration
220
- - [CLI](https://ggozad.github.io/haiku.rag/cli/) - Command reference
221
- - [Python API](https://ggozad.github.io/haiku.rag/python/) - Complete API docs
222
- - [Agents](https://ggozad.github.io/haiku.rag/agents/) - QA agent and multi-agent research
223
- - [MCP Server](https://ggozad.github.io/haiku.rag/mcp/) - Model Context Protocol integration
224
- - [A2A Agent](https://ggozad.github.io/haiku.rag/a2a/) - Agent-to-Agent protocol support
225
- - [Benchmarks](https://ggozad.github.io/haiku.rag/benchmarks/) - Performance Benchmarks
226
-
227
- mcp-name: io.github.ggozad/haiku-rag
@@ -1,6 +0,0 @@
1
- README.md,sha256=N8nk6cs6JkWHAmVz3ci7lTiLr6Xq_UqifWGivZnuPJU,7216
2
- haiku_rag-0.14.0.dist-info/METADATA,sha256=I3H0hBrGIgDwtIvFe9tnu2-PeLESLlhEHVrgmrKCnr4,8085
3
- haiku_rag-0.14.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
- haiku_rag-0.14.0.dist-info/entry_points.txt,sha256=G1U3nAkNd5YDYd4v0tuYFbriz0i-JheCsFuT9kIoGCI,48
5
- haiku_rag-0.14.0.dist-info/licenses/LICENSE,sha256=eXZrWjSk9PwYFNK9yUczl3oPl95Z4V9UXH7bPN46iPo,1065
6
- haiku_rag-0.14.0.dist-info/RECORD,,