Mnemotree
Mnemotree is an MCP server that provides biologically-inspired memory for LLM agents, enabling storage, retrieval, and analysis of structured knowledge with semantic search and relationship tracking.
README
🌳 Mnemotree
Memory module for LLMs and Agents with MCP
<p align="center"> <img src="assets/mnemotree-logo.png" alt="Mnemotree Logo" width="300"> </p>
Mnemotree gives LLM agents biologically-inspired memory. Store, retrieve, and analyze structured knowledge with semantic search, importance scoring, and relationship tracking. Integrates with LangChain, Autogen, and any MCP-compliant tool.
⚡ MCP Quickstart
Run mnemotree as an MCP server with zero setup:
uvx --from "git+https://github.com/kurcontko/mnemotree.git" --with "mnemotree[mcp_server]" mnemotree-mcp
Claude Desktop / Claude Code
Add to your config (claude_desktop_config.json, .mcp.json, or ~/.claude.json):
{
"mcpServers": {
"mnemotree": {
"command": "uvx",
"args": [
"--from", "git+https://github.com/kurcontko/mnemotree.git",
"--with", "mnemotree[mcp_server]",
"mnemotree-mcp"
],
"env": {
"MNEMOTREE_MCP_PERSIST_DIR": "/Users/yourname/.mnemotree/chromadb"
}
}
}
}
Codex CLI
Add to your ~/.codex/config.toml:
[mcp_servers.mnemotree]
command = "uvx"
args = [
"--from", "git+https://github.com/kurcontko/mnemotree.git",
"--with", "mnemotree[mcp_server]",
"mnemotree-mcp",
]
startup_timeout_sec = 120
env = { MNEMOTREE_MCP_PERSIST_DIR = "/Users/yourname/.mnemotree/chromadb" }
Local Development
Replace git+https://... with /path/to/mnemotree to use your local clone.
Persistence
MNEMOTREE_MCP_PERSIST_DIR controls where memories are stored. Use an absolute path for consistent storage across clients. Omit to default to .mnemotree/chromadb.
HTTP Transport (Multi-Client)
uvx --from "git+https://github.com/kurcontko/mnemotree.git" --with "mnemotree[mcp_server]" mnemotree-mcp run --transport http --port 8000
Connect MCP clients to http://localhost:8000/mcp.
🌟 Features
- Memory Types: Episodic, semantic, autobiographical, prospective, procedural, priming, conditioning, working, entities
- Storage Backends: ChromaDB, SQLite+sqlite-vec, Neo4j
- Analysis: NER, keyword extraction, importance scoring, emotional context
- Retrieval: Semantic similarity, filtering, relationship queries
- Lite Mode: CPU-only embeddings, no LLM required
🚀 Getting Started
Installation
git clone https://github.com/kurcontko/mnemotree.git && cd mnemotree
uv venv .venv && uv pip install -e ".[lite,chroma]"
For NER: uv run python -m spacy download en_core_web_sm
For OpenAI features: cp .env.sample .env and add your API key.
Basic Usage
from mnemotree import MemoryCore
from mnemotree.store import ChromaMemoryStore
store = ChromaMemoryStore(persist_directory=".mnemotree/chromadb")
memory_core = MemoryCore(store=store)
# Store
memory = await memory_core.remember(
content="User prefers Python for its readability.",
tags=["preferences", "programming"]
)
# Recall
memories = await memory_core.recall("programming languages", limit=5)
# Reflect
insights = await memory_core.reflect(min_importance=0.7)
Lite Mode (CPU, no LLM)
memory_core = MemoryCore(store=store, mode="lite")
Uses local embeddings. Set MNEMOTREE_LITE_EMBEDDING_MODEL to override.
Alternative NER backends: mnemotree[ner_hf], mnemotree[ner_gliner], mnemotree[ner_stanza]
⚙️ MCP Environment Variables
| Variable | Default | Description |
|---|---|---|
MNEMOTREE_MCP_PERSIST_DIR |
.mnemotree/chromadb |
Storage directory |
MNEMOTREE_MCP_COLLECTION |
memories |
Collection name |
MNEMOTREE_MCP_CHROMA_HOST/PORT/SSL |
— | Remote ChromaDB |
MNEMOTREE_MCP_ENABLE_NER |
false |
Enable NER |
MNEMOTREE_MCP_ENABLE_KEYWORDS |
false |
Enable keyword extraction |
MNEMOTREE_MCP_NER_BACKEND |
— | spacy, transformers, gliner, stanza |
MNEMOTREE_MCP_NER_MODEL |
— | Backend-specific model ID/path |
Avoid running multiple MCP processes against the same Chroma directory.
🔧 Storage
# ChromaDB (local)
from mnemotree.store import ChromaMemoryStore
store = ChromaMemoryStore(persist_directory=".mnemotree/chromadb")
# ChromaDB (remote)
store = ChromaMemoryStore(host="localhost", port=8000)
# Neo4j
from mnemotree.store import Neo4jMemoryStore
store = Neo4jMemoryStore(uri="neo4j://localhost:7687", user="neo4j", password="password")
🐳 Docker
# MCP server
docker compose -f docker/mcp/docker-compose.yml up --build
# ChromaDB
docker compose -f docker/chromadb/docker-compose.yml up -d
# Neo4j
docker compose -f docker/neo4j/docker-compose.yml up -d
📦 Extras
uv pip install -e ".[chroma]" # ChromaDB
uv pip install -e ".[neo4j]" # Neo4j
uv pip install -e ".[sqlite_vec]" # SQLite + sqlite-vec
uv pip install -e ".[lite]" # Local embeddings
uv pip install -e ".[ner_hf]" # Transformers NER
uv pip install -e ".[all]" # Everything
Development
make lint typecheck test
make precommit-install
💡 Examples
examples/langchain_agent.py— LangChain agent with memoryexamples/memory_chat/app.py— Streamlit chat app with persistent memory
🤝 Contributing
Contributions welcome! Fork the repo, create a branch, add tests, and submit a PR.
📝 License
MIT - see LICENSE
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。