How to Give Your AI Agent Persistent Memory in 5 Minutes
Most AI agents forget everything the moment a session ends. Giving an agent persistent memory used to require building custom storage, embedding pipelines, and retrieval logic. With a hosted shared brain like AgentBrain, you can give any MCP-compatible agent durable, shared memory in about five minutes — no code changes.
What you'll get
- Memories that survive across sessions
- Context shared across multiple agents
- Semantic recall (search by meaning, not keywords)
Step 1 — Get a free API key
Register to get an API key on the free tier:
curl -X POST https://agentbrain-auth.onrender.com/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "yourpassword"}'
You'll get back an API key that looks like ab_.... Keep it handy.
Step 2 — Connect your agent via MCP
Add AgentBrain as an MCP server in your agent's client config (Claude Desktop, Claude Code, Cursor, Windsurf, or any MCP client):
{
"mcpServers": {
"agentbrain": {
"url": "https://agentbrain-auth.onrender.com",
"headers": { "X-API-Key": "ab_your_api_key_here" }
}
}
}
Step 3 — Store a memory
Once connected, your agent can call the remember tool. You can also test it directly:
curl -X POST https://agentbrain-auth.onrender.com/mcp/remember \
-H "Content-Type: application/json" -H "X-API-Key: ab_your_api_key_here" \
-d '{"content": "The user prefers concise answers and works in fintech.", "metadata": {"tag": "preference"}}'
Step 4 — Recall it later
In any future session, the agent retrieves relevant memories with recall:
curl -X POST https://agentbrain-auth.onrender.com/mcp/recall \
-H "Content-Type: application/json" -H "X-API-Key: ab_your_api_key_here" \
-d '{"query": "what does the user prefer?"}'
Step 5 — Verify your limits
Check your tier and remaining capacity:
curl -H "X-API-Key: ab_your_api_key_here" \
https://agentbrain-auth.onrender.com/auth/limits
Going further
The free tier is enough to get started. For higher memory limits, knowledge-graph tools, and agent discovery, see the paid plans. To share context across a whole team of agents, register each agent with register_agent and let them discover each other with discover_agents.
Key takeaways
- You can add persistent memory to any MCP agent in ~5 minutes with no code changes.
- The flow is: register → connect via MCP → remember → recall.
- Because AgentBrain is shared and hosted, the memory works across agents and sessions.