haiku.rag 0.7.4__py3-none-any.whl → 0.7.6__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.

Potentially problematic release.


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

haiku/rag/app.py CHANGED
@@ -170,7 +170,7 @@ class HaikuRAGApp:
170
170
  if transport == "stdio":
171
171
  await server.run_stdio_async()
172
172
  elif transport == "sse":
173
- await server.run_sse_async("sse")
173
+ await server.run_sse_async()
174
174
  else:
175
175
  await server.run_http_async("streamable-http")
176
176
  except KeyboardInterrupt:
haiku/rag/migration.py CHANGED
@@ -1,13 +1,3 @@
1
- #!/usr/bin/env python3
2
- """
3
- Migration script to migrate from SQLite to LanceDB.
4
-
5
- This script will:
6
- 1. Read data from an existing SQLite database
7
- 2. Create a new LanceDB database with the same data
8
- 3. Preserve all documents, chunks, embeddings, and settings
9
- """
10
-
11
1
  import json
12
2
  import sqlite3
13
3
  import struct
@@ -55,6 +45,22 @@ class SQLiteToLanceDBMigrator:
55
45
  sqlite_conn = sqlite3.connect(self.sqlite_path)
56
46
  sqlite_conn.row_factory = sqlite3.Row
57
47
 
48
+ # Load the sqlite-vec extension
49
+ try:
50
+ import sqlite_vec
51
+
52
+ sqlite_conn.enable_load_extension(True)
53
+ sqlite_vec.load(sqlite_conn)
54
+ self.console.print("[blue]Loaded sqlite-vec extension[/blue]")
55
+ except Exception as e:
56
+ self.console.print(
57
+ f"[yellow]Warning: Could not load sqlite-vec extension: {e}[/yellow]"
58
+ )
59
+ self.console.print(
60
+ "[yellow]Install sqlite-vec with[/yellow]\n[green]uv pip install sqlite-vec [/green]"
61
+ )
62
+ exit(1)
63
+
58
64
  # Create LanceDB store
59
65
  lance_store = Store(self.lancedb_path, skip_validation=True)
60
66
 
@@ -180,30 +186,24 @@ class SQLiteToLanceDBMigrator:
180
186
 
181
187
  chunks_data = cursor.fetchall()
182
188
 
183
- # Get embeddings separately to avoid vec0 virtual table issues
189
+ # Get embeddings using the sqlite-vec virtual table
184
190
  embeddings_map = {}
185
191
  try:
186
- # Try to get embeddings from the vec0 tables directly
192
+ # Use the virtual table to get embeddings properly
187
193
  cursor.execute("""
188
- SELECT
189
- r.chunk_id,
190
- v.vectors
191
- FROM chunk_embeddings_rowids r
192
- JOIN chunk_embeddings_vector_chunks00 v ON r.rowid = v.rowid
194
+ SELECT chunk_id, embedding
195
+ FROM chunk_embeddings
193
196
  """)
194
197
 
195
198
  for row in cursor.fetchall():
196
199
  chunk_id = row[0]
197
- vectors_blob = row[1]
198
- if vectors_blob and chunk_id not in embeddings_map:
199
- embeddings_map[chunk_id] = vectors_blob
200
+ embedding_blob = row[1]
201
+ if embedding_blob and chunk_id not in embeddings_map:
202
+ embeddings_map[chunk_id] = embedding_blob
200
203
 
201
204
  except sqlite3.OperationalError as e:
202
205
  self.console.print(
203
- f"[yellow]Warning: Could not extract embeddings: {e}[/yellow]"
204
- )
205
- self.console.print(
206
- "[yellow]Continuing migration without embeddings...[/yellow]"
206
+ f"[yellow]Warning: Could not extract embeddings from virtual table: {e}[/yellow]"
207
207
  )
208
208
 
209
209
  chunks = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haiku.rag
3
- Version: 0.7.4
3
+ Version: 0.7.6
4
4
  Summary: Retrieval Augmented Generation (RAG) with LanceDB
5
5
  Author-email: Yiorgis Gozadinos <ggozadinos@gmail.com>
6
6
  License: MIT
@@ -1,12 +1,12 @@
1
1
  haiku/rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- haiku/rag/app.py,sha256=S19UWA6dxl9NayL9hOZKC5D7fjNat4n0mUOw2PAF9u8,7842
2
+ haiku/rag/app.py,sha256=n9Y-4wHnxGeatCE-scqbv5JBnPo-5WOJ6URdfZveHC8,7837
3
3
  haiku/rag/chunker.py,sha256=PVe6ysv8UlacUd4Zb3_8RFWIaWDXnzBAy2VDJ4TaUsE,1555
4
4
  haiku/rag/cli.py,sha256=HqFHU9x2tR1yTR74V3NPndqE4R2Yn-ohASyHp334pAg,8597
5
5
  haiku/rag/client.py,sha256=N4zkWjE9Rsw9YgPvNo83xptHUQR2ognfOnjkoV_w6hc,20999
6
6
  haiku/rag/config.py,sha256=3H41da9BU1R1y2JJHD0cOSErX_VSM1UXA7M2JSOxFXE,1795
7
7
  haiku/rag/logging.py,sha256=a0ELyeMqb85ebeOTN8OQCTL1PiMWiiV9R_OOH-VZoA8,1665
8
8
  haiku/rag/mcp.py,sha256=bR9Y-Nz-hvjiql20Y0KE0hwNGwyjmPGX8K9d-qmXptY,4683
9
- haiku/rag/migration.py,sha256=gWxQwiKo0YulRhogYz4K8N98kHN9LQXIx9FeTmT24v4,10915
9
+ haiku/rag/migration.py,sha256=n5G6SDhTo8wTf0uCYbWGegq1LqIgILDLNjWcGvSj-SQ,11053
10
10
  haiku/rag/monitor.py,sha256=r386nkhdlsU8UECwIuVwnrSlgMk3vNIuUZGNIzkZuec,2770
11
11
  haiku/rag/reader.py,sha256=qkPTMJuQ_o4sK-8zpDl9WFYe_MJ7aL_gUw6rczIpW-g,3274
12
12
  haiku/rag/utils.py,sha256=c8F0ECsFSqvQxzxINAOAnvShoOnJPLsOaNE3JEY2JSc,3230
@@ -34,8 +34,8 @@ haiku/rag/store/repositories/chunk.py,sha256=v4y4eh4yIf6zJaWfHxljvnmb12dmvwdinzm
34
34
  haiku/rag/store/repositories/document.py,sha256=lP8Lo82KTP-qwXFRpYZ46WjeAdAsHwZ5pJcrXdz4g0U,6988
35
35
  haiku/rag/store/repositories/settings.py,sha256=dqnAvm-98nQrWpLBbf9QghJw673QD80-iqQhRMP5t0c,5025
36
36
  haiku/rag/store/upgrades/__init__.py,sha256=wUiEoSiHTahvuagx93E4FB07v123AhdbOjwUkPusiIg,14
37
- haiku_rag-0.7.4.dist-info/METADATA,sha256=FBrh4dllbrX9XYaAaPAiq1wLzKe7lBGjk60ICL2oM2Y,4610
38
- haiku_rag-0.7.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
- haiku_rag-0.7.4.dist-info/entry_points.txt,sha256=G1U3nAkNd5YDYd4v0tuYFbriz0i-JheCsFuT9kIoGCI,48
40
- haiku_rag-0.7.4.dist-info/licenses/LICENSE,sha256=eXZrWjSk9PwYFNK9yUczl3oPl95Z4V9UXH7bPN46iPo,1065
41
- haiku_rag-0.7.4.dist-info/RECORD,,
37
+ haiku_rag-0.7.6.dist-info/METADATA,sha256=lJ64GebtYSRr0ld0jXF-jvnpraumPOde2A0w8JVpXsc,4610
38
+ haiku_rag-0.7.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
+ haiku_rag-0.7.6.dist-info/entry_points.txt,sha256=G1U3nAkNd5YDYd4v0tuYFbriz0i-JheCsFuT9kIoGCI,48
40
+ haiku_rag-0.7.6.dist-info/licenses/LICENSE,sha256=eXZrWjSk9PwYFNK9yUczl3oPl95Z4V9UXH7bPN46iPo,1065
41
+ haiku_rag-0.7.6.dist-info/RECORD,,