agent-memory-hub
Enables AI agents to store, search, and retrieve long-term memories with BM25 full-text search, auto-tagging, and importance scoring.
README
agent-memory-hub
Persistent, intelligent, searchable long-term memory for AI agents.
Store facts, preferences, notes, and project context. Retrieve them with full-text BM25 search, importance scoring, and recency weighting. No API keys. No external servers. Works out of the box.
Features
- 7 powerful tools — store, search, retrieve context, update, list, forget, summarize
- BM25 full-text search — proper ranked search with IDF, not just string matching
- Auto-tagging — automatically infers categories (preference, project, technical, task, credential, etc.)
- Auto importance scoring — detects urgency signals in content
- Recency + importance weighting — more relevant memories surface first
- Atomic writes — corruption-safe file persistence
- Zero dependencies — only the MCP SDK; no native binaries, no Python, no Docker
- Configurable storage — override path with
AGENT_MEMORY_DIRenv var
Installation
1. Clone and build
git clone https://github.com/yourname/agent-memory-hub
cd agent-memory-hub
npm install
npm run build
2. Add to Claude Desktop
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"agent-memory-hub": {
"command": "node",
"args": ["C:\\Users\\HP\\agent-memory-hub\\build\\index.js"]
}
}
}
3. Add to Claude Code (MCP CLI)
claude mcp add agent-memory-hub -- node "C:\Users\HP\agent-memory-hub\build\index.js"
Custom storage directory
{
"mcpServers": {
"agent-memory-hub": {
"command": "node",
"args": ["C:\\Users\\HP\\agent-memory-hub\\build\\index.js"],
"env": {
"AGENT_MEMORY_DIR": "C:\\Users\\HP\\my-agent-memories"
}
}
}
}
Default storage: ~/.agent-memory/memories.json
Tools
store_memory
Store any piece of information worth remembering.
key: "user_preferred_language"
content: "User always prefers TypeScript over JavaScript"
tags: ["preference", "technical"] ← auto-detected if omitted
importance: 7 ← auto-scored if omitted
search_memory
BM25 full-text search across all memories.
query: "typescript preferences"
limit: 5 ← optional, default 5
tags: ["technical"] ← optional filter
get_relevant_context
Auto-retrieve the best memories for a given query. Use this at session start.
user_query: "Help me set up the project authentication"
→ Returns: identity memories, project memories, technical preferences
update_memory
Modify existing memory content, tags, or importance.
key: "user_preferred_language"
new_content: "User prefers TypeScript, but accepts Python for scripts"
importance: 8
list_memories
Browse memories with sorting and filtering.
tags: ["project"]
sort: "importance" ← "recent" | "importance" | "access"
limit: 10
forget_memory
Permanently delete a memory.
key: "old_api_key"
memory_summary
Get a full overview — counts, top tags, most important and most accessed memories.
Storage Format
Memories are stored as plain JSON at ~/.agent-memory/memories.json. Human-readable, easy to backup or inspect.
{
"version": "1.0.0",
"created": "2025-01-01T00:00:00.000Z",
"lastUpdated": "2025-06-01T12:00:00.000Z",
"memories": [
{
"id": "uuid",
"key": "user_preferred_language",
"content": "User prefers TypeScript over JavaScript",
"tags": ["preference", "technical"],
"importance": 7,
"createdAt": "...",
"updatedAt": "...",
"accessCount": 12,
"lastAccessed": "..."
}
]
}
Auto-Tagging Categories
The system auto-detects these categories from content:
| Tag | Trigger signals |
|---|---|
preference |
prefer, like, love, hate, favorite, avoid |
project |
project, working on, building, repository |
identity |
I am, my name, I work, my role |
technical |
code, api, database, framework, docker |
task |
todo, must, deadline, remind |
credential |
password, secret, token, api key |
note |
note, remember that, fyi, heads up |
person |
name is, email, phone, contact |
config |
config, setting, env var, port, url |
Development
npm run dev # watch mode
npm run build # production build
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。