Open the app
Memory & journal

Memory layer (SQLite)

A generic memory_items model in SQLite, five memory types, and structured-first retrieval with optional vectors.

Under review — agent memory may move to Convex
The agent-memory layer is likely to use Convex (native vector search, full-text search and the @convex-dev/agent component) rather than a separate SQLite service — Convex is already self-hosted, reactive and backed up, so it removes a store. SQLite stays only as the embedded Convex backend store (and a possible local read-cache); pgvector / Qdrant is the graduation path at scale. The SQLite design below is kept for reference and is revisited when the agentic layer is built.

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:

TypeContent
EpisodicComplete past events — opportunities, decisions, trades, outcomes
SemanticExtracted knowledge — validated lessons, recurring patterns
ProceduralHow the system operates — rules, workflow versions, scoring formulas
ExperimentalHypotheses, parameters, datasets, results, rejected ideas
Human-decisionOverrides, 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.

Redeploying must never wipe memory
On graceful shutdown the runtime checkpoints WAL and persists before exiting; the volume outlives the container. SQLite is for agentic memory, never the high-frequency market store — that is Parquet’s job.