haiku.rag 0.4.0__tar.gz → 0.4.1__tar.gz

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.

Potentially problematic release.


This version of haiku.rag might be problematic. Click here for more details.

Files changed (77) hide show
  1. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/PKG-INFO +1 -1
  2. haiku_rag-0.4.1/docs/benchmarks.md +33 -0
  3. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/docs/configuration.md +5 -5
  4. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/docs/installation.md +3 -3
  5. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/pyproject.toml +1 -1
  6. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/cli.py +11 -10
  7. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/client.py +1 -2
  8. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/embeddings/__init__.py +2 -2
  9. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/qa/__init__.py +2 -2
  10. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/qa/ollama.py +1 -1
  11. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/qa/prompts.py +1 -1
  12. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/reranking/__init__.py +1 -1
  13. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/llm_judge.py +1 -1
  14. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/uv.lock +1 -1
  15. haiku_rag-0.4.0/docs/benchmarks.md +0 -30
  16. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/.github/FUNDING.yml +0 -0
  17. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/.github/workflows/build-docs.yml +0 -0
  18. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/.github/workflows/build-publish.yml +0 -0
  19. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/.gitignore +0 -0
  20. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/.pre-commit-config.yaml +0 -0
  21. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/.python-version +0 -0
  22. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/LICENSE +0 -0
  23. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/README.md +0 -0
  24. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/docs/cli.md +0 -0
  25. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/docs/index.md +0 -0
  26. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/docs/mcp.md +0 -0
  27. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/docs/python.md +0 -0
  28. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/docs/server.md +0 -0
  29. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/mkdocs.yml +0 -0
  30. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/__init__.py +0 -0
  31. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/app.py +0 -0
  32. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/chunker.py +0 -0
  33. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/config.py +0 -0
  34. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/embeddings/base.py +0 -0
  35. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/embeddings/ollama.py +0 -0
  36. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/embeddings/openai.py +0 -0
  37. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/embeddings/voyageai.py +0 -0
  38. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/logging.py +0 -0
  39. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/mcp.py +0 -0
  40. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/monitor.py +0 -0
  41. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/qa/anthropic.py +0 -0
  42. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/qa/base.py +0 -0
  43. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/qa/openai.py +0 -0
  44. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/reader.py +0 -0
  45. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/reranking/base.py +0 -0
  46. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/reranking/cohere.py +0 -0
  47. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/reranking/mxbai.py +0 -0
  48. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/__init__.py +0 -0
  49. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/engine.py +0 -0
  50. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/models/__init__.py +0 -0
  51. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/models/chunk.py +0 -0
  52. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/models/document.py +0 -0
  53. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/repositories/__init__.py +0 -0
  54. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/repositories/base.py +0 -0
  55. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/repositories/chunk.py +0 -0
  56. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/repositories/document.py +0 -0
  57. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/repositories/settings.py +0 -0
  58. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/upgrades/__init__.py +0 -0
  59. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/store/upgrades/v0_3_4.py +0 -0
  60. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/src/haiku/rag/utils.py +0 -0
  61. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/__init__.py +0 -0
  62. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/conftest.py +0 -0
  63. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/generate_benchmark_db.py +0 -0
  64. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_app.py +0 -0
  65. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_chunk.py +0 -0
  66. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_chunker.py +0 -0
  67. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_cli.py +0 -0
  68. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_client.py +0 -0
  69. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_document.py +0 -0
  70. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_embedder.py +0 -0
  71. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_monitor.py +0 -0
  72. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_qa.py +0 -0
  73. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_rebuild.py +0 -0
  74. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_reranker.py +0 -0
  75. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_search.py +0 -0
  76. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_settings.py +0 -0
  77. {haiku_rag-0.4.0 → haiku_rag-0.4.1}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haiku.rag
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Retrieval Augmented Generation (RAG) with SQLite
5
5
  Author-email: Yiorgis Gozadinos <ggozadinos@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,33 @@
1
+ # Benchmarks
2
+
3
+ We use the [repliqa](https://huggingface.co/datasets/ServiceNow/repliqa) dataset for the evaluation of `haiku.rag`.
4
+
5
+ You can perform your own evaluations using as example the script found at
6
+ `tests/generate_benchmark_db.py`.
7
+
8
+ ## Recall
9
+
10
+ In order to calculate recall, we load the `News Stories` from `repliqa_3` which is 1035 documents and index them in a sqlite db. Subsequently, we run a search over the `question` field for each row of the dataset and check whether we match the document that answers the question.
11
+
12
+
13
+ The recall obtained is ~0.73 for matching in the top result, raising to ~0.75 for the top 3 results.
14
+
15
+ | Embedding Model | Document in top 1 | Document in top 3 | Reranker |
16
+ |---------------------------------------|-------------------|-------------------|------------------------|
17
+ | Ollama / `mxbai-embed-large` | 0.77 | 0.89 | None |
18
+ | Ollama / `mxbai-embed-large` | 0.81 | 0.91 | `mxbai-rerank-base-v2` |
19
+ | Ollama / `nomic-embed-text` | 0.74 | 0.88 | None |
20
+ | OpenAI / `text-embeddings-3-small` | 0.75 | 0.88 | None |
21
+ | OpenAI / `text-embeddings-3-small` | 0.75 | 0.88 | None |
22
+ | OpenAI / `text-embeddings-3-small` | 0.83 | 0.90 | Cohere / `rerank-v3.5` |
23
+
24
+ ## Question/Answer evaluation
25
+
26
+ Again using the same dataset, we use a QA agent to answer the question. In addition we use an LLM judge (using the Ollama `qwen3`) to evaluate whether the answer is correct or not. The obtained accuracy is as follows:
27
+
28
+ | Embedding Model | QA Model | Accuracy | Reranker |
29
+ |------------------------------------|-----------------------------------|-----------|------------------------|
30
+ | Ollama / `mxbai-embed-large` | Ollama / `qwen3` | 0.64 | None |
31
+ | Ollama / `mxbai-embed-large` | Ollama / `qwen3` | 0.72 | `mxbai-rerank-base-v2` |
32
+ | Ollama / `mxbai-embed-large` | Anthropic / `Claude Sonnet 3.7` | 0.79 | None |
33
+ | OpenAI / `text-embeddings-3-small` | OpenAI / `gpt-4-turbo` | 0.62 | None |
@@ -33,7 +33,7 @@ EMBEDDINGS_VECTOR_DIM=1024
33
33
  If you want to use VoyageAI embeddings you will need to install `haiku.rag` with the VoyageAI extras,
34
34
 
35
35
  ```bash
36
- uv pip install haiku.rag --extra voyageai
36
+ uv pip install haiku.rag[voyageai]
37
37
  ```
38
38
 
39
39
  ```bash
@@ -47,7 +47,7 @@ VOYAGE_API_KEY="your-api-key"
47
47
  If you want to use OpenAI embeddings you will need to install `haiku.rag` with the VoyageAI extras,
48
48
 
49
49
  ```bash
50
- uv pip install haiku.rag --extra openai
50
+ uv pip install haiku.rag[openai]
51
51
  ```
52
52
 
53
53
  and set environment variables.
@@ -76,7 +76,7 @@ OLLAMA_BASE_URL="http://localhost:11434"
76
76
  For OpenAI QA, you need to install haiku.rag with OpenAI extras:
77
77
 
78
78
  ```bash
79
- uv pip install haiku.rag --extra openai
79
+ uv pip install haiku.rag[openai]
80
80
  ```
81
81
 
82
82
  Then configure:
@@ -92,7 +92,7 @@ OPENAI_API_KEY="your-api-key"
92
92
  For Anthropic QA, you need to install haiku.rag with Anthropic extras:
93
93
 
94
94
  ```bash
95
- uv pip install haiku.rag --extra anthropic
95
+ uv pip install haiku.rag[anthropic]
96
96
  ```
97
97
 
98
98
  Then configure:
@@ -125,7 +125,7 @@ RERANK_MODEL="mixedbread-ai/mxbai-rerank-base-v2"
125
125
  For Cohere reranking, install with Cohere extras:
126
126
 
127
127
  ```bash
128
- uv pip install haiku.rag --extra cohere
128
+ uv pip install haiku.rag[cohere]
129
129
  ```
130
130
 
131
131
  Then configure:
@@ -15,19 +15,19 @@ For other embedding providers, install with extras:
15
15
  ### VoyageAI
16
16
 
17
17
  ```bash
18
- uv pip install haiku.rag --extra voyageai
18
+ uv pip install haiku.rag[voyageai]
19
19
  ```
20
20
 
21
21
  ### OpenAI
22
22
 
23
23
  ```bash
24
- uv pip install haiku.rag --extra openai
24
+ uv pip install haiku.rag[openai]
25
25
  ```
26
26
 
27
27
  ### Anthropic
28
28
 
29
29
  ```bash
30
- uv pip install haiku.rag --extra anthropic
30
+ uv pip install haiku.rag[anthropic]
31
31
  ```
32
32
 
33
33
  ## Requirements
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "haiku.rag"
3
- version = "0.4.0"
3
+ version = "0.4.1"
4
4
  description = "Retrieval Augmented Generation (RAG) with SQLite"
5
5
  authors = [{ name = "Yiorgis Gozadinos", email = "ggozadinos@gmail.com" }]
6
6
  license = { text = "MIT" }
@@ -5,7 +5,8 @@ import typer
5
5
  from rich.console import Console
6
6
 
7
7
  from haiku.rag.app import HaikuRAGApp
8
- from haiku.rag.utils import get_default_data_dir, is_up_to_date
8
+ from haiku.rag.config import Config
9
+ from haiku.rag.utils import is_up_to_date
9
10
 
10
11
  cli = typer.Typer(
11
12
  context_settings={"help_option_names": ["-h", "--help"]}, no_args_is_help=True
@@ -35,7 +36,7 @@ def main():
35
36
  @cli.command("list", help="List all stored documents")
36
37
  def list_documents(
37
38
  db: Path = typer.Option(
38
- get_default_data_dir() / "haiku.rag.sqlite",
39
+ Config.DEFAULT_DATA_DIR / "haiku.rag.sqlite",
39
40
  "--db",
40
41
  help="Path to the SQLite database file",
41
42
  ),
@@ -50,7 +51,7 @@ def add_document_text(
50
51
  help="The text content of the document to add",
51
52
  ),
52
53
  db: Path = typer.Option(
53
- get_default_data_dir() / "haiku.rag.sqlite",
54
+ Config.DEFAULT_DATA_DIR / "haiku.rag.sqlite",
54
55
  "--db",
55
56
  help="Path to the SQLite database file",
56
57
  ),
@@ -65,7 +66,7 @@ def add_document_src(
65
66
  help="The file path or URL of the document to add",
66
67
  ),
67
68
  db: Path = typer.Option(
68
- get_default_data_dir() / "haiku.rag.sqlite",
69
+ Config.DEFAULT_DATA_DIR / "haiku.rag.sqlite",
69
70
  "--db",
70
71
  help="Path to the SQLite database file",
71
72
  ),
@@ -80,7 +81,7 @@ def get_document(
80
81
  help="The ID of the document to get",
81
82
  ),
82
83
  db: Path = typer.Option(
83
- get_default_data_dir() / "haiku.rag.sqlite",
84
+ Config.DEFAULT_DATA_DIR / "haiku.rag.sqlite",
84
85
  "--db",
85
86
  help="Path to the SQLite database file",
86
87
  ),
@@ -95,7 +96,7 @@ def delete_document(
95
96
  help="The ID of the document to delete",
96
97
  ),
97
98
  db: Path = typer.Option(
98
- get_default_data_dir() / "haiku.rag.sqlite",
99
+ Config.DEFAULT_DATA_DIR / "haiku.rag.sqlite",
99
100
  "--db",
100
101
  help="Path to the SQLite database file",
101
102
  ),
@@ -121,7 +122,7 @@ def search(
121
122
  help="Reciprocal Rank Fusion k parameter",
122
123
  ),
123
124
  db: Path = typer.Option(
124
- get_default_data_dir() / "haiku.rag.sqlite",
125
+ Config.DEFAULT_DATA_DIR / "haiku.rag.sqlite",
125
126
  "--db",
126
127
  help="Path to the SQLite database file",
127
128
  ),
@@ -136,7 +137,7 @@ def ask(
136
137
  help="The question to ask",
137
138
  ),
138
139
  db: Path = typer.Option(
139
- get_default_data_dir() / "haiku.rag.sqlite",
140
+ Config.DEFAULT_DATA_DIR / "haiku.rag.sqlite",
140
141
  "--db",
141
142
  help="Path to the SQLite database file",
142
143
  ),
@@ -157,7 +158,7 @@ def settings():
157
158
  )
158
159
  def rebuild(
159
160
  db: Path = typer.Option(
160
- get_default_data_dir() / "haiku.rag.sqlite",
161
+ Config.DEFAULT_DATA_DIR / "haiku.rag.sqlite",
161
162
  "--db",
162
163
  help="Path to the SQLite database file",
163
164
  ),
@@ -171,7 +172,7 @@ def rebuild(
171
172
  )
172
173
  def serve(
173
174
  db: Path = typer.Option(
174
- get_default_data_dir() / "haiku.rag.sqlite",
175
+ Config.DEFAULT_DATA_DIR / "haiku.rag.sqlite",
175
176
  "--db",
176
177
  help="Path to the SQLite database file",
177
178
  ),
@@ -278,7 +278,7 @@ class HaikuRAG:
278
278
  return await self.document_repository.list_all(limit=limit, offset=offset)
279
279
 
280
280
  async def search(
281
- self, query: str, limit: int = 3, k: int = 60, rerank=Config.RERANK
281
+ self, query: str, limit: int = 5, k: int = 60, rerank=Config.RERANK
282
282
  ) -> list[tuple[Chunk, float]]:
283
283
  """Search for relevant chunks using hybrid search (vector similarity + full-text search) with reranking.
284
284
 
@@ -298,7 +298,6 @@ class HaikuRAG:
298
298
  search_results = await self.chunk_repository.search_chunks_hybrid(
299
299
  query, limit * 3, k
300
300
  )
301
-
302
301
  # Apply reranking
303
302
  reranker = get_reranker()
304
303
  chunks = [chunk for chunk, _ in search_results]
@@ -18,7 +18,7 @@ def get_embedder() -> EmbedderBase:
18
18
  raise ImportError(
19
19
  "VoyageAI embedder requires the 'voyageai' package. "
20
20
  "Please install haiku.rag with the 'voyageai' extra:"
21
- "uv pip install haiku.rag --extra voyageai"
21
+ "uv pip install haiku.rag[voyageai]"
22
22
  )
23
23
  return VoyageAIEmbedder(Config.EMBEDDINGS_MODEL, Config.EMBEDDINGS_VECTOR_DIM)
24
24
 
@@ -29,7 +29,7 @@ def get_embedder() -> EmbedderBase:
29
29
  raise ImportError(
30
30
  "OpenAI embedder requires the 'openai' package. "
31
31
  "Please install haiku.rag with the 'openai' extra:"
32
- "uv pip install haiku.rag --extra openai"
32
+ "uv pip install haiku.rag[openai]"
33
33
  )
34
34
  return OpenAIEmbedder(Config.EMBEDDINGS_MODEL, Config.EMBEDDINGS_VECTOR_DIM)
35
35
 
@@ -18,7 +18,7 @@ def get_qa_agent(client: HaikuRAG, model: str = "") -> QuestionAnswerAgentBase:
18
18
  raise ImportError(
19
19
  "OpenAI QA agent requires the 'openai' package. "
20
20
  "Please install haiku.rag with the 'openai' extra:"
21
- "uv pip install haiku.rag --extra openai"
21
+ "uv pip install haiku.rag[openai]"
22
22
  )
23
23
  return QuestionAnswerOpenAIAgent(client, model or Config.QA_MODEL)
24
24
 
@@ -29,7 +29,7 @@ def get_qa_agent(client: HaikuRAG, model: str = "") -> QuestionAnswerAgentBase:
29
29
  raise ImportError(
30
30
  "Anthropic QA agent requires the 'anthropic' package. "
31
31
  "Please install haiku.rag with the 'anthropic' extra:"
32
- "uv pip install haiku.rag --extra anthropic"
32
+ "uv pip install haiku.rag[anthropic]"
33
33
  )
34
34
  return QuestionAnswerAnthropicAgent(client, model or Config.QA_MODEL)
35
35
 
@@ -4,7 +4,7 @@ from haiku.rag.client import HaikuRAG
4
4
  from haiku.rag.config import Config
5
5
  from haiku.rag.qa.base import QuestionAnswerAgentBase
6
6
 
7
- OLLAMA_OPTIONS = {"temperature": 0.0, "seed": 42, "num_ctx": 64000}
7
+ OLLAMA_OPTIONS = {"temperature": 0.0, "seed": 42, "num_ctx": 16384}
8
8
 
9
9
 
10
10
  class QuestionAnswerOllamaAgent(QuestionAnswerAgentBase):
@@ -15,7 +15,7 @@ Guidelines:
15
15
  - Indicate when information is incomplete or when you need to search for additional context
16
16
  - If the retrieved documents don't contain sufficient information, clearly state: "I cannot find enough information in the knowledge base to answer this question."
17
17
  - For complex questions, consider breaking them down and performing multiple searches
18
- - Stick to the answer, do not ellaborate or provde context unless asked for it.
18
+ - Stick to the answer, do not ellaborate or provide context unless explicitly asked for it.
19
19
 
20
20
  Be concise, and always maintain accuracy over completeness. Prefer short, direct answers that are well-supported by the documents.
21
21
  """
@@ -29,7 +29,7 @@ def get_reranker() -> RerankerBase:
29
29
  raise ImportError(
30
30
  "Cohere reranker requires the 'cohere' package. "
31
31
  "Please install haiku.rag with the 'cohere' extra:"
32
- "uv pip install haiku.rag --extra cohere"
32
+ "uv pip install haiku.rag[cohere]"
33
33
  )
34
34
  _reranker = CohereReranker()
35
35
  return _reranker
@@ -13,7 +13,7 @@ class LLMJudgeResponseSchema(BaseModel):
13
13
  class LLMJudge:
14
14
  """LLM-as-judge for evaluating answer equivalence using Ollama."""
15
15
 
16
- def __init__(self, model: str = "qwen3"):
16
+ def __init__(self, model: str = Config.QA_MODEL):
17
17
  self.model = model
18
18
  self.client = AsyncClient(host=Config.OLLAMA_BASE_URL)
19
19
 
@@ -901,7 +901,7 @@ wheels = [
901
901
 
902
902
  [[package]]
903
903
  name = "haiku-rag"
904
- version = "0.4.0"
904
+ version = "0.4.1"
905
905
  source = { editable = "." }
906
906
  dependencies = [
907
907
  { name = "fastmcp" },
@@ -1,30 +0,0 @@
1
- # Benchmarks
2
-
3
- We use the [repliqa](https://huggingface.co/datasets/ServiceNow/repliqa) dataset for the evaluation of `haiku.rag`.
4
-
5
- You can perform your own evaluations using as example the script found at
6
- `tests/generate_benchmark_db.py`.
7
-
8
- ## Recall
9
-
10
- In order to calculate recall, we load the `News Stories` from `repliqa_3` which is 1035 documents and index them in a sqlite db. Subsequently, we run a search over the `question` field for each row of the dataset and check whether we match the document that answers the question.
11
-
12
-
13
- The recall obtained is ~0.73 for matching in the top result, raising to ~0.75 for the top 3 results.
14
-
15
- | Model | Document in top 1 | Document in top 3 | Reranker |
16
- |---------------------------------------|-------------------|-------------------|----------------------|
17
- | Ollama / `mxbai-embed-large` | 0.77 | 0.89 | None |
18
- | Ollama / `mxbai-embed-large` | 0.81 | 0.91 | mxbai-rerank-base-v2 |
19
- | Ollama / `nomic-embed-text` | 0.74 | 0.88 | None |
20
- | OpenAI / `text-embeddings-3-small` | 0.75 | 0.88 | None |
21
-
22
- ## Question/Answer evaluation
23
-
24
- Again using the same dataset, we use a QA agent to answer the question. In addition we use an LLM judge (using the Ollama `qwen3`) to evaluate whether the answer is correct or not. The obtained accuracy is as follows:
25
-
26
- | Embedding Model | QA Model | Accuracy | Reranker |
27
- |------------------------------|-----------------------------------|-----------|----------------------|
28
- | Ollama / `mxbai-embed-large` | Ollama / `qwen3` | 0.64 | None |
29
- | Ollama / `mxbai-embed-large` | Ollama / `qwen3` | 0.72 | mxbai-rerank-base-v2 |
30
- | Ollama / `mxbai-embed-large` | Anthropic / `Claude Sonnet 3.7` | 0.79 | None |
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes