Skip to main content

Module store

Module store 

Source
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 disk
  • lancedb — LanceDB-backed hybrid BM25 + vector search

Structs§

BruteForceStore
Pure‑Rust brute‑force vector store backed by MessagePack on disk. Enabled by the internal feature (on by default).
HybridRrfRanker
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.
MmrDiversityRanker
Maximal Marginal Relevance (MMR) diversity re-ranker.
ScoredChunk
Result of a hybrid search.
StoredChunk
A single chunk with its embedding, ready to be stored.
WeightedFusionRanker
Weighted linear fusion of cosine similarity and BM25.

Traits§

Ranker
Pluggable chunk ranking strategy.
VectorStore
Backend-agnostic chunk storage with hybrid BM25 + vector search.

Functions§

embed_and_insert
Helper: convert embedded (text, Vec<f32>) pairs into StoredChunks 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).