aismemory
v0.6.0
Published
Persistent memory for AI agents. MCP server that connects to Agent Identity Service.
Readme
aismemory
Persistent memory for AI agents. One command to give your AI agent memory that persists across sessions, tools, and runtimes.
Quick Start
Add to your IDE's MCP server config:
{
"mcpServers": {
"aismemory": {
"command": "npx",
"args": ["aismemory"]
}
}
}On first run, you'll be prompted to authenticate:
Visit: https://agentsandswarms.ai/activate?user_code=ABCD-EFGH
Or go to https://agentsandswarms.ai/activate and enter code: ABCD-EFGHAfter approving, your agent has persistent memory. Every future session auto-authenticates.
Tools
| Tool | Description |
|------|-------------|
| remember | Store a memory (fact, event, lesson, context, goal, task) |
| recall | Search memories by natural language query |
| whoami | Get agent identity and status |
| full_context | Load complete agent context (personality, goals, facts, skills) |
| dream | Trigger memory consolidation (promotes important, archives old) |
| handoff | Save session context for the next session |
| agent_load | Switch the active agent by name — triggers on "get me X", "bring me X", "load X", "/agent X", "switch to X" |
Works With
- Claude Code
- Claude.ai
- Cursor
- Windsurf
- VS Code + Copilot
- Any MCP-compatible client
How It Works
aismemory is a thin MCP server that connects to Agent Identity Service via HTTP. No local database needed. Your agent's memories are stored securely in the cloud and accessible from any device or IDE.
Authentication uses the OAuth device flow (RFC 8628). Credentials are saved to ~/.aismemory/credentials.json.
Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| AIS_URL | https://ais.agentsandswarms.ai | AIS server URL |
Unattended machines (agent API keys)
For CI runners, servers, and other machines that can't complete an interactive browser bond, skip the device flow entirely with a scoped agent API key:
{
"mcpServers": {
"aismemory": {
"command": "npx",
"args": ["aismemory"],
"env": {
"AIS_AGENT_API_KEY": "ais_ak_...",
"AIS_AGENT_ID": "<the agent id this key was minted for>",
"AIS_URL": "https://ais.agentsandswarms.ai"
}
}
}
}When AIS_AGENT_API_KEY is set, AIS_AGENT_ID is required — the server
mints keys scoped to exactly one agent, so the client needs to be told which
agent that is up front. If AIS_AGENT_ID is missing, the process prints an
actionable error and exits immediately; it never falls back to the device
flow or creates a new agent on your behalf.
This credential is intentionally scoped: it can only read/write that one
agent's memory, goals, dream, and full_context data. Tools that need
a broader route — agent_load (switching agents, which needs tenant-wide
agent listing) and handoff (not on the key's allowed route list) — return
an explicit "not available with agent API key auth" error rather than
failing silently or faking success. whoami answers from AIS_AGENT_ID
directly instead of calling the (unscoped) identity route.
License
MIT
