mnemon:大模型智能体持久化记忆 - Openclaw Skills
作者:互联网
2026-03-31
什么是 mnemon?
mnemon 是一款专为大模型(LLM)智能体设计的强大持久化记忆命令行工具(CLI),旨在克服短期上下文窗口的局限。通过提供结构化的信息存储和检索方式,它允许智能体在多个会话和复杂任务中保持连续性。这一面向 Openclaw Skills 的集成将短暂的聊天记录转化为持久的知识库,使智能体能够记住用户偏好、过去的架构决策以及特定项目的见解。
从核心来看,mnemon 不仅仅是简单的存储;它还促进了语义和因果知识图谱的创建。它内置了差异比对逻辑以防止重复记忆,并自动管理冲突解决。通过利用 Openclaw Skills,开发人员可以为他们的智能体配备精细的记忆管理系统,支持自动提醒、上下文引导和智能数据压缩。
下载入口:https://github.com/openclaw/skills/tree/main/skills/grivn/mnemon
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install mnemon
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 mnemon。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
mnemon 应用场景
- 在不同的智能体对话中保留用户偏好和开发者的决策。
- 从非结构化的聊天互动和技术讨论中构建结构化知识库。
- 关联不同开发任务之间的因果关系,以提高智能体的推理能力。
- 在开始新编码任务之前,自动回溯历史背景和过去的解决方案。
- 防止关键见解在上下文窗口压缩或 Token 限制重置时丢失。
- 智能体使用 remember 命令捕捉特定的事实或见解,该命令在检查重复的同时分配类别和重要性级别。
- 系统根据相似性和基于正则表达式的因果信号,识别潜在的语义或因果关联候选对象。
- 智能体或开发者评估这些候选对象,并使用 link 命令在记忆之间建立带权重的关系。
- 在活跃的交互过程中,智能体使用 recall 或 search 函数将相关的历史数据拉取到当前上下文中。
- 集成的 Openclaw Skills 插件处理自动化的生命周期钩子(如 'remind' 和 'nudge'),使智能体专注于相关的记忆。
- 系统定期执行垃圾回收(gc),根据相似度阈值修剪低重要性或过时的记忆。
mnemon 配置指南
通过 Homebrew 安装二进制文件 (macOS/Linux):
brew install mnemon-dev/tap/mnemon
或者通过 Go 安装:
go install github.com/mnemon-dev/mnemon@latest
部署 Openclaw Skills 集成:
mnemon setup --target openclaw --yes
安装后,重启您的 OpenClaw 网关以激活钩子和插件。
mnemon 数据架构与分类体系
mnemon 使用结构化分类法组织持久化数据,以确保在 Openclaw Skills 中实现高效检索。
| 属性 | 描述 |
|---|---|
| 类别 | preference, decision, insight, fact, context |
| 边类型 | temporal, semantic, causal, entity |
| 重要性 | 从 1 (低) 到 5 (高) 的数字分级 |
| 元数据 | 用于附加上下文的自定义 JSON 对象 |
| 限制 | 单条记忆条目最大 8,000 字符 |
name: mnemon
description: "Persistent memory CLI for LLM agents. Store facts, recall past knowledge, link related memories, manage lifecycle."
metadata:
openclaw:
emoji: "??"
requires:
bins: ["mnemon"]
install:
- id: "brew"
kind: "brew"
formula: "mnemon-dev/tap/mnemon"
bins: ["mnemon"]
label: "Install mnemon (Homebrew)"
- id: "go"
kind: "go"
package: "github.com/mnemon-dev/mnemon@latest"
bins: ["mnemon"]
label: "Install mnemon (go install)"
mnemon
Install & Configure
1. Install the binary
Homebrew (macOS / Linux):
brew install mnemon-dev/tap/mnemon
Go install:
go install github.com/mnemon-dev/mnemon@latest
2. Set up OpenClaw integration
mnemon setup --target openclaw --yes
This single command deploys all components:
- Skill →
~/.openclaw/skills/mnemon/SKILL.md - Hook →
~/.openclaw/hooks/mnemon-prime/(agent:bootstrap — injects behavioral guide) - Plugin →
~/.openclaw/extensions/mnemon/(remind, nudge, compact hooks) - Prompts →
~/.mnemon/prompt/(guide.md, skill.md)
Restart the OpenClaw gateway to activate.
3. Customize (optional)
Edit ~/.mnemon/prompt/guide.md to tune recall/remember behavior.
Plugin hooks are configured in ~/.openclaw/openclaw.json:
{
"plugins": {
"entries": {
"mnemon": {
"enabled": true,
"config": {
"remind": true,
"nudge": true,
"compact": false
}
}
}
}
}
| Hook | Default | Description |
|---|---|---|
remind |
on | Recall relevant memories + remind agent on each message |
nudge |
on | Suggest remember sub-agent after each reply |
compact |
off | Save key insights before context compaction |
4. Uninstall
mnemon setup --eject --target openclaw --yes
Workflow
- Remember:
mnemon remember "" --cat --imp <1-5> --entities "e1,e2" --source agent - Diff is built-in: duplicates skipped, conflicts auto-replaced.
- Output includes
action(added/updated/skipped),semantic_candidates,causal_candidates.
- Link (evaluate candidates from step 1 — use judgment, not mechanical rules):
- Review
causal_candidates: does a genuine cause-effect relationship exist?causal_signalis regex-based and prone to false positives — only link if the memories are truly causally related. - Review
semantic_candidates: are these memories meaningfully related? Highsimilarityalone is not sufficient — skip candidates that share keywords but discuss unrelated topics. - Syntax:
mnemon link--type --weight <0-1> [--meta ' ']
- Review
- Recall:
mnemon recall "" --limit 10
Commands
mnemon remember "" --cat --imp <1-5> --entities "e1,e2" --source agent
mnemon link --type --weight <0-1> [--meta '']
mnemon recall "" --limit 10
mnemon search "" --limit 10
mnemon forget
mnemon related --edge causal
mnemon gc --threshold 0.4
mnemon gc --keep
mnemon status
mnemon log
mnemon store list
mnemon store create
mnemon store set
mnemon store remove
Guardrails
- Use the
exectool to run mnemon commands. - Do not store secrets, passwords, or tokens.
- Categories:
preference·decision·insight·fact·context - Edge types:
temporal·semantic·causal·entity - Max 8,000 chars per insight.
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
代理状态:监控支付意图和交易 - Openclaw Skills
Proxy MCP:AI 智能体支付与虚拟卡 - Openclaw Skills
Apify Ultimate Scraper: AI 网页数据抓取 - Openclaw Skills
加密诈骗检测器:实时欺诈预防 - Openclaw Skills
newsmcp: 实时 AI 新闻聚合与过滤 - Openclaw Skills
Moltbook 优化器:策略与排名精通 - Openclaw 技能
Frigate NVR:智能摄像机管理与自动化 - Openclaw Skills
Markdown 检查器:样式、链接和格式工具 - Openclaw Skills
Venice.ai 至尊路由:私密且无审查的模型路由 - Openclaw Skills
图片优化器:使用 Openclaw Skills 压缩和调整图片尺寸
AI精选
