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.