Core concepts

Search and reranking

Hybrid vector and keyword search, salience and reranking.

llms.txt

Recall is hybrid by default. A query runs against both the HNSW vector index (semantic similarity) and a BM25 keyword index, and the two result lists are fused with Reciprocal Rank Fusion, then blended with each memory's salience and recency. Keyword precision catches exact names, dates, and IDs that pure embeddings miss; semantic search catches paraphrases that keywords miss.

Hybrid by default

BM25 + HNSW vector + RRF, always on, no flag and no separate keyword call. The fused score is weighted with salience and recency so hot, relevant memories rank first.

Optional reranker

An opt-in second pass reorders the top candidates. The engine ships a dependency-free lexical reranker (query-term overlap), and the Reranker trait lets you plug a cross-encoder or LLM reranker. It never runs unless you ask for it, so plain recall has no added cost.

Rust
use mentedb::reranker::LexicalReranker;

// Plain recall: hybrid search (BM25 + vector + RRF), no rerank.
let ctx = db.recall("RECALL memories LIMIT 10")?;

// Opt-in second pass: reorder candidates for a natural-language query.
let reranker = LexicalReranker::default();
let ctx = db.recall_reranked(
    "RECALL memories LIMIT 20",              // MQL: what to fetch
    "how do I fix the espresso machine?",    // text the reranker scores against
    &reranker,
)?;