Agentic System · Engineering notes
Finding a decision and the conversation behind it
Hippocampus is the memory system. Its curated store, Brain, holds decisions. Echo indexes conversation excerpts so a returning assistant can check what was said. Both use the same SQLite file.
Share of its original recency contribution remaining after 90 days.
Freshness contributes 15% of the default score. Relevance and importance account for the rest.
Technology
- SQLite
- FTS5 and BM25
- sqlite-vec
- Reciprocal rank fusion
- Maximal marginal relevance
Search by name and by meaning
Suppose I ask where a project stores its decisions. Keyword search can match the project name exactly. Vector search can find a note that describes the same decision in different words. Brain combines the two ranked lists, giving more weight to records that appear near the top of both.
Choose what fits in context
By default each search returns up to 30 candidates before fusion. Brain keeps up to ten using maximal marginal relevance, which discounts candidates similar to ones already selected. It then scores the shortlist using relevance, stored importance and age. The age term declines faster for a task than for an architecture decision. Computing a new query embedding requires an external service.
What kind of memory is this?
One session can leave three different records. “The code lives in this repository” is a fact in the semantic tier. “We repaired the build today” is an event stored as a task in the episodic tier. “Run this check before the next release” is an inferred procedure stored as a soft rule in the procedural tier. A deliberately curated rule has its own type. This distinction lets an agent search for instructions without treating a past event as policy.
How quickly does each type age?
Brain’s default shortlist score gives 75% weight to relevance, 10% to stored importance and 15% to recency. Recency follows exp(−age in days / time constant). After 90 days, an eligible task retains about 37% of its original recency contribution, a fact about 78%, and a curated rule about 98%. Only the recency contribution fades on that curve. Nightly retirement is a separate operation.
| Stored memory type | Recency time constant |
|---|---|
| Observability record | 7 days |
| Task result or to do | 90 days |
| Insight, reflection, meeting, meeting summary or tool performance | 180 days |
| Fact, inferred procedure, reference, project or project note | 365 days |
| Tool, configuration or person | 730 days |
| Curated rule, architecture or decision | 3,650 days |
| Other types | 365 days by default |
How the workspace stores memory
Brain and Echo use separate tables in one SQLite file on the workstation. SQLite’s write ahead log lets readers continue while a writer saves new records. The sqlite-vec extension searches the stored vectors inside the same database.
Why the embedding model stays fixed
An embedding represents a note as coordinates. A query and a stored note need coordinates from the same model for distance to mean anything. Brain uses OpenAI’s text-embedding-3-small with 1,536 dimensions. Changing models would require rebuilding the affected index and checking retrieval quality. Mixing old and new coordinates would make the rankings unreliable.
Recover the original wording
Echo searches indexed conversation excerpts in separate tables. A match carries the session, message role and source line, so the reader can inspect the exchange. Echo also supports keyword search without a query embedding. It skips short turns and caps long excerpts, so a missing match leaves the original question open.