Memory is five layers, not a bigger window
Models got smarter. Long-horizon agents still re-brief from zero. The production fix is a memory stack (working, episodic, semantic, procedural, forgetting), not another context-window upgrade.
We build production GenAI for operations, knowledge, and data. Models got smarter this year. Long-horizon agents still open a fresh session and re-brief from zero. That is not a model IQ problem. It is a memory architecture problem. Buy a bigger window and you buy more room to forget with confidence. Design five layers and the agent can carry work across days without pretending every turn is the first.
A harness already decides what the agent may see, touch, and call done. Memory is the part of that harness that decides what is still true when the chat ends. How you store it (files a person can open, not opaque blobs) is the complementary half of the story. We wrote that in inspectable agent memory. This note is the other half: which layers you design, how they flow, and why forgetting belongs on day one.
The bottleneck moved
Frontier models handle longer prompts than they did two years ago. Teams still lose days on multi-session debug, support triage, and schema work because each session starts as if the last one never happened. Same broken approach. Retried. A fact that was already true on Tuesday gets re-derived like it was news. A skill that should have been promoted after the third win never loads, so the agent plans from scratch anyway.
Those failures look like reasoning misses in the chat. On an operations floor they are memory misses. The model did not get dumber overnight. What failed is simpler: the estate never wrote down what happened, what is true, how we do this, and what should die.
Stretching the context window does not invent that ledger. It only delays the truncate. At some budget the early task brief falls off the back. Decisions vanish. The agent keeps the last tool dump and loses the reason the job exists. That is FIFO amnesia with a prettier token meter.
Five layers, five questions
Memory is not one pile. Collapse everything into "stuff we retrieved" and stale guesses become policy. Split it into five questions the harness can answer.
Working. What is true right now, in this context window? System prompt, current turn, tool results, the open ticket, the slim pack you injected. Cheap to refresh. Dangerous to treat as durable.
Episodic. What happened? Task attempts, errors, outcomes, user corrections, cost and time. A log of runs, not a philosophy. The agent that can ask "did we already try X?" stops burning tokens on the same failed approach.
Semantic. What is true? Distilled facts, entities, relations. A thin ontology beats stuffing more tokens into the next prompt. Schema and validation beat folklore.
Procedural. How do we do this? Named skills: trigger, steps, tools, preconditions, success criteria. Versioned. Loadable. Refusable when the job does not match.
Forgetting. What should we delete or supersede? TTL, contradiction flags, supersession when a lock changes. A never-forget agent rot. Confident wrong behavior from a stale fact is worse than a clean miss.
Read the figure the way a reviewer will read a stuck agent. Working is the hot surface. Everything else exists so working can stay small. Overflow is not a nice-to-have. It is the rule that protects the task brief when the budget hits roughly 85% full. Extract decisions and facts into episodic, then compact. Keep recent turns and pointers. Do not FIFO-destroy the reason the job started.
A practical path that ships
Do not build all five layers on the first calendar day. Sequence them, or you will ship a museum of empty stores.
Start with episodic only. One JSONL of task outcomes is enough to query similar past tasks before starting. Minutes to ship. Biggest early return. The agent that can load "last three attempts on this ticket type" stops looking clever while repeating failure.
Overflow before truncate. When context pressure rises, write first. Compact second. A slim context pack still matters for what you inject. Overflow is how you refuse to erase the brief just because the window got full.
Add a thin ontology for semantic. Entity types, relations, a validation pass. One schema layer beats stuffing another thousand tokens of narrative into gather. Keep it boring. Boring is auditable.
Promote skills after repeated wins. Same task type succeeds three times? Turn the method into a procedural skill with a version and an owner. A stale skill is worse than no skill. Promotion without versioning is how folklore becomes law.
Build forgetting on day one of semantic. Supersede outdated facts. Flag contradictions for a person to resolve. Put TTL on data that ages. If forgetting is a cleanup ticket for next quarter, you will ship confident wrong answers this quarter.
Write-back discipline sits beside this stack. Chat is enough inside a thread. Memory and files are for what must survive outside it. Dumping every turn into semantic is how the ontology becomes a junk drawer. The same habit that keeps profile memory small keeps semantic honest.
Production tests worth copying
Architecture without tests is a slide. Four checks catch the failures that demos hide.
Amnesia. Finish a multi-step fix. Open a new session. The agent must recall the outcome without re-reading the entire prior transcript. If it cannot, episodic write-back failed.
Contradiction. Inject two conflicting facts. The agent must flag the conflict, not silently pick a favorite. Silent pick is how wrong on-call rotas page the wrong person.
Staleness. Expire a TTL. The expired fact must not still drive answers. If it does, forgetting is decoration.
Skill promotion. After N successes on the same job type, the next run should load the skill instead of re-planning from a blank page. If it re-plans every time, procedural memory is a folder of unread markdown.
These tests are cheap. They are also how you know you built memory, not atmosphere.
When not to add memory
Skip the stack for one-off format jobs, pure brainstorming, and batch work that should stay stateless. Memory has cost: storage, review, contradiction handling, the discipline to forget. Pay that cost for daily reports, support triage, multi-session debug, and any job where last week's outcome should change today's gather. Do not pay it for a one-shot CSV reshape that dies when the script exits.
Inspectability and layers are partners
Files you can open, paths you can diff, a bus that does not hide another blob: that is how a person overrules a bad write. Layers are what you put in those files. Working scratch, episodic logs, semantic notes, procedural skills, forgetting rules. Without layers, an inspectable filesystem is still a diary. Without inspectability, a five-layer design is a black box with better vocabulary.
We still do not know how automatic skill promotion should be before a person has to approve the pack, and that uncertainty is the kind of loose end a production team should keep visible instead of papering over with a silent default. Until that line is clear, promote with an owner on the file and a version the next run can refuse. The model can suggest the skill. The harness decides whether it loads.
What production demands
Production wants an agent that remembers the right things and forgets the rest on purpose.
Keep working small and honest. Overflow into episodic before the window truncates the brief. Distill into a thin semantic ontology. Promote methods into versioned skills after repeated wins. Put forgetting on the product surface the day semantic goes live. Test amnesia, contradiction, staleness, and promotion before you claim the agent learned. Skip memory where the job is one-shot and should stay that way.
At sunrisegenai.com the harness is still the product. Memory is how the harness survives the next session. Five layers beat a bigger window. The agent that forgets on purpose is the one you can trust on the floor.