Agent Memories

Agent memory is not a bigger context window.
It is a system design problem.
And the default instinct to "just add more tokens" is usually wrong.
So the job is not to cram everything into working memory.
The job is to separate memory by function.
1. Working memory
This is the live context window during a single run.
It holds the current conversation, tool calls, and immediate results.
The key improvement here is not "more context."
It is better orchestration.
A harness manages the agent loop, gathers inputs, invokes tools, and feeds results back into the model.
And instead of wasting working memory on trial-and-error search, you can inject retrieved knowledge hints directly into the system prompt.
That reduces unnecessary tool calls and keeps the context cleaner.
2. Episodic memory
This is the record of what happened before.
Past interactions. Errors. Fixes. Decisions. Outcomes.
The useful move here is trace generation.
Every run produces a full audit trail of what the agent inspected, which tools it called, where it failed, and how it recovered.
Then, outside the live loop, an LLM-powered engine mines those traces for recurring failures and successful fixes.
That is how patterns start to emerge.
3. Semantic memory
This is the project knowledge layer.
Repository structure. Domain concepts. File relationships. Code layout.
This is where simple keyword search starts to break down.
A code knowledge graph is a better fit because it captures three relationships explicitly:
- import edges
- call edges
- co-edit edges
That graph can then be audited, deduplicated, and queried from an anchor node using semantic similarity plus personalised PageRank.
The result is faster, more relevant retrieval than plain text search.
4. Procedural memory
This is the memory of how to do things.
Reusable workflows. Operational rules. Step-by-step procedures.
Here, the best method is trajectory-to-skill induction.
An induction engine reads execution traces and turns them into standardised skill markdown files.
But there is an important safeguard:
those proposed skills go through a human review gate first.
That prevents bad traces from becoming permanent behaviour.
Approved skills then move into a version-controlled Skill Box, where they can be reused on similar tasks later.
That is the real shift:
context engineering is memory engineering.
And the best agents will not be the ones that remember the most.
They will be the ones that remember the right things in the right place.
Originally published on LinkedIn.
Turn your expertise into LinkedIn posts like this one.
Try Postars free →