Memory layer (SQLite)
A generic memory_items model in SQLite, five memory types, and structured-first retrieval with optional vectors.
Memory first is a pillar: the lab remembers every state, hypothesis, trade, score, reasoning, failure and improvement. It lives in SQLite — portable, locally inspectable, simple to back up, fully owned, accessed via SQLAlchemy or SQLModel.
Five memory types (one model)
Rather than a table per category, a generic record carries a memory type:
| Type | Content |
|---|---|
| Episodic | Complete past events — opportunities, decisions, trades, outcomes |
| Semantic | Extracted knowledge — validated lessons, recurring patterns |
| Procedural | How the system operates — rules, workflow versions, scoring formulas |
| Experimental | Hypotheses, parameters, datasets, results, rejected ideas |
| Human-decision | Overrides, approvals, rejections, manual entries/exits, explanations |
The model
The central memory_items table is surrounded by relations, evidence, embeddings, feedback, revisions and compaction runs — a lightweight knowledge graph. Every conclusion keeps its supporting evidence; revisions are immutable. See the memory schema.
Retrieval & storage
- SQLite
- SQLAlchemy / SQLModel
- FTS5
- sqlite-vec (optional)
- WAL mode
Order of preference: structured SQLite fields first, full-text search (FTS5) second, vector similarity (sqlite-vec) only for semantic retrieval. The file lives on a mounted Docker volume with WAL mode and scheduled integrity checks.