← TormentNexus

Dual-Tier Memory Architecture for AI Agents: L1 Scratchpad + L2 Vault

July 13, 2026 · TormentNexus Team

Human brains have working memory and long-term memory. AI agents need the same split. TormentNexus implements this as L1 (fast, volatile scratchpad) and L2 (persistent, searchable vault).

L1: The Scratchpad

L1 is the agent working memory — fast, in-process, and ephemeral. It holds the current conversation context, intermediate reasoning steps, and scratch calculations. When the session ends, L1 clears.

L2: The Vault

L2 is where permanence lives. Every memory entry has content, tags, category, importance score, and a heat score that decays over time. The vault uses SQLite with FTS5 for full-text search and vector embeddings for semantic similarity.

The Bridge: Harvesting L1 into L2

The Memory Harvester agent periodically scans L1 contents and extracts high-value memories for L2 storage. It identifies patterns worth keeping: architecture decisions, bug fixes, user preferences.

Why Two Tiers Matter

Without L1, agents are slow — every piece of context requires a database query. Without L2, agents are forgetful — everything vanishes at session end. Together, they give agents the speed of working memory with the durability of long-term storage.

GitHub · Docs