haiku.rag 0.5.4__py3-none-any.whl → 0.5.5__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/client.py CHANGED
@@ -349,17 +349,21 @@ class HaikuRAG:
349
349
  return reranked_results
350
350
 
351
351
  async def expand_context(
352
- self, search_results: list[tuple[Chunk, float]]
352
+ self,
353
+ search_results: list[tuple[Chunk, float]],
354
+ radius: int = Config.CONTEXT_CHUNK_RADIUS,
353
355
  ) -> list[tuple[Chunk, float]]:
354
356
  """Expand search results with adjacent chunks, merging overlapping chunks.
355
357
 
356
358
  Args:
357
359
  search_results: List of (chunk, score) tuples from search.
360
+ radius: Number of adjacent chunks to include before/after each chunk.
361
+ Defaults to CONTEXT_CHUNK_RADIUS config setting.
358
362
 
359
363
  Returns:
360
364
  List of (chunk, score) tuples with expanded and merged context chunks.
361
365
  """
362
- if Config.CONTEXT_CHUNK_RADIUS == 0:
366
+ if radius == 0:
363
367
  return search_results
364
368
 
365
369
  # Group chunks by document_id to handle merging within documents
@@ -377,7 +381,7 @@ class HaikuRAG:
377
381
  expanded_ranges = []
378
382
  for chunk, score in doc_chunks:
379
383
  adjacent_chunks = await self.chunk_repository.get_adjacent_chunks(
380
- chunk, Config.CONTEXT_CHUNK_RADIUS
384
+ chunk, radius
381
385
  )
382
386
 
383
387
  all_chunks = adjacent_chunks + [chunk]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haiku.rag
3
- Version: 0.5.4
3
+ Version: 0.5.5
4
4
  Summary: Retrieval Augmented Generation (RAG) with SQLite
5
5
  Author-email: Yiorgis Gozadinos <ggozadinos@gmail.com>
6
6
  License: MIT
@@ -2,7 +2,7 @@ haiku/rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  haiku/rag/app.py,sha256=k45EOz-rbYg_8RSII3btqsZo2TpGqj3ysamFehhaCGo,7673
3
3
  haiku/rag/chunker.py,sha256=PVe6ysv8UlacUd4Zb3_8RFWIaWDXnzBAy2VDJ4TaUsE,1555
4
4
  haiku/rag/cli.py,sha256=mGpdnEH8rS-rZLGmE4MbcDci8uexci7UkGTdCxrz1Lg,5987
5
- haiku/rag/client.py,sha256=CTc4OJ-rnAI3pcjQgazK7B06wkNLP6wYXD1spQtXXzg,20961
5
+ haiku/rag/client.py,sha256=rpMKVxtb3Q2kuDM1pHaZsGX_w0TC1zxotsooNwI3Jbg,21129
6
6
  haiku/rag/config.py,sha256=oLrmwGp1OjcKPpJFnf9GgTpoBSOXalFWO6PCKFwQe0w,1615
7
7
  haiku/rag/logging.py,sha256=zTTGpGq5tPdcd7RpCbd9EGw1IZlQDbYkrCg9t9pqRc4,580
8
8
  haiku/rag/mcp.py,sha256=tMN6fNX7ZtAER1R6DL1GkC9HZozTC4HzuQs199p7icI,4551
@@ -37,8 +37,8 @@ haiku/rag/store/repositories/document.py,sha256=ki8LiDukwU1469Yw51i0rQFvBzUQeYkF
37
37
  haiku/rag/store/repositories/settings.py,sha256=qZLXvLsErnCWL0nBQQNfRnatHzCKhtUDLvUK9k-W_fU,2463
38
38
  haiku/rag/store/upgrades/__init__.py,sha256=kKS1YWT_P-CYKhKtokOLTIFNKf9jlfjFFr8lyIMeogM,100
39
39
  haiku/rag/store/upgrades/v0_3_4.py,sha256=GLogKZdZ40NX1vBHKdOJju7fFzNUCHoEnjSZg17Hm2U,663
40
- haiku_rag-0.5.4.dist-info/METADATA,sha256=hUovrigbcJX6I3vewMVXut3QaI-PXe5BiDzs84noBts,4455
41
- haiku_rag-0.5.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
42
- haiku_rag-0.5.4.dist-info/entry_points.txt,sha256=G1U3nAkNd5YDYd4v0tuYFbriz0i-JheCsFuT9kIoGCI,48
43
- haiku_rag-0.5.4.dist-info/licenses/LICENSE,sha256=eXZrWjSk9PwYFNK9yUczl3oPl95Z4V9UXH7bPN46iPo,1065
44
- haiku_rag-0.5.4.dist-info/RECORD,,
40
+ haiku_rag-0.5.5.dist-info/METADATA,sha256=rponlCmspT548_0Z_YbYSp8Q2c1QQlCEXzRMx5sxPfs,4455
41
+ haiku_rag-0.5.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
42
+ haiku_rag-0.5.5.dist-info/entry_points.txt,sha256=G1U3nAkNd5YDYd4v0tuYFbriz0i-JheCsFuT9kIoGCI,48
43
+ haiku_rag-0.5.5.dist-info/licenses/LICENSE,sha256=eXZrWjSk9PwYFNK9yUczl3oPl95Z4V9UXH7bPN46iPo,1065
44
+ haiku_rag-0.5.5.dist-info/RECORD,,