neural-memory
NeuralMemory
你的 AI 智能体在会话之间会忘记一切。Neural Memory 为它赋予大脑。
记忆以相互连接的神经元形式存储,并通过扩散激活来回忆——这与人类大脑的工作方式相同。无需向量数据库。无需 API 调用。无需每月嵌入费用。
pip install neural-memory重启你的 AI 工具。你的智能体现在能记住了——无需 init,MCP 服务器会在首次使用时自动初始化。
已经安装了? nmem update 可原地升级,并自动检测你是通过 pip 还是从源码安装的。nmem update --check 仅报告可用的更新。
CLI 命令是
nmem(或更长的neural-memory)。没有nm这个二进制文件。
只有 3 个工具。
共有 63 个 MCP 工具可用,但你只需要三个:
工具 | 功能 |
| 存储记忆——自动检测类型、标签和连接 |
| 通过扩散激活回忆——相关记忆自然浮现 |
| 大脑健康评分(A–F),附可操作的修复建议 |
其他一切——会话、上下文加载、习惯追踪、维护——都在后台透明地运行。
Related MCP server: ClawMem MCP Server
与众不同之处
大多数记忆工具都是搜索引擎。Neural Memory 是一个会思考的图。
当你问"为什么周二的故障会发生?"时,向量数据库返回最相似的句子。Neural Memory 则追踪因果链:
outage ← CAUSED_BY ← JWT expiry ← SUGGESTED_BY ← Alice's review关系是显式的——CAUSED_BY、LEADS_TO、RESOLVED_BY、CONTRADICTS——因此你的智能体不只是找到记忆,而是推理它们。
基于搜索(RAG) | Neural Memory | |
检索 | 相似度评分 | 图遍历 |
关系 | 无 | 24 种显式类型 |
需要 LLM | 是(嵌入) | 否——完全离线 |
多跳推理 | 多次查询 | 一次遍历 |
记忆生命周期 | 静态 | 衰减、强化、整合 |
每 1K 次查询成本 | ~$0.02 | $0.00 |
云同步——你的数据,你的基础设施
在每台机器之间同步你的大脑。与其他记忆工具不同,我们从不存储你的数据。
Laptop ←→ Your Cloudflare Worker ←→ Desktop
↕
Your Phone你将同步中心部署到你自己的 Cloudflare 账户(免费套餐)。你的 D1 数据库、你的加密密钥、你的数据。我们提供代码——你拥有基础设施。
nmem sync # push/pull changes
nmem sync --auto # auto-sync after every remember/recall同步使用 Merkle 增量——只传输差异,而非整个大脑。快速、高效、私密。
功能特性
记忆与回忆
14 种记忆类型——事实、决策、错误、洞察、偏好、工作流、指令等
扩散激活——记忆通过关联浮现,而非关键词匹配
认知推理——提出假设、提交证据、做出预测、以贝叶斯置信度验证
工作负载预设——
nmem config preset {balanced,safe-cost,max-recall,chat-heavy}针对 SaaS、节俭模式、深度保留或对话式智能体调优大脑时间回忆——
nmem_causal暴露temporal_range和temporal_neighborhood操作;参见时间回忆配方指南
知识摄取
从文档训练——PDF、DOCX、PPTX、HTML、JSON、XLSX、CSV 被摄取为永久大脑知识
导入适配器——一条命令即可从 ChromaDB、Mem0、Cognee、Graphiti、LlamaIndex 迁移
生命周期与存储
记忆整合——情景记忆随时间成熟为语义知识
压缩层级——完整 → 摘要 → 精华 → 幽灵 → 元数据(回收存储空间,保留含义)
大脑版本控制——快照、回滚、差异比较、在脑之间移植记忆
社区
大脑商店——浏览、导入和发布预制大脑到社区市场
3 个种子大脑——Python 最佳实践、Git 工作流、Docker 要点(可直接导入)
生态系统
Web 仪表盘——7 页 React UI,包含图可视化、健康雷达、时间线、思维导图、大脑商店
VS Code 扩展——记忆树、图浏览器、CodeLens、WebSocket 同步(市场 →)
安全性——Fernet 加密、敏感内容自动检测、参数化 SQL、路径验证
Telegram 备份——将大脑
.db文件发送到 Telegram 进行异地备份
快速示例
# Store memories (type auto-detected)
nmem remember "Fixed auth bug with null check in login.py:42"
nmem remember "We decided to use PostgreSQL" --type decision
nmem todo "Review PR #123" --priority 7
# Recall
nmem recall "auth bug"
nmem recall "database decision" --depth 2
# Brain management
nmem brain list && nmem brain health
nmem brain export -o backup.json
# Sync across devices
nmem sync --full
# Web dashboard
nmem serve # http://localhost:8000/dashboardimport asyncio
from neural_memory import Brain
from neural_memory.storage import InMemoryStorage
from neural_memory.engine.encoder import MemoryEncoder
from neural_memory.engine.retrieval import ReflexPipeline
async def main():
storage = InMemoryStorage()
brain = Brain.create("my_brain")
await storage.save_brain(brain)
storage.set_brain(brain.id)
encoder = MemoryEncoder(storage, brain.config)
await encoder.encode("Met Alice to discuss API design")
await encoder.encode("Decided to use FastAPI for backend")
pipeline = ReflexPipeline(storage, brain.config)
result = await pipeline.query("What did we decide about backend?")
print(result.context) # "Decided to use FastAPI for backend"
asyncio.run(main())Neural Memory Pro
免费的 Neural Memory 功能完整——63 个工具、无限记忆、完全离线。你永远无需付费。
但超过 1 万条记忆后,情况就不同了。关键词匹配会漏掉语义相关的内容。整合会慢到分钟级。存储无限增长。如果你的智能体大脑变大了,Pro 能让它更聪明。
免费版按关键词回忆。Pro 按语义回忆。
Query: "authentication improvements"
Free (FTS5): 2 results — exact matches only
Pro (HNSW): 7 results — includes "JWT rotation", "session hardening", "OAuth migration"Pro 新增内容
免费版(SQLite) | Pro(InfinityDB) | |
回忆 | 关键词匹配(FTS5) | 语义相似度(HNSW) |
100 万神经元时的速度 | ~500ms | <5ms |
测试规模 | ~5 万神经元 | 200 万+ 神经元 |
压缩 | 文本级修剪 | 5 层向量压缩(节省 97%) |
整合 | O(N²) 暴力计算 | O(N×k) HNSW 聚类 |
每 100 万条存储 | ~5 GB | ~1 GB |
云同步 | 手动推送/拉取 | Merkle 增量(自动,仅差异) |
Pro 专属功能
锥形查询——可调节的语义回忆。收窄锥体以获得精确度,放宽以进行探索
智能合并——使用 HNSW 邻居聚类,可扩展到 100 万+ 神经元的整合
定向压缩——沿多个语义轴压缩,同时保留含义
5 层自动生命周期——记忆从 float32 → float16 → int8 → 二进制 → 元数据流动。访问时自动提升
获取 Pro
pip install neural-memory # Pro features included
nmem shared activate --key NM-PRO-XXXX-XXXX-XXXX # activate license
nmem shared status # verify: Pro: Active$9/月——30 天退款保证。所有免费工具继续可用。随时降级,保留你的数据。
Pro 快速入门 → · 完整对比 → · 定价 →
按工具设置
/plugin marketplace add nhadaututtheky/neural-memory
/plugin install neural-memory@neural-memory-marketplacepip install neural-memory添加到你的编辑器的 MCP 配置中:
{
"mcpServers": {
"neural-memory": { "command": "nmem-mcp" }
}
}技能——通过 ClawHub 一键安装。 每次发布时同步更新:
clawhub.ai/skills/neural-memory
插件——记忆槽位替代。 如果你希望 NeuralMemory 成为 OpenClaw 的记忆提供者,而非它调用的技能,请使用此方式:
pip install neural-memory && npm install -g neuralmemory在 ~/.openclaw/openclaw.json 中设置记忆槽位:
{ "plugins": { "slots": { "memory": "neuralmemory" } } }已经在使用 Neural Memory?只需激活你的密钥:
nmem shared activate --key NM-PRO-XXXX-XXXX-XXXX # activate license然后启用 InfinityDB(语义搜索引擎):
# ~/.neuralmemory/config.toml
storage_backend = "infinitydb"重启你的 MCP 服务器。现有记忆会在首次启动时自动从 SQLite 迁移到 InfinityDB。
pip install neural-memory[server] # FastAPI server + dashboard
pip install neural-memory[extract] # PDF/DOCX/PPTX/HTML/XLSX extraction
pip install neural-memory[nlp-vi] # Vietnamese NLP
pip install neural-memory[embeddings] # Local embedding models
pip install neural-memory[embeddings-openai] # OpenAI embeddings
pip install neural-memory[all] # Everything指标 | NeuralMemory | Mem0 | Cognee |
写入 50 条记忆 | 1.2s | 148.2s(慢 121 倍) | 290.6s(慢 80 倍) |
读取 20 次查询 | 1.8s | 2.9s | 34.6s |
API 调用 | 0 | 70 | 149 |
零 LLM 调用,零 API 成本。完整基准 → · 认知效率发布证据 →
文档
指南 | 描述 |
带动画演示的交互式指南 | |
开始使用 Pro 功能 | |
全部 82 条 CLI 命令 | |
全部 63 个 MCP 工具及参数 | |
多设备同步设置 | |
理解并改善大脑健康 | |
配置嵌入提供者 | |
技术设计深度解析 |
开发
git clone https://github.com/nhadaututtheky/neural-memory
cd neural-memory && pip install -e ".[dev]"
nmem doctor --dev # Verify contributor setup
pytest tests/ -v # 7800+ tests
ruff check src/ tests/ # Lint参见 CONTRIBUTING.md 获取贡献指南。
支持
如果 Neural Memory 帮助你的 AI 智能体记住了事情,请考虑给它一个 star——这有助于其他人发现这个项目,并支持持续开发。
您也可以赞助该项目。
许可证
MIT — 参见 LICENSE。
Available Tools
10 toolsnmem_autoA
Auto-extract memories from text. 'process'=analyze+save, 'flush'=emergency capture before compaction. Use at session end or when processing large text blocks.
Inputs: action (required), save, text, compact, +1 more.
nmem_contextA
Get recent memories as auto-injected context. Use for broad task context. For specific queries use nmem_recall. For project-level context use nmem_recap.
Inputs: limit, compact, fresh_only, token_budget, +2 more.
nmem_eternalA
SAVE project context, decisions, instructions that persist across sessions. Pair with nmem_recap to LOAD. Use for project-level facts, not task-specific memories.
Inputs: action (required), reason, compact, decision, +4 more.
nmem_recallA
Query memories via spreading activation. Use when you need past context, decisions, or knowledge. Depth: 0=instant lookup, 1=context (default), 2=cross-time patterns, 3=deep graph. Add tags for precision. Use nmem_context instead for broad recent context.
Inputs: query (required), mode, tags, tier, +26 more.
nmem_recapA
LOAD project context saved by nmem_eternal. Call at SESSION START to restore cross-session state. Level 1=quick (~500 tokens), 2=detailed, 3=full.
Inputs: level, topic, compact, token_budget.
nmem_rememberA
Store a memory. Auto-detects type, auto-resolves contradicted errors (RESOLVED_BY synapse). Use after completing a task, fixing a bug, or making a decision. Don't use for temporary notes (use ephemeral=true) or project context (use nmem_eternal).
Inputs: content (required), tags, tier, type, +14 more.
nmem_remember_batchA
Store multiple memories at once (max 20). Use when saving 3+ memories together. Partial success — one bad item won't block the rest.
Inputs: memories (required), compact, token_budget.
nmem_sessionA
Track current session state (task, feature, progress). Single-session only. For cross-session persistence use nmem_eternal.
Inputs: action (required), task, notes, compact, +3 more.
nmem_situationA
One-shot snapshot of the current working situation: active session task, top 3 recent decisions, open blockers, gap detection. Replaces nmem_recap + multiple nmem_recall calls when resuming a session. Pure read — never mutates state.
Inputs: compact, token_budget.
nmem_todoA
Quick TODO memory (auto-expires in 30 days). Use nmem_forget to close when done.
Inputs: task (required), compact, priority, token_budget.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
The retrieval tools (nmem_situation, nmem_recap, nmem_recall, nmem_context) and the storage tools (nmem_remember, nmem_remember_batch, nmem_todo, nmem_auto, nmem_eternal) heavily overlap, and the descriptions spend significant effort cross-referencing each other ('use nmem_context instead', 'for specific queries use nmem_recall') to compensate. The guidance is helpful but signals genuine boundary blur, so an agent can still misselect among the four recall-style tools.
All names share a uniform nmem_ prefix with lowercase snake_case, which is highly predictable. The only minor deviation is mixing action verbs (remember, recall) with noun-style names (situation, context, eternal, session), but the conventions themselves are consistent.
Ten tools is a reasonable scope for a memory server with distinct storage and retrieval concerns. It is slightly on the heavy side given the functional overlap between recall/situation/context/recap, but each still earns a roughly distinct place.
nmem_todo's description instructs the agent to 'use nmem_forget to close when done,' but no nmem_forget tool exists, creating a real dead end. There is also no delete or update/contradict-resolution tool exposed despite the surface emphasizing memory lifecycle management.
Maintenance
Related MCP Connectors
Shared long-term memory for AI agents: save and recall context as a searchable knowledge graph.
Persistent knowledge graph for AI agents. Remember, recall, and forget facts.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Graph memory for AI agents: entities, cause-effect links, cross-session recall, time travel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables LLM agents to use associative memory with key/value graph-based retrieval, supporting multi-hop traversal and human-like associative leaps beyond embedding similarity.10MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to maintain persistent, local memory with retrieval-augmented search, knowledge graphs, and context surfacing, without any cloud dependencies.MIT
- AlicenseNot gradedqualityBmaintenanceEnables persistent, graph-based memory for AI agents, allowing them to store, traverse, and recall relationships between facts, decisions, and context across sessions for efficient reasoning and reduced token usage.MIT
- AlicenseBqualityDmaintenanceProvides persistent knowledge graph memory for AI agents with local semantic search using Neo4j and ONNX embeddings, enabling offline operation with zero API costs.1732 npmMIT