agent-memory
Provides an optional Telegram bridge for agent chat, storing a bot token, running and pairing the bridge, and letting agents send short messages to the user's phone through Telegram.
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
Local memory for AI coding agents. An MCP server that gives Claude Code, Cursor and any other MCP client a shared memory across sessions: hybrid search over notes and past conversations, a knowledge graph, a code graph, a web UI and a small CLI (amx). Everything is stored on your machine in ~/.agent-memory/.

Features
Master context: a short briefing per project that a new session loads first, plus session handoffs (in progress, next steps, blockers).
Hybrid search: BM25 and local embeddings fused with reciprocal rank fusion, weighted by source and recency.
Conversation ingest: reads Claude Code transcripts (
~/.claude*/projects/) and curated memory notes into the store.Knowledge graph: typed entities and labeled links.
Code graph: imports, exports, routes, models and env vars of a repo, with an optional file watcher (
watcher/) that keeps it fresh.Web UI: live knowledge map, ranked search with a Cmd-K palette, memory editor, sessions and briefing, agent chat, code graph, health and the key vault.
Agent chat: agents on the same machine send each other short messages (
amx msg), with an optional Telegram bridge to your phone.Key vault: API keys in the macOS Keychain, filed by project, injected into commands as env vars.
Related MCP server: mcp-vector-memory
Install
Needs Bun and Node.js 20+.
git clone https://github.com/kumard3/agent-memory
cd agent-memory
bun install
bun run buildamx search and amx pattern also need ripgrep and ast-grep on your PATH.
MCP config
Claude Code:
claude mcp add agent-memory -- node /path/to/agent-memory/dist/index.jsCursor or any other MCP client:
{
"mcpServers": {
"agent-memory": {
"command": "node",
"args": ["/path/to/agent-memory/dist/index.js"]
}
}
}dist/index.js is a small stdio front. It starts the real server on the first request and stops it after 10 idle minutes, so an idle session holds about 16 MB. Change the delay with AGENT_MEMORY_IDLE_MS (0 keeps it running).
SKILL.md tells an agent when to call memory_context, memory_store, memory_query and memory_session_end. Copy it into your agent's skills or instructions.
MCP tools
Tool | What it does |
| Load the project briefing. Call it first. |
| Save knowledge, search it |
| Link entities, read the graph |
| Remove or tidy entries |
| Save a handoff and refresh the briefing |
| Pull in Claude Code transcripts and memory notes |
| Turn a transcript into memories (uses the |
| Maintenance |
| Build and query the code graph |
| Text or structural code search, repo map by import rank |
| Save a key, list key names (values never returned) |
Web UI
bun run ui
# http://127.0.0.1:41999 (change with AGENT_MEMORY_UI_PORT)Binds to localhost only.
To try it on fake data without touching your own store:
scripts/demo-ui.sh
# seeds a demo store in $TMPDIR on first run, then serves http://127.0.0.1:41997amx CLI
bun link # puts amx on your PATH, or run: bun src/cli.ts <cmd>
amx map --focus billing --max-tokens 300 # repo map ranked by imports
amx query invoice # code graph lookup
amx search "ctx.db.invoice" --max 5 # ripgrep
amx pattern 'ctx.db.$M.findMany($$$)' --lang ts
amx msg send claude-main codex-web "pushed feat/x, need a review" --project myapp
amx msg inbox codex-web
printf %s "$TOKEN" | amx key set myapp STRIPE_SECRET_KEY --note "test mode"
amx key env myapp -- npm run dev # runs with the keys as env varsRun amx, amx msg, amx key or amx tg for full help.
Telegram bridge (optional): store TELEGRAM_BOT_TOKEN with amx key set agent-memory TELEGRAM_BOT_TOKEN, run amx tg run, then pair with amx tg pair. Agents reach you with amx msg send <id> <owner> "text", where the owner id is $AMX_OWNER (default owner).
Numbers
Measured on an Apple Silicon Mac:
Idle MCP server: 16 MB.
Warm search: about 0.08 s on a store with 105k memories.
Code graph query: 0.2 s.
Privacy
Runs fully local and works offline. The embedding model downloads once from Hugging Face on first use and is cached in
~/.agent-memory/models. After that nothing leaves your machine, except the optional Telegram bridge andmemory_distill_session(which calls theclaudeCLI).The key vault stores values in the macOS Keychain (macOS only). The UI and MCP tools can write keys and list names, but never send values over HTTP or MCP.
Environment
Variable | Default | Purpose |
|
| Web UI port |
|
| Idle time before the server stops |
|
| Embedding model |
| off |
|
| folder name | Default project for |
|
| Your id in agent chat, reserved for the Telegram bridge |
Development
bunx tsc --noEmit
bun src/msg.ts && bun src/tg.ts && bun src/vault.ts
bun scripts/ui-check.ts # and the other scripts/*-check.tsscripts/eval.ts measures retrieval (recall@K, MRR) against a query set, for example HOME=<demo-home> bun scripts/eval.ts live eval/demo-eval.json.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Shared, scoped, reviewable team memory for AI coding agents.
Project memory, documentation and controlled secret access for AI coding agents.
One shared brain for your AI coding agents: team memory, agent Q&A, tasks, and file claims.
Related MCP Servers
- AlicenseCqualityBmaintenanceProvides persistent, local-first memory with knowledge graph and hybrid search for AI coding agents, reducing token usage by storing decisions, patterns, and codebase context.2938 PyPI10MIT
- AlicenseNot gradedqualityCmaintenanceGives multiple AI coding agents a shared, persistent memory by indexing your code and documentation into a vector database with AST-aware chunking and hybrid semantic/keyword search. Agents can search across projects and store, update, or forget decisions, conventions and lessons learned, all self-hosted with local embeddings.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to read and write persistent, local-first memory across sessions and projects, with semantic search, global guidelines, and optional autonomous task execution.-
- FlicenseNot gradedqualityAmaintenanceProvides AI coding agents with a local-first persistent memory layer they can read and write during sessions, storing decisions, preferences, error patterns, and research per project or globally. Enables semantic and keyword search, formatted context recall, and cross-project guideline surfacing without API keys or cloud storage.-