haiku.rag 0.7.7__tar.gz → 0.8.0__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.
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/PKG-INFO +1 -1
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/docs/cli.md +68 -53
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/docs/index.md +0 -1
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/docs/python.md +10 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/pyproject.toml +1 -1
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/app.py +9 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/cli.py +12 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/client.py +10 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/logging.py +3 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/migration.py +3 -3
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/engine.py +18 -6
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/repositories/settings.py +8 -3
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/generate_benchmark_db.py +3 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/uv.lock +1 -1
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/.github/FUNDING.yml +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/.github/workflows/build-docs.yml +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/.github/workflows/build-publish.yml +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/.gitignore +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/.pre-commit-config.yaml +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/.python-version +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/LICENSE +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/README.md +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/docs/benchmarks.md +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/docs/configuration.md +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/docs/installation.md +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/docs/mcp.md +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/docs/server.md +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/mkdocs.yml +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/__init__.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/chunker.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/config.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/embeddings/__init__.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/embeddings/base.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/embeddings/ollama.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/embeddings/openai.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/embeddings/vllm.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/embeddings/voyageai.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/mcp.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/monitor.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/qa/__init__.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/qa/agent.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/qa/prompts.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/reader.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/reranking/__init__.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/reranking/base.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/reranking/cohere.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/reranking/mxbai.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/reranking/vllm.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/__init__.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/models/__init__.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/models/chunk.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/models/document.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/repositories/__init__.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/repositories/chunk.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/repositories/document.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/store/upgrades/__init__.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/src/haiku/rag/utils.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/__init__.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/conftest.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/llm_judge.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_app.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_chunk.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_chunker.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_cli.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_client.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_document.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_embedder.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_lancedb_connection.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_monitor.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_qa.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_reader.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_rebuild.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_reranker.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_search.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_settings.py +0 -0
- {haiku_rag-0.7.7 → haiku_rag-0.8.0}/tests/test_utils.py +0 -0
|
@@ -2,22 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
The `haiku-rag` CLI provides complete document management functionality.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Enable shell autocompletion for faster, error‑free usage.
|
|
5
|
+
!!! note
|
|
6
|
+
All commands support:
|
|
8
7
|
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
eval "$(haiku-rag --show-completion)"
|
|
12
|
-
```
|
|
13
|
-
- Permanent installation:
|
|
14
|
-
```bash
|
|
15
|
-
haiku-rag --install-completion
|
|
16
|
-
```
|
|
8
|
+
- `--db` - Specify custom database path
|
|
9
|
+
- `-h` - Show help for specific command
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
11
|
+
Example:
|
|
12
|
+
```bash
|
|
13
|
+
haiku-rag list --db /path/to/custom.db
|
|
14
|
+
haiku-rag add -h
|
|
15
|
+
```
|
|
21
16
|
|
|
22
17
|
## Document Management
|
|
23
18
|
|
|
@@ -40,6 +35,10 @@ haiku-rag add-src /path/to/document.pdf
|
|
|
40
35
|
haiku-rag add-src https://example.com/article.html
|
|
41
36
|
```
|
|
42
37
|
|
|
38
|
+
!!! note
|
|
39
|
+
As you add documents to `haiku.rag` the database keeps growing. By default, `lanceDB` supports versioning
|
|
40
|
+
of your data. You can optimize and compact the database by running the [vaccum](#vacuum-optimize-and-cleanup) command.
|
|
41
|
+
|
|
43
42
|
### Get Document
|
|
44
43
|
|
|
45
44
|
```bash
|
|
@@ -55,33 +54,8 @@ haiku-rag delete <TAB>
|
|
|
55
54
|
haiku-rag rm <TAB> # alias
|
|
56
55
|
```
|
|
57
56
|
|
|
58
|
-
### Rebuild Database
|
|
59
|
-
|
|
60
|
-
Rebuild the database by deleting all chunks & embeddings and re-indexing all documents:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
haiku-rag rebuild
|
|
64
|
-
```
|
|
65
|
-
|
|
66
57
|
Use this when you want to change things like the embedding model or chunk size for example.
|
|
67
58
|
|
|
68
|
-
## Migration
|
|
69
|
-
|
|
70
|
-
### Migrate from SQLite to LanceDB
|
|
71
|
-
|
|
72
|
-
Migrate an existing SQLite database to LanceDB:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
haiku-rag migrate /path/to/old_database.sqlite
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
This will:
|
|
79
|
-
- Read all documents, chunks, embeddings, and settings from the SQLite database
|
|
80
|
-
- Create a new LanceDB database with the same data in the same directory
|
|
81
|
-
- Optimize the new database for best performance
|
|
82
|
-
|
|
83
|
-
The original SQLite database remains unchanged, so you can safely migrate without risk of data loss.
|
|
84
|
-
|
|
85
59
|
## Search
|
|
86
60
|
|
|
87
61
|
Basic search:
|
|
@@ -108,13 +82,6 @@ haiku-rag ask "Who is the author of haiku.rag?" --cite
|
|
|
108
82
|
|
|
109
83
|
The QA agent will search your documents for relevant information and provide a comprehensive answer. With `--cite`, responses include citations showing which documents were used.
|
|
110
84
|
|
|
111
|
-
## Configuration
|
|
112
|
-
|
|
113
|
-
View current configuration settings:
|
|
114
|
-
```bash
|
|
115
|
-
haiku-rag settings
|
|
116
|
-
```
|
|
117
|
-
|
|
118
85
|
## Server
|
|
119
86
|
|
|
120
87
|
Start the MCP server:
|
|
@@ -129,14 +96,62 @@ haiku-rag serve --stdio
|
|
|
129
96
|
haiku-rag serve --sse
|
|
130
97
|
```
|
|
131
98
|
|
|
132
|
-
##
|
|
99
|
+
## Settings
|
|
133
100
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
101
|
+
View current configuration settings:
|
|
102
|
+
```bash
|
|
103
|
+
haiku-rag settings
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Maintenance
|
|
107
|
+
|
|
108
|
+
### Vacuum (Optimize and Cleanup)
|
|
109
|
+
|
|
110
|
+
Reduce disk usage by optimizing and pruning old table versions across all tables:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
haiku-rag vacuum
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Rebuild Database
|
|
117
|
+
|
|
118
|
+
Rebuild the database by deleting all chunks & embeddings and re-indexing all documents. This is useful
|
|
119
|
+
when want to switch embeddings provider or model:
|
|
137
120
|
|
|
138
|
-
Example:
|
|
139
121
|
```bash
|
|
140
|
-
haiku-rag
|
|
141
|
-
haiku-rag add -h
|
|
122
|
+
haiku-rag rebuild
|
|
142
123
|
```
|
|
124
|
+
|
|
125
|
+
## Migration
|
|
126
|
+
|
|
127
|
+
### Migrate from SQLite to LanceDB
|
|
128
|
+
|
|
129
|
+
Migrate an existing SQLite database to LanceDB:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
haiku-rag migrate /path/to/old_database.sqlite
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
This will:
|
|
136
|
+
- Read all documents, chunks, embeddings, and settings from the SQLite database
|
|
137
|
+
- Create a new LanceDB database with the same data in the same directory
|
|
138
|
+
- Optimize the new database for best performance
|
|
139
|
+
|
|
140
|
+
The original SQLite database remains unchanged, so you can safely migrate without risk of data loss.
|
|
141
|
+
|
|
142
|
+
## Shell Autocompletion
|
|
143
|
+
|
|
144
|
+
Enable shell autocompletion for faster, error‑free usage.
|
|
145
|
+
|
|
146
|
+
- Temporary (current shell only):
|
|
147
|
+
```bash
|
|
148
|
+
eval "$(haiku-rag --show-completion)"
|
|
149
|
+
```
|
|
150
|
+
- Permanent installation:
|
|
151
|
+
```bash
|
|
152
|
+
haiku-rag --install-completion
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
What’s completed:
|
|
156
|
+
- `get` and `delete`/`rm`: Document IDs from the selected database (respects `--db`).
|
|
157
|
+
- `add-src`: Local filesystem paths (URLs can still be typed manually).
|
|
@@ -52,7 +52,6 @@ haiku-rag migrate old_database.sqlite # Migrate from SQLite
|
|
|
52
52
|
- [Installation](installation.md) - Install haiku.rag with different providers
|
|
53
53
|
- [Configuration](configuration.md) - Environment variables and settings
|
|
54
54
|
- [CLI](cli.md) - Command line interface usage
|
|
55
|
-
- [Question Answering](qa.md) - QA agents and natural language queries
|
|
56
55
|
- [Server](server.md) - File monitoring and server mode
|
|
57
56
|
- [MCP](mcp.md) - Model Context Protocol integration
|
|
58
57
|
- [Python](python.md) - Python API reference
|
|
@@ -99,6 +99,16 @@ async for doc_id in client.rebuild_database():
|
|
|
99
99
|
print(f"Processed document {doc_id}")
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
## Maintenance
|
|
103
|
+
|
|
104
|
+
Run maintenance to optimize storage and prune old table versions:
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
await client.vacuum()
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
This compacts tables and removes historical versions to keep disk usage in check. It’s safe to run anytime, for example after bulk imports or periodically in long‑running apps.
|
|
111
|
+
|
|
102
112
|
## Searching Documents
|
|
103
113
|
|
|
104
114
|
The search method performs native hybrid search (vector + full-text) using LanceDB with optional reranking for improved relevance:
|
|
@@ -102,6 +102,15 @@ class HaikuRAGApp:
|
|
|
102
102
|
except Exception as e:
|
|
103
103
|
self.console.print(f"[red]Error rebuilding database: {e}[/red]")
|
|
104
104
|
|
|
105
|
+
async def vacuum(self):
|
|
106
|
+
"""Run database maintenance: optimize and cleanup table history."""
|
|
107
|
+
try:
|
|
108
|
+
async with HaikuRAG(db_path=self.db_path, skip_validation=True) as client:
|
|
109
|
+
await client.vacuum()
|
|
110
|
+
self.console.print("[b]Vacuum completed successfully.[/b]")
|
|
111
|
+
except Exception as e:
|
|
112
|
+
self.console.print(f"[red]Error during vacuum: {e}[/red]")
|
|
113
|
+
|
|
105
114
|
def show_settings(self):
|
|
106
115
|
"""Display current configuration settings."""
|
|
107
116
|
self.console.print("[bold]haiku.rag configuration[/bold]")
|
|
@@ -256,6 +256,18 @@ def rebuild(
|
|
|
256
256
|
asyncio.run(app.rebuild())
|
|
257
257
|
|
|
258
258
|
|
|
259
|
+
@cli.command("vacuum", help="Optimize and clean up all tables to reduce disk usage")
|
|
260
|
+
def vacuum(
|
|
261
|
+
db: Path = typer.Option(
|
|
262
|
+
Config.DEFAULT_DATA_DIR / "haiku.rag.lancedb",
|
|
263
|
+
"--db",
|
|
264
|
+
help="Path to the LanceDB database file",
|
|
265
|
+
),
|
|
266
|
+
):
|
|
267
|
+
app = HaikuRAGApp(db_path=db)
|
|
268
|
+
asyncio.run(app.vacuum())
|
|
269
|
+
|
|
270
|
+
|
|
259
271
|
@cli.command(
|
|
260
272
|
"serve", help="Start the haiku.rag MCP server (by default in streamable HTTP mode)"
|
|
261
273
|
)
|
|
@@ -550,6 +550,16 @@ class HaikuRAG:
|
|
|
550
550
|
)
|
|
551
551
|
yield doc.id
|
|
552
552
|
|
|
553
|
+
# Final maintenance: centralized vacuum to curb disk usage
|
|
554
|
+
try:
|
|
555
|
+
self.store.vacuum()
|
|
556
|
+
except Exception:
|
|
557
|
+
pass
|
|
558
|
+
|
|
559
|
+
async def vacuum(self) -> None:
|
|
560
|
+
"""Optimize and clean up old versions across all tables."""
|
|
561
|
+
self.store.vacuum()
|
|
562
|
+
|
|
553
563
|
def close(self):
|
|
554
564
|
"""Close the underlying store connection."""
|
|
555
565
|
self.store.close()
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import warnings
|
|
2
3
|
|
|
3
4
|
from rich.console import Console
|
|
4
5
|
from rich.logging import RichHandler
|
|
@@ -50,4 +51,6 @@ def configure_cli_logging(level: int = logging.INFO) -> logging.Logger:
|
|
|
50
51
|
logger = get_logger()
|
|
51
52
|
logger.setLevel(level)
|
|
52
53
|
logger.propagate = False
|
|
54
|
+
|
|
55
|
+
warnings.filterwarnings("ignore")
|
|
53
56
|
return logger
|
|
@@ -47,7 +47,7 @@ class SQLiteToLanceDBMigrator:
|
|
|
47
47
|
|
|
48
48
|
# Load the sqlite-vec extension
|
|
49
49
|
try:
|
|
50
|
-
import sqlite_vec
|
|
50
|
+
import sqlite_vec # type: ignore
|
|
51
51
|
|
|
52
52
|
sqlite_conn.enable_load_extension(True)
|
|
53
53
|
sqlite_vec.load(sqlite_conn)
|
|
@@ -91,10 +91,10 @@ class SQLiteToLanceDBMigrator:
|
|
|
91
91
|
|
|
92
92
|
sqlite_conn.close()
|
|
93
93
|
|
|
94
|
-
# Optimize
|
|
94
|
+
# Optimize and cleanup using centralized vacuum
|
|
95
95
|
self.console.print("[blue]Optimizing LanceDB...[/blue]")
|
|
96
96
|
try:
|
|
97
|
-
lance_store.
|
|
97
|
+
lance_store.vacuum()
|
|
98
98
|
self.console.print("[green]✅ Optimization completed[/green]")
|
|
99
99
|
except Exception as e:
|
|
100
100
|
self.console.print(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
|
+
from datetime import timedelta
|
|
3
4
|
from importlib import metadata
|
|
4
5
|
from pathlib import Path
|
|
5
6
|
from uuid import uuid4
|
|
@@ -62,6 +63,15 @@ class Store:
|
|
|
62
63
|
if not skip_validation:
|
|
63
64
|
self._validate_configuration()
|
|
64
65
|
|
|
66
|
+
def vacuum(self) -> None:
|
|
67
|
+
"""Optimize and clean up old versions across all tables to reduce disk usage."""
|
|
68
|
+
if self._has_cloud_config() and str(Config.LANCEDB_URI).startswith("db://"):
|
|
69
|
+
return
|
|
70
|
+
|
|
71
|
+
# Perform maintenance per table using optimize() with cleanup_older_than 0
|
|
72
|
+
for table in [self.documents_table, self.chunks_table, self.settings_table]:
|
|
73
|
+
table.optimize(cleanup_older_than=timedelta(0))
|
|
74
|
+
|
|
65
75
|
def _connect_to_lancedb(self, db_path: Path):
|
|
66
76
|
"""Establish connection to LanceDB (local, cloud, or object storage)."""
|
|
67
77
|
# Check if we have cloud configuration
|
|
@@ -159,16 +169,18 @@ class Store:
|
|
|
159
169
|
self.settings_table.search().limit(1).to_pydantic(SettingsRecord)
|
|
160
170
|
)
|
|
161
171
|
if settings_records:
|
|
162
|
-
|
|
172
|
+
# Only write if version actually changes to avoid creating new table versions
|
|
173
|
+
current = (
|
|
163
174
|
json.loads(settings_records[0].settings)
|
|
164
175
|
if settings_records[0].settings
|
|
165
176
|
else {}
|
|
166
177
|
)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
178
|
+
if current.get("version") != version:
|
|
179
|
+
current["version"] = version
|
|
180
|
+
self.settings_table.update(
|
|
181
|
+
where="id = 'settings'",
|
|
182
|
+
values={"settings": json.dumps(current)},
|
|
183
|
+
)
|
|
172
184
|
else:
|
|
173
185
|
# Create new settings record
|
|
174
186
|
settings_data = Config.model_dump(mode="json")
|
|
@@ -84,10 +84,15 @@ class SettingsRepository:
|
|
|
84
84
|
)
|
|
85
85
|
|
|
86
86
|
if existing:
|
|
87
|
-
#
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
# Only update when configuration actually changed to avoid needless new versions
|
|
88
|
+
existing_payload = (
|
|
89
|
+
json.loads(existing[0].settings) if existing[0].settings else {}
|
|
90
90
|
)
|
|
91
|
+
if existing_payload != current_config:
|
|
92
|
+
self.store.settings_table.update(
|
|
93
|
+
where="id = 'settings'",
|
|
94
|
+
values={"settings": json.dumps(current_config)},
|
|
95
|
+
)
|
|
91
96
|
else:
|
|
92
97
|
# Create new settings
|
|
93
98
|
settings_record = SettingsRecord(
|
|
@@ -8,8 +8,10 @@ from rich.progress import Progress
|
|
|
8
8
|
|
|
9
9
|
from haiku.rag import logging # noqa
|
|
10
10
|
from haiku.rag.client import HaikuRAG
|
|
11
|
+
from haiku.rag.logging import configure_cli_logging
|
|
11
12
|
from haiku.rag.qa import get_qa_agent
|
|
12
13
|
|
|
14
|
+
configure_cli_logging()
|
|
13
15
|
console = Console()
|
|
14
16
|
|
|
15
17
|
db_path = Path(__file__).parent / "data" / "benchmark.lancedb"
|
|
@@ -35,6 +37,7 @@ async def populate_db():
|
|
|
35
37
|
uri=uri,
|
|
36
38
|
)
|
|
37
39
|
progress.advance(task)
|
|
40
|
+
rag.store.vacuum()
|
|
38
41
|
|
|
39
42
|
|
|
40
43
|
async def run_match_benchmark():
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|