Expand description
Vector store abstraction for chunk persistence and hybrid search.
The VectorStore trait decouples the RAG pipeline from any specific
storage backend. Two implementations are provided behind feature flags:
internal(default) — pure Rust, zero native deps, MessagePack on disklancedb— LanceDB-backed hybrid BM25 + vector search
Structs§
- Brute
Force Store - Pure‑Rust brute‑force vector store backed by MessagePack on disk.
Enabled by the
internalfeature (on by default). - Hybrid
RrfRanker - Cosine-similarity + BM25 fused via Reciprocal Rank Fusion (k = 60).
- LlmReranker
- LLM-based re-ranker: delegates candidate retrieval to an inner ranker, then asks an LLM to re-order the candidates by relevance to the query.
- MmrDiversity
Ranker - Maximal Marginal Relevance (MMR) diversity re-ranker.
- Scored
Chunk - Result of a hybrid search.
- Stored
Chunk - A single chunk with its embedding, ready to be stored.
- Weighted
Fusion Ranker - Weighted linear fusion of cosine similarity and BM25.
Traits§
- Ranker
- Pluggable chunk ranking strategy.
- Vector
Store - Backend-agnostic chunk storage with hybrid BM25 + vector search.
Functions§
- embed_
and_ insert - Helper: convert embedded
(text, Vec<f32>)pairs intoStoredChunks keyed by source file, then insert into the store. - open_
store - Open or create a vector store in the given folder. Uses the built‑in brute‑force store (MessagePack on disk).