Lab Notes

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

TypeFunction
IdentityDefines who the agent is, what role it has, and how it should behave.
RulesSecurity limits, permissions, and working style.
Long memoryDecisions, lessons, and stable context.
JournalsChronological record of events and sessions.
Tool notesOperational 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.

ContextRole
Durable knowledgeDecisions, rules, lessons, and facts that should survive sessions.
Transient stateCurrent tasks, temporary assumptions, and short-lived working notes.
Agent profileThe role, tone, constraints, and expected behavior of an agent.
Tool contextInstructions that explain when a tool should be used and how it should be verified.
Session summaryA 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.md for repository rules;
  • SKILL.md for when to use a capability;
  • TOOL.md for understanding a tool before implementing it;
  • README.md for human-facing usage;
  • .agents/skills for 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.

References