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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.