Skip to main content

How it works

Pure semantic (dense) search misses exact-match queries like product codes, names, or technical terms. Pure keyword (sparse) search misses paraphrases and synonyms. MemWire combines both using Qdrant’s hybrid search with reciprocal rank fusion:
  • Dense vectors — sentence embeddings from TextEmbedding (FastEmbed), capturing semantic meaning
  • Sparse vectors — SPLADE token weights from SparseTextEmbedding, capturing exact lexical signal
Both vectors are computed for every stored memory and every query. Results are merged by Qdrant before being returned to MemWire.
Hybrid search is on by default. No extra configuration needed:

If you want dense-only retrieval (faster, lower memory):
Disabling hybrid search means the sparse model is never loaded. This saves ~200 MB of RAM but reduces retrieval quality for exact-match queries.

Adding a cross-encoder reranker

For the highest retrieval quality, combine hybrid search with a cross-encoder reranker. The reranker re-scores the top candidates using full query-document attention:
The reranker is lazy-loaded — it is only downloaded and initialised on the first search() call.

Models

Swap any model via MemWireConfig:

Configuration reference