NEXO Brain — Cognitive Memory for Your Agent
NEXO Brain gives your agent persistent memory modeled after human cognition. It remembers across sessions, learns from mistakes, naturally forgets what's irrelevant, and builds a trust-based relationship with you.
Setup
If your OpenClaw client shows an install action for this skill, use that first. It installs the nexo-brain package via your configured Node package manager.
If you are setting it up manually, install the cognitive engine:
CODEBLOCK0
After NEXO Brain is installed, add the MCP server to your OpenClaw config (~/.openclaw/openclaw.json):
CODEBLOCK1
Restart the gateway: INLINECODE2
What You Get
Key MCP capabilities include:
- - Cognitive Memory — RAG-powered semantic search, trust scoring, sentiment detection, cognitive dissonance resolution
- Guard System — Checks "have I made this mistake before?" before every code change
- Episodic Memory — Change logs, decision logs with reasoning, session diaries for continuity
- Learnings — Error patterns and prevention rules, searchable by category
- Session Management — Startup, heartbeat, multi-session coordination
- Reminders & Followups — Track user tasks and system verification tasks separately
- Entities & Preferences — Remember people, services, URLs, and observed user preferences
- Backup & Evolution — SQLite backup with retention, self-improvement proposals
How Memory Works
NEXO implements the Atkinson-Shiffrin memory model (1968):
- 1. Sensory Register — Raw capture, 48h retention
- Short-Term Memory — 7-day half-life, promoted if used frequently
- Long-Term Memory — 60-day half-life, semantic search by meaning
Memories naturally decay via Ebbinghaus forgetting curves. Accessing a memory reinforces it. Automated "sleep cycles" consolidate, prune, and merge memories.
Key Tools
| Tool | When to Use |
|---|
| INLINECODE3 | Once at session start — registers session, returns active sessions |
| INLINECODE4 |
Every interaction — updates task, checks inbox |
|
nexo_cognitive_retrieve | Semantic search across all memories |
|
nexo_guard_check | Before editing code — checks for past errors |
|
nexo_learning_add | After resolving an error — prevents recurrence |
|
nexo_session_diary_write | Before closing session — enables continuity |
|
nexo_cognitive_trust | After user feedback — calibrates rigor level |
Privacy
Everything stays local. Two SQLite databases in ~/.nexo/. No telemetry, no cloud APIs. Vector search runs on CPU via fastembed.
More Info
NEXO Brain — 为你的智能体赋予认知记忆
NEXO Brain 为你的智能体提供持久化记忆,模拟人类认知机制。它能跨会话记忆、从错误中学习、自然遗忘无关信息,并与你建立基于信任的关系。
安装
如果你的 OpenClaw 客户端显示此技能的安装操作,请优先使用该方式。它会通过你配置的 Node 包管理器安装 nexo-brain 包。
如果你要手动安装,请安装认知引擎:
bash
npx nexo-brain
NEXO Brain 安装完成后,将 MCP 服务器添加到你的 OpenClaw 配置(~/.openclaw/openclaw.json)中:
json
{
mcp: {
servers: {
nexo-brain: {
command: python3,
args: [~/.nexo/server.py],
env: {
NEXO_HOME: ~/.nexo
}
}
}
}
}
重启网关:openclaw gateway restart
功能概览
核心 MCP 能力包括:
- - 认知记忆 — 基于 RAG 的语义搜索、信任评分、情感检测、认知失调解决
- 防护系统 — 每次代码变更前检查我之前犯过这个错误吗?
- 情景记忆 — 变更日志、带推理的决策日志、用于连续性的会话日记
- 学习记录 — 错误模式与预防规则,可按类别搜索
- 会话管理 — 启动、心跳、多会话协调
- 提醒与跟进 — 分别追踪用户任务和系统验证任务
- 实体与偏好 — 记住人物、服务、URL 以及观察到的用户偏好
- 备份与进化 — 带保留策略的 SQLite 备份、自我改进提案
记忆工作原理
NEXO 实现了 Atkinson-Shiffrin 记忆模型(1968):
- 1. 感觉寄存器 — 原始捕获,保留48小时
- 短期记忆 — 7天半衰期,频繁使用则提升
- 长期记忆 — 60天半衰期,按含义进行语义搜索
记忆通过艾宾浩斯遗忘曲线自然衰减。访问记忆会强化它。自动睡眠周期会整合、修剪和合并记忆。
关键工具
| 工具 | 使用时机 |
|---|
| nexostartup | 会话开始时使用一次 — 注册会话,返回活跃会话 |
| nexoheartbeat |
每次交互时使用 — 更新任务,检查收件箱 |
| nexo
cognitiveretrieve | 跨所有记忆进行语义搜索 |
| nexo
guardcheck | 编辑代码前使用 — 检查过往错误 |
| nexo
learningadd | 解决错误后使用 — 防止再次发生 |
| nexo
sessiondiary_write | 关闭会话前使用 — 实现连续性 |
| nexo
cognitivetrust | 用户反馈后使用 — 校准严谨程度 |
隐私保护
所有数据本地存储。两个 SQLite 数据库位于 ~/.nexo/。无遥测,无云端 API。向量搜索通过 fastembed 在 CPU 上运行。
更多信息