Add persistent memory to Google Antigravity (Documentation Index
Fetch the complete documentation index at: https://docs.mem0.ai/llms.txt
Use this file to discover all available pages before exploring further.
agy CLI and Desktop IDE) with the Mem0 plugin. Your agent forgets everything between sessions — Mem0 fixes that by storing decisions, preferences, and learnings so they carry over automatically.
Prerequisites
-
A Mem0 API key (starts with
m0-):- Get your API key (free sign-up at app.mem0.ai)
- Add it to your shell profile so it persists across sessions:
Installation
Option A — degit (one command, no clone needed):~/.gemini/config/plugins/mem0/plugin.json:
/mem0: skills. It reads MEM0_API_KEY from your environment automatically — no extra config needed.
What’s Included
| Component | Full Plugin (A/B) | MCP Only (C) |
|---|---|---|
| MCP Server (9 memory tools) | Yes | Yes |
| Lifecycle Hooks | Yes | No |
| 16 Slash Commands | Yes | No |
Available MCP Tools
| Tool | Description |
|---|---|
add_memory | Save text or conversation history for a user/agent |
search_memories | Semantic search across memories with filters |
get_memories | List memories with filters and pagination |
get_memory | Retrieve a specific memory by ID |
update_memory | Overwrite a memory’s text by ID |
delete_memory | Delete a single memory by ID |
delete_all_memories | Bulk delete all memories in scope |
delete_entities | Delete a user/agent/app/run entity and its memories |
list_entities | List users/agents/apps/runs stored in Mem0 |
Lifecycle Hooks
The plugin uses the same shell scripts as Claude Code, Cursor, and Codex — hooks bridge environment variables using${extensionPath} (Antigravity’s plugin-root token).
| Hook | Event | What it does |
|---|---|---|
| Session start | SessionStart | Loads prior memories and displays status banner |
| User prompt | UserPromptSubmit | Searches relevant memories before each message |
| Pre-tool | PreToolUse | Blocks MEMORY.md writes, enforces user_id/app_id on mem0 tools |
| Post-tool | PostToolUse | Tracks stats, scans bash errors for related memories |
Troubleshooting
- No tools appearing — Restart your Antigravity session after installation
- “Connection failed” — Verify your key is set:
echo $MEM0_API_KEY - MCP 401 Unauthorized — If
${MEM0_API_KEY}interpolation doesn’t work in youragyversion, replace with your literal key inmcp_config.json
Mem0 MCP Setup
Detailed MCP configuration for all clients
OpenCode Integration
Add Mem0 memory to OpenCode workflows