Manage agent memory

Save stable preferences so they remain available after a conversation grows or a client disconnects. Retrieve past decisions from their sources before relying on them. Memory is evidence and context; it does not replace current instructions or the state of a WorkItem.

Before you start

Choose the agent whose memory you intend to update. Use its actual AgentHome location from runtime context; agent_home below is a descriptive name, not a shell directory to copy literally. Keep project-specific rules in the project.

1. Choose where the information belongs

InformationDestination
Stable operator preferences, such as response languageThis agent's memory/operator.md
Durable facts about this agent's role or recurring workThis agent's memory/self.md
Standing role, responsibilities, and authority boundariesThis agent's AGENTS.md
Repository build commands and project conventionsProject guidance in the active workspace
Current objective, acceptance checks, and remaining workExisting WorkItem plan and todo list
Longer notes or supporting materialA named file in the appropriate workspace, read directly when needed

These curated files belong to an agent. Writing a preference in one agent's memory does not automatically update every other agent.

2. Save a small, specific preference

Ask the target agent:

Remember for future work with this agent: keep completion reports concise,
include verification results, and state any untested parts. Update
memory/operator.md without replacing existing unrelated preferences.
Tell me which file changed.

The agent should read the file before editing, merge the preference, and return its confirmed location. Inspect that change. Do not store credentials, callback URLs, copied transcripts, or temporary task logs as preferences.

Holon loads a bounded slice of memory/operator.md and memory/self.md into context. Put the important durable entries near the start and remove stale duplication. Longer content remains retrievable; it is not all present in every turn.

3. Retrieve a past decision

Ask the same agent to find a specific decision and identify its evidence:

Find the previous decision about the CI retry policy. Read the original source,
identify the WorkItem or message it came from, and tell me whether it still
matches the current configuration.

The agent first calls MemorySearch:

{ "query": "CI retry policy decision", "limit": 5 }

It copies a returned source_ref unchanged into MemoryGet:

{ "source_ref": "SOURCE_REF_FROM_SEARCH", "max_chars": 8000 }

source_ref is an opaque reference. Do not invent one from a file path, URL, or WorkItem ID. If the result supplies a saved source artifact, read that artifact in bounded ranges when the inline text is insufficient.

4. Check the evidence before acting

Confirm that the retrieved source refers to the correct project and decision. Compare old conclusions with current files or WorkItem state. A historical success report does not prove that today's tests pass.

For a preference, success means the entry exists in the intended file and the agent can retrieve it. For a past decision, success means the answer identifies the source and distinguishes the historical decision from the current state.

If search finds nothing

See Memory for the indexing model and Work items for tracked progress.