Skip to main content

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.

Add persistent memory to Google Antigravity (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

  1. A Mem0 API key (starts with m0-):
  2. Add it to your shell profile so it persists across sessions:
echo 'export MEM0_API_KEY="m0-your-api-key"' >> ~/.zshrc && source ~/.zshrc

Installation

Option A — degit (one command, no clone needed):
npx degit mem0ai/mem0/mem0-plugin/.antigravity ~/.gemini/config/plugins/mem0
Option B — agy CLI (if you have the repo cloned):
agy plugin install /path/to/mem0/mem0-plugin/.antigravity
Option C — MCP only (no hooks or skills): Create ~/.gemini/config/plugins/mem0/plugin.json:
{
  "name": "mem0",
  "mcpServers": {
    "mem0": {
      "serverUrl": "https://mcp.mem0.ai/mcp/",
      "headers": { "Authorization": "Token ${MEM0_API_KEY}" }
    }
  }
}
Restart Antigravity. The full plugin auto-registers the MCP server, lifecycle hooks, scripts, and all /mem0: skills. It reads MEM0_API_KEY from your environment automatically — no extra config needed.

What’s Included

ComponentFull Plugin (A/B)MCP Only (C)
MCP Server (9 memory tools)YesYes
Lifecycle HooksYesNo
16 Slash CommandsYesNo

Available MCP Tools

ToolDescription
add_memorySave text or conversation history for a user/agent
search_memoriesSemantic search across memories with filters
get_memoriesList memories with filters and pagination
get_memoryRetrieve a specific memory by ID
update_memoryOverwrite a memory’s text by ID
delete_memoryDelete a single memory by ID
delete_all_memoriesBulk delete all memories in scope
delete_entitiesDelete a user/agent/app/run entity and its memories
list_entitiesList 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).
HookEventWhat it does
Session startSessionStartLoads prior memories and displays status banner
User promptUserPromptSubmitSearches relevant memories before each message
Pre-toolPreToolUseBlocks MEMORY.md writes, enforces user_id/app_id on mem0 tools
Post-toolPostToolUseTracks 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 your agy version, replace with your literal key in mcp_config.json

Mem0 MCP Setup

Detailed MCP configuration for all clients

OpenCode Integration

Add Mem0 memory to OpenCode workflows