# Agent Memory Protocol

A small, portable routine for coding agents to carry forward learned project context without turning an instruction file into a transcript.

## Keep the layers separate

Keep stable commands, rules, and conventions in CLAUDE.md, AGENTS.md, or the equivalent instruction file. Store learned context in memory: decisions, pitfalls, working patterns, important project facts, and concise handoffs.

## Session routine

1. **Recall first.** At the start of a task, retrieve memories about the project, goal, and files you are about to change.
2. **Store durable lessons.** Save decisions, pitfalls, patterns, and handoff context that another session would otherwise have to rediscover.
3. **Verify when it helps.** When a recalled memory materially improves the work, verify it so future recall can rank it with more confidence.
4. **Leave a handoff.** Before another agent or session continues, store the outcome and the next useful step.

## Portable instruction

```text
At the start of each task, recall relevant project memory.
During work, store durable decisions, pitfalls, patterns, and important context.
When recalled memory materially helps, verify it.
Before ending or handing off, store the outcome and the next useful step.
```

Tool names vary by client and provider. Use the equivalent recall, store, verify, and handoff tools available to the agent.

## Verify a StremAI connection

Connect two agents to the same StremAI project. With the first agent:

```text
Use StremAI project memory and test store/recall.
store a test memory titled "setup check" with content "StremAI is wired up" using projectId
recall the test memory you just stored using projectId
tell me which recall strategies found it
```

Then ask the second connected agent to recall the same setup check. It should return the stored title and content rather than a fresh guess.

Start at https://stremai.com/getting-started or try public recall at https://stremai.com/playground.
