This guide assumes you’ve connected to SenseLab. If you haven’t, do that first — it takes 30 seconds.
In your IDE
Your coding agent calls memory itself over MCP. You talk to it in plain English — no code to write.
In your own code
You call the SDK directly to build memory into your own agents and services.
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.
In Your IDE
If you connected Cursor, Claude Code, Claude Desktop, or Codex, your agent already has the memory tools. You never call them yourself — you just talk to the agent, and it decides when to reach for memory.Check it’s working
Ask your agent:Save something
Anything you’d otherwise repeat to every new chat is worth saving:amfs_write for you. Durable
decisions, gotchas, and preferences are all fair game — it stores personal
context just as happily as code.
The part that matters: recall somewhere else
This is the whole point, so it’s worth doing once deliberately. Open a different tool — if you saved from Cursor, use Claude Desktop — and ask:Get briefed before it works
Before an agent touches a codebase, one call gets it the compiled context — what’s known, what’s risky, and who else has worked there:Close the loop
When a task ends, have the agent record how it went. Outcomes feed back into confidence, so memories that led somewhere good get trusted more and memories that led somewhere bad get trusted less:Agents work best when told when to use memory. Add the
SenseLab Skill so yours sets an identity,
searches before answering, and commits outcomes without being asked each time.
In Your Own Code
Everything below uses the Python SDK directly. Reach for this when you’re building your own agent or service rather than working through an IDE. See the TypeScript SDK guide for the same thing in Node.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. SenseLab 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:
12. View Your Timeline
Every operation is recorded on your agent’s git-like timeline — like commits in a repo:The Mental Model
Next Steps
MCP Setup
Connect every IDE on your machine, and add the memory skill.
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.
