Google Antigravity Memory
Automatic long-term memory for Google Antigravity — AGY, the AGY IDE, and the AGY CLI: one degit command installs a full plugin bundle whose lifecycle hooks inject recalled context and capture every exchange, with the MemorySync MCP server, four skills, and an always-on recall rule. Node hooks: native on Windows, macOS, and Linux.
What the plugin provides
| Layer | What it does |
|---|---|
| Hooks (recall + capture) | SessionStart injects your profile and project context; UserPromptSubmit recalls per prompt and persists your message in a detached process; Stop captures the reply with tolerant extraction. Dependency-free Node scripts with per-hook timeouts and exit-0 discipline. |
| MCP servers | The full MemorySync memory server (API key via ${MEMORYSYNC_API_KEY} interpolation, or OAuth via Antigravity’s dynamic client registration) plus the zero-auth docs server. |
| Skills + rule | Four skills (memory conventions, remember, recall, status) auto-discovered at session start, and an always-on rule that keeps recall alive through the MCP tools. |
| Plugin bundle | Antigravity’s own format — plugin.json, mcp_config.json, hooks.json, skills/, rules/ — one folder, one install command. |
| Mem0 | Supermemory | Zep | MemorySync | |
|---|---|---|---|---|
| Antigravity integration exists | ✓ plugin | ✗ generic MCP only | ✗ Composio bridge only | ✓ plugin |
| Hooks run natively on Windows | ✗ bash-only — on a platform whose IDE ships for Windows | — | — | ✓ Node on all three OS |
Correct serverUrl config documented | ✓ | ✗ their snippet uses url — Antigravity reads serverUrl | — | ✓ with the trap called out |
| Uninstall actually documented | ✗ cache dirs never mentioned | — | — | ✓ including the MCP cache directories |
| Session-safe failure contract | ❌ \|\| true shell guards | — | — | ✓ every script exits 0 on every path, tested |
Install
# 0. Get an API key at https://app.memorysync.io, then:# macOS/Linux: export MEMORYSYNC_API_KEY=ms_...# Windows: setx MEMORYSYNC_API_KEY ms_...# A. Full plugin (hooks + skills + rule + MCP), all workspaces:npx degit Rafay121/memorysync-plugins/antigravity ~/.gemini/config/plugins/memorysync# then restart Antigravity. Workspace-scoped instead:# <workspace>/.agents/plugins/memorysync# B. MCP only — Settings → Customizations → Installed MCP Servers →# Add MCP → View raw config (or edit ~/.gemini/config/mcp_config.json):# { "mcpServers": { "memorysync": {# "serverUrl": "https://mcp.memorysync.io/mcp",# "headers": { "X-API-Key": "${MEMORYSYNC_API_KEY}" } } } }
Antigravity’s remote-server field is `serverUrl` — not url; configs copied from other tools’ docs silently fail on this. Drop the headers block to sign in with OAuth instead (Antigravity registers itself dynamically and opens the browser). Hooks require Node.js ≥ 18 on PATH. The AGY CLI manages servers with /mcp in the prompt panel.
What runs when
| Moment | What happens |
|---|---|
| Session start | Recalls your profile and this project’s context, injected as additional context. |
| Every prompt (≥ 24 chars) | Recalls memories relevant to the prompt; persists your message in a detached process — zero added latency. |
| Reply finishes (Stop) | Persists the reply with tolerant extraction: documented fields first, a bounded transcript-tail parse second, silent skip otherwise. |
| Any failure — no key, network down, monthly quota exhausted | Silent skip, exit 0. Memory can never break an Antigravity session, by contract and by test. |
# Same operation as the hooks perform, shown as the raw MemorySync REST call(s).## Turns store under the antigravity:: transcript scope — separate from# your Claude Code, Cursor, Codex, OpenCode and Devin transcripts, same# shared memories everywhere.curl --request POST https://api.memorysync.io/v1/memory/add_turn \--header "X-API-Key: $MEMORYSYNC_API_KEY" \--header "Content-Type: application/json" \--data '{"tenant_id":"acme","user_id":"rafay","source":"antigravity","text":"human: switch the dashboard to teal","speaker":"human@antigravity::demo-project#h<content-hash>","metadata":{"session_id":"antigravity::demo-project"}}'
Identity and scope resolve like every MemorySync surface: MEMORYSYNC_USER_ID (default: OS username), project from the git remote — worktree-aware — with MEMORYSYNC_PROJECT override.
Uninstalling cleanly
Removing the plugin folder or the MCP entry is not enough for AGY and the AGY IDE — they cache MCP servers on disk. Also delete the cache directories: ~/.gemini/antigravity/mcp/memorysync/, ~/.gemini/antigravity-ide/mcp/memorysync/, and ~/.gemini/antigravity-cli/mcp/memorysync/. The AGY CLI notices removals fastest. No other memory vendor documents this.
Supported versions
| Surface | Requires | Verified on |
|---|---|---|
memorysync Antigravity plugin 1.0.0 | Antigravity 2.0+ (AGY / AGY IDE / AGY CLI), Node.js 18+ | Hook contract suite 43/43 — antigravity platform shapes, both monthly-quota server modes, and a bundle-integrity test that fails CI if the bundle ever drifts from the tested scripts |
The hook payloads follow the Claude-shaped contract Mem0’s plugin also relies on (their scripts literally set CLAUDE_PLUGIN_ROOT); if Antigravity ever drops those events, the documented PreInvocation/injectSteps path is the fallback and every script already exits 0 regardless.