agent-memory-mcp
Provides a Google Antigravity plugin bundle that enables zero-turn SessionStart context hydration and scoped agent rules, integrating persistent project memory into Antigravity.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
agent-memory-mcp
Persistent, per-project architectural memory, SQLite FTS5 search, file-anchored invariants, and anti-loop dead-end tracking for AI coding agents.
Works with Google Antigravity, Claude Code, Cursor, Windsurf, Cline, and any MCP-compatible environment.
โก The Problem
AI coding agents suffer from session amnesia and debugging loops:
When a chat session terminates or context is compacted, the agent forgets project patterns, architectural decisions, and setup instructions.
When encountering errors, agents often repeatedly attempt the same failing fix because past failure context is lost.
Most memory tools require heavy external services (Docker, Python, remote vector databases) or pollute project git roots with flat markdown files that cause merge conflicts.
Related MCP server: @renzynx/memory-mcp
โจ Features
๐ Zero External Database Setup: Built directly on Node.js 22.5+/24+ native
node:sqlitein WAL mode. No Docker, no Python, no native compilation dependencies.๐ Ranked Full-Text Search (FTS5): Weighted BM25 search across titles, summaries, tags, and files with contextual snippets and Porter stemming.
๐ก๏ธ Anti-Loop Dead-End Registry: Dedicated tools (
record_dead_end/check_dead_ends) to record failed debugging attempts so future agents never repeat known bugs.๐ Code-Anchored Context & Staleness Detection: Links notes to specific workspace files; warns the agent if referenced code was modified on disk after the memory was saved.
๐งน Clean Git Hygiene: Stores per-project SQLite databases centrally in
~/.ag-memory-mcp/stores/, keeping your repository working tree 100% clean.๐ Zero-Data-Loss JIT Migration: Automatically detects, validates, and migrates legacy
.ag-memory.jsonfiles on first project open, creating verified backup archives.โก Sub-25ms Startup & Low RAM: Cold starts in milliseconds with ~35MB RAM footprint, suitable for synchronous startup hooks.
๐๏ธ Architecture
flowchart LR
subgraph Clients["AI Clients & Editors"]
AG["Google Antigravity"]
CC["Claude Code"]
CU["Cursor / Windsurf"]
end
subgraph MCP["agent-memory-mcp Engine"]
Server["MCP Server (JSON-RPC)"]
Hook["SessionStart Hook"]
Migrator["Zero-Loss JIT Migrator"]
end
subgraph Storage["Central Data Vault (~/.ag-memory-mcp)"]
DB[("project-*.db<br/>(SQLite WAL + FTS5)")]
Index["projects_index.json"]
Backups["backups/"]
end
Clients <-->|"stdio"| Server
AG -.->|"SessionStart"| Hook
Server --> Migrator
Migrator --> Backups
Server <--> DB
Server <--> Index๐ Quickstart
1. Claude Code
Add to your Claude Code configuration with one command:
claude mcp add agent-memory-mcp -- npx -y agent-memory-mcp2. Cursor / Windsurf / Cline
Add to your mcpServers configuration (e.g. ~/.cursor/mcp.json or cline settings):
{
"mcpServers": {
"agent-memory-mcp": {
"command": "npx",
"args": ["-y", "agent-memory-mcp"]
}
}
}3. Google Antigravity (Plugin Bundle)
Install the plugin into your Antigravity plugins directory (~/.gemini/config/plugins/agent-memory/):
git clone https://github.com/msking18/agent-memory-mcp.git ~/.gemini/config/plugins/agent-memoryRestart Antigravity. The plugin enables zero-turn SessionStart context hydration and scoped agent rules automatically.
๐ ๏ธ MCP Tools (10 Tools)
Tool | Mode | Description |
| Read-only | 1-shot check returning initialization state, architecture TOC, dead-end count, and recent session timeline in a single call. |
| Read-only | Chronological feed filterable by |
| Write/Upsert | Single or atomic batch ( |
| Read-only | Weighted FTS5 BM25 search across |
| Read-only | Reads single |
| Write | In-place partial update to |
| Write | Soft-archives obsolete memories ( |
| Write | Logs |
| Read-only | Searches recorded dead-ends by error message, keyword, or |
| Read-only | Returns all memories and dead-ends anchored to target |
๐ฆ MCP Resources
memory://projects: Exposes a read-only JSON registry of all workspaces tracked byagent-memory-mcpon your machine.
๐ Recommended Agent Rule Template
Add this rule to your agent's system prompt or AGENTS.md / CLAUDE.md:
### Rule: Persistent Project Memory & Anti-Looping
1. Startup: When starting work on a workspace, call `check_memory_status` with the absolute project directory.
2. Bootstrap: If UNINITIALIZED, explore the codebase and save 3 foundational nodes atomically via `save_project_memory`:
- "Tech Stack & Ecosystem" (slug: "tech-stack", category: "architecture")
- "Project Structure & Architecture" (slug: "project-structure", category: "architecture")
- "Build & Run Instructions" (slug: "build-run", category: "architecture")
3. Before Editing Shared Utilities: Call `get_file_memories` with the file paths about to be edited.
4. Error Anti-Looping: Before retrying a failed test, build, or terminal command, call `check_dead_ends`. If a fix fails, record it via `record_dead_end`.
5. Session Log: At the end of a major task, log changes via `save_project_memory` (category: "session", tags: ["changelog"]).๐งช Testing
Run the automated test suite across SQLite transactions, FTS5 queries, JIT migrations, and stdio JSON-RPC:
npm test๐ License
MIT ยฉ Manveer Singh Kahlon
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Persistent, portable memory for AI assistants โ your private memory graph, from any MCP client.
Related MCP Servers
- AlicenseAqualityCmaintenanceA local-first MCP server for durable agent memory using SQLite and FTS5, enabling knowledge graph storage, search, and recall for AI agents.201MIT
- AlicenseAqualityDmaintenancePersistent memory MCP server with FTS5 fuzzy search, storing data in SQLite with automatic maintenance and token-efficient TOON output.320 npm1MIT

hive-memoryofficial
AlicenseNot gradedqualityDmaintenanceMCP server for personal and shared memory with full-text search (SQLite FTS5) and outcome tracking, compatible with any MCP agent like Claude Code, Cursor, and Codex CLI.3 npmMIT- AlicenseNot gradedqualityDmaintenanceLocal MCP server for persistent, searchable agent memory using SQLite FTS5, replacing flat MEMORY.md files with efficient full-text search and workspace context caching.GPL 3.0