Expand description
Searchable chunks store backed by SQLite FTS5.
Port reference: Aonyx RAG rag_system/utils/bm25_store.py + utils/hybrid_search.py.
§V1 scope (this file)
- Chunk = a piece of text + project + source + timestamp + free-form metadata.
- SQLite FTS5 virtual table provides BM25-ranked full-text search out
of the box, with a
unicode61 remove_diacritics 2tokenizer that survives accents. search_bm25(project?, query, k)returns the top-kchunks ordered by relevance, with positivescore = -bm25(...)so larger = better.
§V1.1 (deferred)
- Local embeddings via
fastembed-rs(ONNX, ~30 MB model). - HNSW index for vector ANN search.
- RRF fusion with
k = 60combining BM25 + vectors. - Exponential temporal boost on recent chunks.
The trait signature already accepts a mode field so V1.1 can extend it
without breaking callers.
Structs§
- Chunk
- A piece of indexable text.
- Scored
Chunk - A search hit: a chunk and its score (larger = more relevant).
- Sqlite
Chunks Store - SQLite-backed
ChunksStoreusing FTS5 for BM25 ranking.
Traits§
- Chunks
Store - Async chunks store.