The Three-Layer Memory System Powering Smart AI Agents
Most "AI memory" implementations are just key-value stores that save the last N messages. That's not memory. That's a buffer.
Real memory has structure. Inspired by cognitive science, Noomachy uses a three-layer architecture: working, semantic, and episodic. Each layer does something specific, and together they let an agent actually learn over time.
L1 — Working Memory
Working memory is the agent's current focus. It contains the last N messages of the active conversation, the tools it has loaded, and any temporary variables the current task needs.
Lifetime: 24 hours, then it expires. Scope: Per conversation. Purpose: Keep the conversation coherent.
When you start a new conversation, working memory is fresh. When you say "as I mentioned before", the agent looks here first. If it's not in working memory, it searches the next layer.
L2 — Semantic Memory
Semantic memory is the long-term knowledge layer. It stores facts about you, your projects, your preferences — anything that should persist forever.
Each fact in semantic memory has:
- A content string ("User prefers TypeScript over JavaScript")
- A confidence score (0.0 to 1.0)
- A source (conversation, document, episodic promotion)
- A vector embedding for similarity search
- Tags for filtering
- A last-accessed timestamp
When you start a new conversation, the agent runs a vector search against semantic memory to find the top-K most relevant facts and injects them into the system prompt. This is how the agent "remembers" you across sessions.
Lifetime: Forever (until you delete it). Scope: Per agent (or shared across agents if you choose). Purpose: Long-term knowledge.
The Validation Gate
You can't just write everything to semantic memory or it becomes useless. New facts go through a validation gate:
- Duplicate check — cosine similarity vs existing memories. > 0.92 = duplicate, reject.
- Contradiction check — does this conflict with an existing high-confidence fact?
- Auto-approval rule — if confidence > 0.85 and no conflicts, promote. Otherwise queue for human review.
Read more: Why Validation Gates Matter in AI Memory Systems
L3 — Episodic Memory
Episodic memory is the diary. Every time the agent completes a task, it logs an episode: what was asked, what tools were used, what the outcome was, what could have gone better.
Each episode contains:
- Task domain (research, coding, planning, etc.)
- Session snapshot (message count, tools used, summary)
- Outcome (success / failure / partial)
- Lessons learned (extracted by the model after the fact)
- Tool calls with timing and results
- Consolidation score (how valuable this memory is for future learning)
Lifetime: Forever (append-only). Scope: Per agent. Purpose: Learn from experience.
Episodic Consolidation
Every six hours, a background job clusters similar episodes and promotes the highest-scoring ones to semantic memory. This is how an agent learns patterns: not from training, but from its own history.
How the Layers Work Together
Imagine you ask your agent: "Schedule a meeting with Sarah tomorrow at 3pm."
- Working memory holds the conversation context and any partial info you've shared today.
- Semantic memory is queried: who is Sarah? Vector search returns "Sarah Johnson is the user's CTO, sarah@acme.com, prefers Zoom over Google Meet".
- Episodic memory is checked: have we scheduled meetings with Sarah before? Yes — last time we used calendar_create with the Zoom link in the location field.
- Tools are called: calendar_create with the right defaults.
- After completion, an episode is logged for next time.
This is what a sovereign agent looks like in motion. No model retraining, no manual prompt engineering — just structured memory.
Try It
Noomachy ships with all three layers active by default. Start chatting and watch your Memory tab fill up with facts the agent has learned.
Ready to try Noomachy?
Build AI agents with sovereign memory in minutes. Free tier, no credit card.
Get Started FreeRelated posts
Sovereign Memory: Why AI Agents Need Their Own Brain
Cloud-only AI forgets you. Sovereign memory means your agent keeps a private, persistent memory that you control. Here is how it works.
How Noomachy Uses Vector Search to Find Relevant Memories
Vector embeddings turn semantic memory from a junk drawer into a searchable brain. Here is how it works under the hood.
Why Validation Gates Matter in AI Memory Systems
Naive AI memory becomes a junk drawer. Validation gates filter out duplicates, contradictions, and noise so memory stays useful.