Skip to main content
Hiroshi utilizes a concurrent Reciprocal Rank Fusion (RRF) memory retrieval pipeline to achieve robust context matching across both semantic concepts and exact code symbols.

πŸ“Š The Fusion Formula

When a memory retrieval sweep is triggered, Hiroshi queries the vector similarity indexing and FTS5 keyword indexes concurrently, scoring matching records using reciprocal ranks: RRFΒ Score(d)=βˆ‘m∈Mwmk+rm(d)\text{RRF Score}(d) = \sum_{m \in M} \frac{w_m}{k + r_m(d)} Where:
  • (M) represents the retrieval models (Vector Cosine Similarity & SQLite FTS5).
  • (w_m) represents the model weight: 0.70 for Vector and 0.30 for FTS5.
  • (r_m(d)) is the 1-based rank index of document (d) within model (m).
  • (k) is a smoothing constant set to 60.0.
This hybrid model guarantees that if your embedding server goes offline or has connection drops, the FTS5 keyword engine acts as an automatic fallback, keeping your memory layer functional.