← ATXGREENE.COM
Minds & Machines · Independent Research
Agent Architecture · April 2026

I Built a Brain for My AI Agent.
Here's What I Learned.

Every AI memory system makes the same mistake. After months of building Mnemosyne — a local-first cognitive OS for language agents — I think I know how to fix it.

HOW EVERY OTHER SYSTEM WORKS Raw Turn "what happened" Vector Store embed + retrieve Summary compress → abstract Response context injected ↑ always one direction ↑ Fast reactive behavior still driven by base model training — not by you. Every turn. Every conversation. Every agent.

There's a gap in every AI agent system that nobody talks about. It sits right at the beginning of every turn — the moment before any retrieval runs, before any context is loaded, before the model even sees your message. In that moment, what does your agent actually know about you?

The answer, in virtually every system shipped today, is: only what it was trained on. Base model priors. The default behaviors of whatever LLM you're using. Not the patterns it learned from your conversations last week. Not the habits you've built together over months. Not the fact that you always prefer bullet points over prose, or that you're building a startup in Oklahoma City, or that you've mentioned your Ironman training seventeen times and it actually matters when you ask about recovery nutrition.

All of that knowledge exists somewhere in the vector store. But it doesn't live in the fast path. The fast path is still the factory model.

I've been building a system called Mnemosyne — a local-first cognitive memory architecture for language agents — for the past several months. And the single most important thing I've learned is this: the problem isn't that agents don't remember things. The problem is that memory only flows in one direction.

"The problem isn't that agents don't remember things. The problem is that memory only flows in one direction."

The insight

Memory Has Always Had Two Directions. Agents Only Use One.

Think about how human expertise actually develops. When you learn to drive, you don't consciously retrieve "left foot = clutch, right foot = brake" on every turn. That knowledge gets consolidated — during sleep, during rest, during the brain's offline processing cycles — into fast automatic behavior. You just do it.

Cognitive science has known this for decades. Anderson's ACT-R theory (1983) describes how memory activation decays over time and strengthens with use. Ebbinghaus's forgetting curve is in every intro psych textbook. The idea that consolidation happens offline — during sleep specifically — is one of the most replicated findings in neuroscience.

Every agent memory system I've studied — MemGPT, Mem0, CoALA, Generative Agents — correctly implements the bottom-up direction: raw experience gets compressed into summaries, summaries become abstractions, abstractions persist. That's the right idea. But none of them close the loop. None of them push knowledge back down to where the agent acts first.

Mnemosyne does. And the architecture for doing it is simpler than you might think.

The Architecture

Six Tiers. Two Directions.

The Integrated Cognitive Memory System (ICMS) organizes memory across six tiers, each with a different access speed and decay rate:

L6 REFLECTION Metacognition · user pattern distillation · temporal coherence OFFLINE ONLY L5 IDENTITY Core values · unconditional injection · never decays · human-approved L4 PATTERN Recurring traits · muscle-memory behaviors · promoted by compactor L3 COLD Historical episodic memory · full FTS5 search · ACT-R decay L2 RECENT Warm / short-term · FTS5 search · default for new memories L1 IMMEDIATE Hot / working memory · current session context · fastest SQLite path L0 INSTINCT ← CHECKED FIRST · sub-millisecond · in-process Python dict Populated OFFLINE from L6. Never written during live turns. BOTTOM-UP CONSOLIDATION L6 → L0 DURING DREAM CYCLES

The six-tier ICMS. Orange arrows show bottom-up consolidation (standard in all systems). The teal arrow is what's new: L6 Reflection pushing distilled patterns down to L0 Instinct during offline dream cycles.

Each tier has a different half-life. Identity-class memories — your core values, your preferences, who you are — decay with a 70-day half-life. Operational memories — the tool call you made Tuesday, the error you got last session — decay in 2.3 days. This is grounded directly in Anderson's ACT-R base-level learning equation, not made up:

# ACT-R base-level approximation
B = ln(n) - 0.5 × ln(t_mean)
# n = access count, t_mean = mean time since each access

# Kind-specific decay multipliers
KIND_DECAY_MULTIPLIERS = {
  "core_value": 0.1, # 70-day half-life
  "preference": 0.3, # 23-day half-life
  "fact": 1.0, # 7-day half-life (baseline)
  "failure_note": 3.0, # 2.3-day half-life
}

Access strengthens memory via Hebbian asymptotic reinforcement: new_s = s + 0.1 × (1.0 - s). The asymptotic form matters — it means a memory accessed thousands of times converges to strength=1.0 but can never exceed it. No runaway growth. What you use stays. What you don't, fades.

The main contribution

The Dream Cycle: How the Loop Closes

This is the part I'm most excited about, and the part that I believe is genuinely new.

Every ~50 turns, Mnemosyne runs what I call a dream cycle. It happens offline — never during a live conversation. Three things happen in sequence:

THE DREAM CYCLE — OFFLINE, EVERY ~50 TURNS STEP 1 Cluster L3 cold memories → semantic clusters STEP 2 Compact Clusters → L4 patterns via Jaccard similarity STEP 3 — KEY Reflection L6 reads L4 patterns. Extracts fast-path hints. Writes → L0 Instinct. L0 INSTINCT UPDATED Ready for next turn's hot-path check. Example L6 prompt output → "When user asks about Ironman training, always surface wattage + nutrition context." "User prefers bullet points over prose." "Route code review tasks to cloud model."

The dream cycle: three-step offline process. The Reflection step (Step 3) is what closes the loop — distilling L4 patterns into L0 Instinct entries that are ready on the very next turn's hot path.

The result: on your next conversation, before any FTS5 search runs, before any vector retrieval, before the model even processes your message — the agent already knows that you're building a startup, that you prefer brevity, that you need wattage zones when you ask about cycling. Not because it retrieved that. Because it consolidated it.

This is the same mechanism that turns a beginner driver into an expert. The knowledge doesn't just accumulate — it migrates to where it's needed fastest.

Identity

The One Layer That Never Gets Retrieved

There's another tier that works differently from all the others: L5 Identity.

Most memory systems treat identity like any other memory — something you retrieve when relevant. But identity isn't relevant — it's always relevant. The moment you make identity retrieval-dependent, you've created an agent that can forget who it is the second the query doesn't match.

L5 in Mnemosyne is injected unconditionally into every system prompt. No query. No match threshold. No retrieval budget. If you've approved a value as L5 — a core principle, a non-negotiable, a defining characteristic — it appears in every single turn, guaranteed.

The 4-layer identity lock (system preamble → IDENTITY.md → post-filter regex → jailbreak scenario testing) is tested against a 40-prompt jailbreak suite per model. The results: the model changes, the identity doesn't.

Implementation note: L5 is the only tier that can't be modified by the agent's self-improvement loop. All changes to L5 require explicit human approval. The compactor explicitly refuses to write to L5. This is a hard architectural constraint, not a soft guideline.
The self-improvement loop

The Agent That Watches Itself Fail

One of the things that separated the Meta-Harness paper (2026) from everything else I'd read was a simple observation: compressed feedback is the failure mode. If you summarize failures before the agent sees them, you lose the signal that matters.

Mnemosyne writes every event raw to events.jsonl — every memory operation, tool call, model invocation, dream cycle, triage scan, avatar update. Never summarized at write time. The full telemetry is queryable via mnemosyne-experiments.

The self-improvement loop runs offline:

TRIAGE Cluster failures score severity PROPOSER Write markdown change proposals YOU REVIEW Accept / Reject Nothing deploys without you. MEASURE Re-run scenarios. Pareto delta. back to triage on next cycle

The triage → proposer → apply → measure loop. The human review step is not optional — nothing deploys automatically. The agent can observe and propose; only you can authorize change.

The six severity dimensions in triage — frequency, blast radius, recency, consistency, identity slip, cascade risk — are designed so that not all failures are equal. An identity slip (the agent forgetting who it is) gets blast_radius=0.9. A routing error gets 0.5. The severity score determines which proposals get written first.

The numbers

What It Actually Looks Like In Practice

0
Runtime deps
19
Model backends
290+
Tests passing
<0.1ms
L0 lookup
7ms
500-row compact

The continuity evaluation suite (50 cross-session scenarios) gives a dryrun baseline of 0.69 — measuring memory plumbing correctness without LLM involvement. The cross-session subset (true DB close/reopen between plant and probe) comes in at 0.57, which is where the hard work of persistence testing lives. Full live-LLM benchmarks against Mem0 and MemGPT on LOCOMO are running this week.

The whole system is a clone away:

git clone https://github.com/atxgreene/Mnemosyne

# Start the daemon + dashboard
mnemosyne-serve &
open http://127.0.0.1:8484/ui

Zero runtime dependencies. Your data stays on your disk. SQLite + FTS5, human-readable JSONL, plain markdown for configuration. If Mnemosyne disappeared tomorrow, your knowledge survives as a directory of readable files.

Honest limitations

What I Don't Know Yet

I want to be honest about what's missing. The LOCOMO and LongMemEval benchmarks against Mem0 and MemGPT are not published yet. I'll have numbers this week. Until then, the architecture is theoretically grounded and the implementation is clean, but the head-to-head comparison exists only as a design claim.

The Reflection distillation quality is model-dependent. Smaller local models (7–9B parameters) produce less coherent instinct entries than larger ones. The Anthropic paper on introspective awareness (Macar et al., 2026) suggests that DPO training — not SFT — is what gives models genuine self-knowledge. If I get to fine-tuning, that's where I'll focus.

Dream clustering uses TF-IDF by default, which captures about 30–40% of the semantic signal that sentence-transformers would give you. It works. It's not optimal. You can install the optional embeddings backend if you need better clustering.

The honest summary: This is a v0.9.4 system from an independent researcher, not a funded lab with a benchmark team. The architecture is the contribution. The numbers are coming. The code is open and the tests are green.
The point

Why This Matters More Than Another Vector Store

The AI agent space is moving fast. Mem0, MemGPT, CoALA, A-MEM — these are all serious systems doing important work. I've learned from all of them.

But I think the field has converged on a pattern — bottom-up only, vector retrieval as the primary interface, memory as something you load rather than something that shapes behavior — and that pattern has a fundamental limit. Your agent's first response will always be a base-model response until the fast path is shaped by user-specific learning.

The Reflection→Instinct loop is one answer to that problem. Sleep-driven procedural consolidation, translated to software. Metacognitive processing that doesn't just compress experience but actively uses it to reshape reactive behavior.

"Your agent's first response will always be a base-model response until the fast path is shaped by user-specific learning."

I built Mnemosyne because I wanted an agent that actually knows me — not one that retrieves facts about me. Those are different things. The first is what memory systems have been building. The second is what I wanted.

After v0.9.4, I think I have it. The benchmarks will tell me how far.

Try It / Read The Paper

Open source, MIT license. Installs in one command. Your data stays on your machine.

GitHub → More research →

github.com/atxgreene/Mnemosyne · MIT