Skip to main content

Module recall

Module recall 

Source
Expand description

Memory Recall Engine — Hybrid vector + FTS search (Phase N10).

Auto-embeds memories at write time using the Embedder trait, and fuses Tantivy BM25 + vector cosine similarity at recall time.

§Architecture

RecallEngine
├── embedder: Arc<dyn Embedder>
├── vector_store: VectorStore
├── search_engine: SearchEngine (Tantivy BM25)
├── embedding_cache: HashMap<content_hash, Vec<f32>>
└── hybrid_search(query, limit) → Vec<RecallResult>
    1. Embed query → query vector
    2. Tantivy BM25 search → text scores
    3. Vector cosine similarity → vector scores
    4. Fuse: w1*BM25 + w2*vector + w3*importance
    5. Return ranked results

§Environment Variables

VariableDefaultDescription
WM_RECALL_BM25_WEIGHT0.5Weight for BM25 text score
WM_RECALL_VECTOR_WEIGHT0.3Weight for vector cosine similarity
WM_RECALL_IMPORTANCE_WEIGHT0.2Weight for memory importance
WM_TRUST_WEIGHT0.0Post-fusion trust multiplier (source_trust 0.7 neutral)
WM_RECALL_CONFORMAL_ALPHAunsetConformal set miscoverage level (unset = off)

Structs§

BackfillReport
Report from a RecallEngine::backfill_embeddings pass.
RecallConfig
Configuration for the recall engine.
RecallEngine
Hybrid recall engine combining BM25 + vector search.
RecallResult
A single recall result with fused scores.