agent-memory
Persistent memory for AI coding agents. Single binary. Zero setup. Instant search.
接入你的智能体
从发布者处安装。不是 PlugMCP 端点。
远程 URL 还是本机命令? 两种安装方式的区别
AI agents forget everything between sessions. You repeat context, re-explain decisions, re-describe architecture. agent-memory fixes this -- it gives your agent a persistent, searchable memory backed by a single SQLite file.
go install github.com/dklymentiev/agent-memory@latest
Every time you start a new Claude Code session, your agent starts from scratch:
# Save a decision once
agent-memory add "Auth uses JWT refresh tokens, 15min access / 7d refresh" \
-t type:decision -t topic:auth
# Agent finds it when relevant
agent-memory search "authentication tokens"
# Or get smart context automatically at session start
agent-memory context
One binary. One SQLite file. No Docker. No external database. No configuration required.
Search that works -- FTS5 full-text search with BM25 ranking. Optional hybrid search with local ONNX embeddings or OpenAI (30% keyword + 70% semantic). Finds what you need even with different wording. Local embeddings require zero API keys and zero internet.
Workspaces -- isolate memories per project. agent-memory focus backend-api and everything stays separate.
MCP server -- 14 tools for Claude Code, Cursor, or any MCP-compatible agent. One command to set up: claude mcp add agent-memory -- agent-memory mcp
Auto-capture hooks -- automatically saves tool outputs and user prompts from Claude Code sessions. Sensitive data (passwords, API keys, tokens, JWTs) is scrubbed before storage.
Smart context -- progressive disclosure system assembles the right context for each session: pinned memories first, then recent, then search results -- all within a token budget.
Also: auto-tagging, markdown-aware chunking, content dedup (SHA-256), prompt templates, timeline view, JSON/Markdown export, prompt injection protection.
# Add memories
agent-memory add "Use snake_case for Python, camelCase for TypeScript" \
-t type:decision -t topic:style
# Search
agent-memory search "naming conventions"
# Switch workspace
agent-memory focus my-project
# Get session context (pinned + recent + relevant)
agent-memory context
# Pipe files into memory
cat ARCHITECTURE.md | agent-memory add -f - -t type:artifact --pin
By default, agent-memory uses FTS5 keyword search. Enable embeddings for hybrid search (30% keyword + 70% semantic) that understands meaning, not just exact words.
Local embeddings (recommended) -- runs entirely on your machine, no API keys, no internet after setup:
agent-memory embeddings enable --local
# Downloads ONNX Runtime (~8MB) and all-MiniLM-L6-v2 model (~87MB)
# Everything stored in ~/.agent-memory/
OpenAI embeddings -- higher quality, requires API key:
export OPENAI_API_KEY=sk-...
agent-memory embeddings enable --openai
Once enabled, search automatically uses hybrid mode:
agent-memory search "authentication flow" # hybrid: FTS + semantic
agent-memory search "auth" --fts # force keyword-only
agent-memory search "how do users log in" --semantic # force semantic-only
# One-liner setup
claude mcp add agent-memory -- agent-memory mcp
Or add to .mcp.json in your project:
{
"mcpServers": {
"agent-memory": {
"command": "agent-memory",
"args": ["mcp"]
}
}
}
14 MCP tools available: memory_add, memory_search, memory_context, memory_list, memory_focus, memory_delete, memory_update, memory_stats, memory_timeline, memory_save_prompt, memory_get_prompt, memory_suggest_tags, memory_session_start, memory_session_end.
See docs/guide.md for details on each tool.
Auto-capture context from coding sessions:
{
"hooks": [
{"event": "PostToolUse", "command": "agent-memory hook post-tool-use", "timeout": 5000},
{"event": "SessionStart", "command": "agent-memory hook session-start", "timeout": 5000},
{"event": "UserPromptSubmit", "command": "agent-memory hook user-prompt-submit", "timeout": 5000},
{"event": "SessionEnd", "command": "agent-memory hook session-end", "timeout": 5000}
]
}
Hooks scrub sensitive data (passwords, API keys, tokens, JWTs, private keys) and protect against prompt injection.
agent-memory is designed for personal/small-team use with AI coding agents. If you need a production vector database for millions of documents, use ChromaDB or Pinecone. If you want something that works in 10 seconds with zero infrastructure, this is it.
See SECURITY.md for full details.
All data in one file:
~/.agent-memory/memory.db # default (global)
.agent-memory/memory.db # per-project (via agent-memory init)
agent-memory --db /path/to/my.db # custom path
git clone https://github.com/dklymentiev/agent-memory.git
cd agent-memory
make build # builds ./agent-memory
make test # runs tests
make install # copies to /usr/local/bin
Requires Go 1.21+ (automatically downloads Go 1.25 toolchain).
MIT
Persistent memory for AI coding agents. Single binary, instant full-text search, workspaces, MCP server.
工具
暂无工具列表。远程服务器在首次健康检查后会获得工具列表。
常见问题
在本页复制适用于 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 配置。它使用发布者的安装方式,而不是 PlugMCP 代理。
此记录未列出必需的环境变量。
Agent Memory 通过 stdio 在本地运行。
上次检查时间:2026-10-28。 Persistent memory for AI coding agents. Single binary, instant full-text search, workspaces, MCP server.