This guide assumes you’ve connected to AMFS. If you haven’t, do that first — it takes 30 seconds.
How Memory Sharing Works
All agents share the same memory pool. Theagent_id marks who wrote each entry.
By default, every memory is shared — any agent can read it. Agents can also write private memories that only they can access.
1. Create Your Brain
Every agent gets its own brain viaAgentMemory:
agent_id is the agent’s identity. Everything it writes is tagged with this ID, and it can later recall only its own memories.
2. Form a Memory
When your agent learns something, write it to memory:3. Keep Things Private
Not everything should be shared. Useshared=False for internal reasoning, scratchpad notes, or sensitive context:
read(), search(), list(), and read_from() all skip them. Only the owning agent can access its private entries via recall() and my_entries().
4. Recall Your Memory
Ask your brain: “What do I know about this?”recall() returns only entries written by this agent, including private ones. If another agent wrote a different version, recall() ignores it — it’s this brain’s direct experience.
5. Read Shared Knowledge
Ask the shared pool: “What does anyone know about this?”read() returns the latest shared version by any agent. Private entries from other agents are never returned. Both read() and recall() return None if no matching entry exists.
6. Learn from Another Agent
Explicitly pull knowledge from a specific agent’s brain:read_from() makes cross-agent knowledge transfer explicit and trackable. It only returns shared entries — you cannot read another agent’s private memories. The read is logged in the causal chain so you can always trace where knowledge came from.
7. See What’s in Your Brain
List everything this agent has written:my_entries() returns both shared and private entries — it’s your complete brain.
8. Learn from Experience
When something significant happens, record the outcome. AMFS automatically adjusts confidence scores on related entries:9. Know Who You’ve Learned From
Track inter-agent memory relationships:10. Watch for Changes
Get notified in real-time when knowledge changes:11. Context Manager
UseAgentMemory as a context manager for clean shutdown:
The Mental Model
| What you want to do | Method | Sees private? | Who wrote it? |
|---|---|---|---|
| Form a shared memory | write() | — | You (this agent) |
| Form a private memory | write(shared=False) | — | You (this agent) |
| Recall your own knowledge | recall() | Yes (yours only) | Only you |
| Read shared knowledge | read() | No | Anyone (latest) |
| Learn from a specific agent | read_from(agent_id) | No | That specific agent |
| See all your memories | my_entries() | Yes (yours only) | Only you |
| Know who taught you | cross_agent_reads() | — | Other agents |
| See your memory timeline | timeline() | — | You (events log) |
12. View Your Timeline
Every operation is recorded on your agent’s git-like timeline — like commits in a repo:Next Steps
Configuration
YAML config, adapters, and environment variables.
Core Concepts
Understand CoW, confidence, and outcome propagation.
Git-like Timeline
How agent memory works like Git.
Python SDK Guide
Full SDK reference with advanced features.
