Memory and Context
Continuity, role definitions, durable notes, and context boundaries.
Memory is an infrastructure layer. In a local agent system, it is not enough to hope an agent remembers. Important decisions, constraints, and lessons need to be written in durable files that can be consulted later.
Types of Memory
| Type | Function |
|---|---|
| Identity | Defines who the agent is, what role it has, and how it should behave. |
| Rules | Security limits, permissions, and working style. |
| Long memory | Decisions, lessons, and stable context. |
| Journals | Chronological record of events and sessions. |
| Tool notes | Operational information about tools, commands, and environment behavior. |
Durable Files
The memory layer includes files such as:
IDENTITY.md;AGENTS.md;TOOLS.md;MEMORY.md;- dated journals;
- worker-specific memory;
- agent profile backups.
Context Boundaries
The memory layer works best when each kind of context has a clear boundary.
| Context | Role |
|---|---|
| Durable knowledge | Decisions, rules, lessons, and facts that should survive sessions. |
| Transient state | Current tasks, temporary assumptions, and short-lived working notes. |
| Agent profile | The role, tone, constraints, and expected behavior of an agent. |
| Tool context | Instructions that explain when a tool should be used and how it should be verified. |
| Session summary | A compact handoff that preserves continuity without copying the whole conversation. |
Memory Curation
Memory needs maintenance. Useful notes should be promoted into durable files; stale notes should be corrected or retired; session-specific details should stay close to the work they describe. This keeps the agent grounded without turning memory into a noisy archive.
Activatable Context
Agents receive context from several sources:
AGENTS.mdfor repository rules;SKILL.mdfor when to use a capability;TOOL.mdfor understanding a tool before implementing it;README.mdfor human-facing usage;.agents/skillsfor specialized knowledge.
Golden Rule
If something should survive a session, write it down. If something can change behavior, give it an owner, a scope, and a place in the context hierarchy.