Skip to content
Flows
Tier 3 · Agent memory Agent memory · fetched 2026-07-02

semantic-memory (RecursiveIntell)

Local-first hybrid semantic search backed by authoritative SQLite state plus a vector sidecar: facts, chunked documents, conversation messages, and episodes searched via BM25 (FTS5) and vector retrieval fused with Reciprocal Rank Fusion, with explainable search.

View source on GitHub

Key takeaways

  • 01

    Hybrid BM25 + vector with rank fusion beats either alone

  • 02

    Keep an authoritative relational store; treat vectors as a sidecar index

  • 03

    Explainable retrieval helps debug why a memory surfaced

Flows built on this research

From the archive

Verbatim excerpts mined from our local archive of this repository — the prompts, schemas, and patterns worth stealing.

Memory

SQLite is the truth; HNSW is just an accelerator

- SQLite is the authoritative store for all durable rows and f32 embeddings.
- FTS5 provides BM25 full-text search.
- Vector search uses cosine similarity.
- Reciprocal Rank Fusion combines BM25 and vector results.
- HNSW is an optional acceleration sidecar, not a source of truth.
- Sidecar mutations are journaled in SQLite and replayed on open, flush, rebuild, or reconcile.
- Quantized q8 copies of embeddings are stored for facts, chunks, messages, and episodes.
- WAL mode plus a single writer and pooled readers allows concurrent read-heavy use.

The most disciplined storage stance in the vault: the vector index can always be rebuilt from SQLite, so corruption of the fast path never loses a memory.

README.md