Why We Built a 4-Layer Memory System
Most AI systems have one kind of memory. A context window. A vector store. A chat history file. Each works for narrow use cases, but none is sufficient for an AI that needs to learn, adapt, and remain aligned over time.
We built a 4-layer memory architecture because different timescales require different substrates. Sensory data (voice, vision, file events) is ephemeral and high-throughput — Redis handles this. Working memory needs fast access and TTL-bound expiry — also Redis, but with session isolation. Episodic memory needs persistence, semantic search, and vector similarity — PostgreSQL with pgvector. And pattern memory needs graph relationships and cross-session abstraction — Kuzu for the graph, SQLite for extracted patterns.
The key insight is not technical — it is architectural. By separating layers, each can be tuned independently. Sensory buffer can be flushed aggressively without losing episodic history. Patterns can be re-extracted from raw episodes without corruption. Each layer has its own performance characteristics, backup strategy, and security model.
The result is a memory system that does not require choosing between speed and persistence. It has both — because the layers are distinct, not merged.