智能体自主套件
让AI主动持续工作
AgentMemory 为 AI 智能体提供跨会话的持久化记忆能力,支持事实记录、经验学习与实体追踪三类核心功能。
安装指令
clawdhub install agent-memory
基础调用
from src.memory import AgentMemory
mem = AgentMemory()
# 记录事实
mem.remember("重要信息", tags=["类别"])
# 学习经验
mem.learn(
action="执行的操作",
context="情境描述",
outcome="positive", # 或 "negative"
insight="获得的认知"
)
# 回忆内容
facts = mem.recall("搜索关键词")
lessons = mem.get_lessons(context="主题")
# 追踪实体
mem.track_entity("名称", "person", {"role": "工程师"})
数据库配置
默认路径:~/.agent-memory/memory.db;自定义路径初始化:AgentMemory(db_path="/自定义路径/memory.db")
见下方输入与输出表格。
| 项目 | 内容 |
|---|---|
| 输入 | 文本事实、经验五元组(action/context/outcome/insight)、实体信息(name/type/attributes)、搜索关键词、过滤标签、数量限制 |
| 输出 | 事实列表、经验记录(含正负标记)、实体详情、数据库状态 |
| 适用人群 | 构建长期记忆对话系统的开发者、金融日志分析工程师、客户关系管理产品经理 |
| 不包含 | 分布式同步、自动摘要、外部向量库集成、可视化界面 |
原始链接:https://github.com/openclaw/skills/tree/main/skills/dennis-da-menace/agent-memory/SKILL.md
来源类型:GitHub 仓库