* feat(integrations): add ZCode memory plugin Package ReMe lifecycle hooks, MCP tools, and the reme-memory skill as an installable ZCode plugin. The hook queues completed turns locally and retries delivery from later sessions so transient service failures do not lose memory. * fix(zcode): resolve pre-commit failures without blocking delivery * fix(zcode): honor disabled memory, keep one prompt copy, document setup Address the review on the ZCode integration: - config.example.json ships an empty api_url so the default single-port deployment is derived from mcp_url instead of pointing at a port the default `reme start` does not open. - remember_prompt writes a single cache record per turn: a payload without a turn ID is read back from latest.json, so the extra hashed copy left plaintext prompt text behind after the turn was delivered. - flush_worker re-reads auto_memory before delivering and leaves pending files untouched when recording was disabled mid-flight; it also uses a worker.rerun marker so a delivery request arriving while another pass holds the lock triggers a rescan instead of being dropped. - README/README_ZH now follow the Qoder guide: dependency install, model credentials, an executable `reme start` with an explicit workspace, platform-specific commands, empty-api_url derivation, the memory_interval example vs default, MCP reconnect after endpoint changes, a health_check/version check before the memory test, and a qualified statement about the async hook field and the detached worker. - Regression tests cover all four behaviors. Co-Authored-By: Claude Code <noreply@anthropic.com> * docs(zcode): state the verified ZCode build Name the build the plugin was verified on and the reason compatibility rests on payload fields rather than a version number. Co-Authored-By: Claude Code <noreply@anthropic.com> * test(zcode): name unused flush_all config with an underscore * fix(zcode): make worker handoff race-safe and honor the recording switch The rerun marker was written only after a failed lock acquisition, so a contender suspended between the failed acquire and the marker write left a queued session and a marker with no worker to process them. The worker now publishes its request before contending for the lock, which leaves exactly two outcomes: the owner sees the marker and scans again, or the lock is free and this worker delivers itself. worker.rerun also dropped force semantics, so a SessionStart force request lost to a Stop owner whose rerun pass then stayed non-forced. A separate, never downgraded worker.force marker keeps the stronger request until the next pass. The auto_memory switch was checked once at worker entry and the snapshot reused for every batch, so disabling recording during a run still submitted later batches. The switch is now rechecked before every network submission and unsent queue files are preserved when it is disabled. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(zcode): claim worker requests atomically and scope them by endpoint The force marker was read with exists() and removed with unlink(), so a SessionStart contender that published worker.rerun and worker.force while a force=False owner held the lock had its request deleted by a pass that never saw it; the owner then delivered unforced and both markers were gone. Requests are now consumed by one atomic rename that returns whether this pass owns the force request, so a marker published after that step stays on disk for the next pass. worker.lock, worker.rerun and worker.force lived in the shared data directory while the queues are endpoint-scoped. An old-endpoint worker awaiting its acknowledgement therefore blocked a worker for a newly configured endpoint and then consumed its request while rescanning only the old queue. Scheduling state now lives under workers/<endpoint digest>, beside the queue it serves, so each endpoint's request reaches a worker that scans that endpoint. validate_config resolved the default Asia/Shanghai without checking whether an IANA database exists, so a Windows host without tzdata failed with "timezone must be an IANA timezone". Missing timezone data and an invalid key now report different errors, and the setup docs install tzdata on Windows and state what a missing database logs. Co-Authored-By: Claude Code <noreply@anthropic.com> * style(zcode): satisfy pre-commit on the timezone and endpoint tests Add the trailing comma add-trailing-comma expects in the missing-timezone-data error and rename the unused call() argument in the endpoint-switch regression test, so Pre-commit stays green without touching behavior. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com>
29 KiB
面向 AI Agent 的 local-first 自进化个人知识库。
历史版本:0.3.x · 0.2.x · MemoryScope
✨ 为什么选择 ReMe?
🧠 ReMe 将对话和资料持续沉淀为可读、可编辑、可检索、相互链接的 Markdown 记忆。QwenPaw、DeepSeek Harness 等 Agent 可以共享同一个 workspace,共同检索、维护和演化知识,而持久文件始终由用户掌控。
主动智能运行时(Proactive Runtime) 把这些长期记忆用于持续任务。它接收外部事件或定时触发,交给 Codex 等 Agent Runtime 执行,并在工作区记录结果和提醒。
- Memory as File, File as Memory:ReMe 使用带 frontmatter 和 wikilink 的普通 Markdown 保存持久记忆。用户和 Agent 都可以使用熟悉的工具查看、编辑、移动、同步和备份;索引及生成的元数据均可重建。
- 自进化知识库:ReMe 将对话和资料逐步加工为 daily note 与长期知识,在保留来源的同时,持续提炼事实、偏好、 流程经验及其关系。
- 精准召回所需上下文。 ReMe 结合 BM25、可选 embedding 和 wikilink 展开,召回带行号的相关片段及其关系,无需把整个知识库塞入 Agent 上下文。
- 一个 workspace,可供不同 Agent 共同使用。 个人助理、coding agent 和其他 Agent runtime 可以通过原生集成、SKILL.md、CLI、 HTTP、MCP 或 Python API 共享同一个本地记忆空间。
📰 最新动态
- [ROADMAP] - ReMe5 前瞻 · Proactive Runtime。ReMe 将以文件化记忆为核心, 支持事件驱动和定时 Agent。你可以把需要持续跟进的事交给 ReMe,有新进展时它会记下来,并在需要时提醒你。 我们计划在 2026 年底前发布 ReMe5,欢迎先看我们的设计方案、开发计划和里程碑。
- [2026.10] - 基于决策模型的上下文压缩:根据下一步任务判断旧工具证据的保留价值, 保护关键历史,并返回可回溯的压缩建议;提供 SVG 流程图、两个真实模型集成场景和 14-query 固定摘要实验,包含强制 Hermes 摘要基线。
- [2026.10] - ReMe 多模态记忆更新:Auto Memory 将会话图片和上下文一起 写入记忆并保留图片来源;Auto Resource 将图片资料整理为可检索、可回溯原图的 daily 卡片。Qwen3.8-Max 下, ReMe Image 的 LLM-Judge 得分为 MemLens-256K 72.49%、 MobileMem 60.69%;详情还包含 Kimi、DeepSeek 的结果。
- [2026.09] - 给记忆加上“标签”发布:介绍基于 Markdown 的实体标签、 可重建 Tag Index 与标签过滤检索。
更多更新
-
[2026.09] - Hermes Agent 记忆 Provider 已可使用:支持 HTTP 和 Embedded 两种模式,在模型调用前自动召回、每轮对话结束后异步执行
auto_memory。集成支持 Hermes Agent 0.21 及以上版本,后台任务也会继承当前 profile 上下文。 -
[2026.09] - OpenClaw 插件 发布:可通过 ClawHub 或 npm 安装,为 OpenClaw 提供原生记忆召回、自动对话捕获和定时整理能力。
-
[2026.09] - DeepSeek Harness 插件 发布:可通过 Awesome DSH Plugin 或 npm 安装,提供长期记忆指引、
reme_search、自动记忆、Auto Dream 和 ReMe Status。 -
[2026.08] - ReMe 博客发布:ReMe 博客 系统介绍了本地优先的记忆架构、 自进化工作流、混合检索、主动发现与评测结果。
-
[2026.08] - 新增 ReMe 生态插件:每日论文 可自动发现、解析论文并生成文件化简报; Auto Fin 可研究最近 24 小时的主题相关财联社新闻,并结合本地记忆构建可追溯报告。欢迎体验。
-
[2026.08] - 插件开发能力上线:参考 插件开发 与 插件管理, 为 ReMe 扩展 Component、Step 和 Job;欢迎开发并分享你的插件。
-
[2026.08] - 基于 ReMe 的智能体工具使用 经验驱动增强方法 已发布,见 arXiv:2608.03403。
-
[2026.07] - 我们的论文 Remember Me, Refine Me: A Dynamic Procedural Memory Framework for Experience-Driven Agent Evolution 已被 Findings of ACL 2026 接收。
🚀 快速开始
安装
ReMe 要求 Python 3.11+。
从 pip 安装:
pip install "reme-ai[core]"
从源码安装:
git clone https://github.com/agentscope-ai/ReMe.git
cd ReMe
pip install -e reme_studio/web/python -e ".[core]"
cd reme_studio
npm ci
npm run build:static
cd ..
静态构建要求 Node.js 22.13 或更高版本,并让源码安装可以直接使用 Studio。
可选决策模型功能使用 pip install "reme-ai[core,decision]" 安装。配置 TypeSafe API key 后即可启动服务并调用 reme decide,
详见决策模型配置。
Docker
使用 Docker 和 Compose 2.24.0+,构建并启动包含 Studio 的 ReMe:
mkdir -p .reme
docker compose up --build -d
打开 http://127.0.0.1:2333,完整工作区保存在宿主机的 ./.reme。Linux 用户的 UID/GID 不是 1000 时,请设置对应的
REME_UID 和 REME_GID。模型凭证、自定义路径、发布镜像和升级方式见 Docker 部署。
环境变量配置
如果需要 LLM 驱动的记忆演化或 embedding 检索,请在启动服务前配置环境变量。embedding 默认关闭,因此默认配置不会启动 embedding 模型,也不需要 embedding API key。
cat > .env <<'EOF'
# 可选:仅在配置中显式启用 embedding 组件后使用。
# EMBEDDING_API_KEY=sk-xxx
# EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
# 必须:auto_memory、auto_resource、auto_dream 和 proactive refresh 需要 LLM。
LLM_API_KEY=sk-xxx
LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
EOF
基础文件读写、BM25 检索、wikilink 遍历和 proactive topics 读取不需要 LLM 凭证,可以跳过此步骤并直接启动服务。
Note
如需启用基于 embedding 的语义检索,请取消
reme/config/default.yaml中components.as_embedding和components.embedding_store的注释,并将components.file_store.default.embedding_store从""改为default。完整说明见 记忆检索文档。
启动服务
在一个终端启动 ReMe,并保持运行:
reme start
默认服务地址是 127.0.0.1:2333。如果端口被占用,可以指定其他端口:
reme start service.port=8181
# reme start workspace_dir=/tmp/reme-demo service.port=8181
在另一个终端调用正在运行的服务。CLI 会发现服务配置;以下 curl 示例使用默认端口 2333:
reme version
reme health_check
reme help
curl -s http://127.0.0.1:2333/version -H 'Content-Type: application/json' -d '{}'
5 分钟记忆 Demo
服务运行后,可以写入一个记忆节点,让 ReMe 索引并检索它:
reme write \
path=digest/wiki/quick-start-demo \
name="Quick Start Demo" \
description="第一个 ReMe 记忆节点" \
content="# Quick Start Demo
ReMe 会把 Agent 记忆保存为可读的 Markdown。
相关链接:[[digest/wiki/memory-as-file.md]]"
reme search query="agent memory markdown" limit=5
reme read path=digest/wiki/quick-start-demo start_line=1 end_line=20
生成的文件是普通 Markdown,并带有 frontmatter:
---
name: Quick Start Demo
description: 第一个 ReMe 记忆节点
---
# Quick Start Demo
ReMe 会把 Agent 记忆保存为可读的 Markdown。
相关链接:[[digest/wiki/memory-as-file.md]]
ReMe Studio(可选)
上面的 core 安装已包含 Studio。运行 reme start config=proactive 后,打开 http://127.0.0.1:2333/ 使用 Remy、主动智能、随记和知识库。
如需为基础安装单独添加 Studio,可使用 pip install "reme-ai[web]"。源码构建、配置和开发说明见
ReMe Studio 指南。
🤝 将 ReMe 接入你的 Agent
ReMe 既可以作为本地记忆服务,通过 CLI、HTTP API 或 MCP server 接入,也可以通过 Python API 嵌入宿主进程。宿主集成可根据不同 runtime 的能力,将记忆指引、召回和捕获接入 Agent 生命周期。
| Agent | 推荐接入方式 | 接入后能力 |
|---|---|---|
| DeepSeek Harness | 使用 dsh plugin --profile web add @agentscope-ai/reme-dsh-plugin 安装 @agentscope-ai/reme-dsh-plugin。 |
可配置记忆指引、reme_search、自动对话捕获、定时 Auto Dream 和 ReMe Status。 |
| OpenClaw | 使用 openclaw plugins install clawhub:@agentscope-ai/reme-openclaw-plugin 安装 @agentscope-ai/reme-openclaw-plugin。 |
原生记忆工具、用户触发运行前召回和自动对话捕获。 |
| QwenPaw | 通过 Python API 在进程内嵌入 ReMe。 | 复用宿主生命周期和模型配置,同时保持记忆本地、文件化。 |
| Claude Code | 启动 ReMe 服务后,安装 Claude Code 插件。 | 自动召回、完成轮次分批记录,以及 MCP 查询工具。 |
| Qoder | 启动 ReMe 服务后,安装 Qoder 插件。 | 自动召回、可重试的完成轮次记录、MCP 工具和内置 Skill。 |
| ZCode | 启动 ReMe 服务后,安装 ZCode 插件。 | 自动召回、后台可重试记录、MCP 工具和内置 Skill。 |
| Hermes | 安装 ReMe provider,并选择 HTTP 或 Embedded 模式。 | 模型调用前召回,每轮对话完成后异步执行 auto_memory。 |
| Codex | 启动 ReMe 服务后,安装 Codex 插件。 | 原生 Hook 自动召回、分批记录,以及 MCP 查询工具。 |
| 其他 CLI Agent | 安装或复制 ReMe Memory skill。 | 通过 CLI 搜索、读取和写入记忆。 |
集成演示
| Auto Memory | Auto Dream | |
| QwenPaw |
|
|
| Claude Code |
|
|
🧠 ReMe 如何工作
Memory as File, File as Memory.
ReMe 将 记忆视为文件,让过滤后的对话来源记录和外部资料从 session/、resource/ 渐进加工到 daily/,再沉淀为
digest/。默认 workspace 是当前目录下的 .reme/;可通过 workspace_dir=... 选择其他由用户控制的位置。
Workspace 结构
<workspace_dir>/
├── metadata/ # 可重建的索引、图谱、catalog 和缓存
├── session/ # 对话来源记录和 Agent session
│ ├── dialog/
│ │ └── <session_id>.jsonl # auto_memory 保存的来源消息
│ └── claude_code/
│ └── <session_id>.jsonl # auto_memory_cc 使用的 ReMe 副本
├── mem_session/ # Agent wrapper 生成的 session/配置,不是用户记忆
│ ├── agentscope/
│ ├── claude_config/
│ └── codex/
├── resource/ # 外部原始材料
│ ├── <resource>.<ext> # 根目录文件进入当天 daily 层
│ └── YYYY-MM-DD/
│ └── <resource>.<ext>
├── daily/ # 浅加工记忆:当天事实、对话摘要、资源解读
│ ├── YYYY-MM-DD.md
│ └── YYYY-MM-DD/
│ ├── <generated_name>.md # 按主题命名的对话或资源卡片
│ └── interests.yaml
└── digest/ # 长期记忆:个人事实、流程经验、知识节点
├── personal/
│ └── {topic/event}.md
├── procedure/
│ └── {topic/event}.md
└── wiki/
└── {topic/event}.md
记忆生命周期
ReMe 遵循 capture → index → consolidate → recall 的循环。workspace 文件是持久化的事实来源,metadata/ 中的内容均可重建。
| 能力 | 入口 | 作用 | 输出 |
|---|---|---|---|
auto_memory |
Agent hook 或 reme auto_memory |
提炼有长期价值的对话事实,同时保留过滤后的对话来源记录。 | session/dialog/*.jsonl、daily/<date>/<generated-name>.md |
auto_resource |
资源监听或 reme auto_resource |
将 resource/ 下的文件转为带来源链接、按内容命名的 daily 卡片。 |
daily/<date>/<resource-card>.md |
auto_index |
后台监听或 reme reindex |
watcher 摄取 daily/ 和 digest/ 中的 Markdown;reindex 只基于已摄取的 chunks 重建 BM25 和 Embedding。 |
可检索的 chunks、BM25、wikilink 图谱和可选向量 |
auto_dream |
dream_cron 或 reme auto_dream |
默认从最近两天内变化的文件中最多提取 5 个可复用 unit,再创建、印证、补充或修正 digest 节点。 | digest/** |
proactive_read |
Agent 决定主动行动前调用 reme proactive_read |
读取独立 proactive refresh 流程生成的 topics;是否以及如何提醒用户由宿主 Agent 决定。 | 来自 daily/<date>/interests.yaml 的结构化 topics |
|
|
|
|
|
|
搜索返回带行号范围的相关 chunks 和数量受限的 wikilink 邻居;可选向量结果通过 RRF 与 BM25 融合。
Important
proactive_read只读取并暴露 proactive refresh 生成的兴趣主题,不会自行联网、发送通知或改写知识库;是否以及如何使用主题,由宿主 Agent 决定。
📊 评测结果
ReMe 通过 Agent 多轮搜索与读取的方式,评测多会话和超长上下文中的文本与多模态记忆能力。下表为仓库中已公开的参考实验结果;模型、prompt、数据集和评判细节见各评测文档。
| 基准 | 设置 | 样本量 | Agentic 得分 | 主要检验内容 |
|---|---|---|---|---|
| LongMemEval cleaned-s | 整体 | 500 题 | 89.4% | 跨会话检索、知识更新与时间推理 |
| BEAM | 100K 上下文 | 20 cases / 400 题 | 66.1% | 十类长上下文记忆任务 |
| BEAM | 1M 上下文 | 35 cases / 700 题 | 65.0% | 超长对话设置 |
| MemLens-256K | ReMe Image · Qwen3.8-Max | 189 / 195 题 | 72.49% | 多模态长历史问答 |
| MobileMem-Omni | ReMe Image · Qwen3.8-Max | 20 位用户 / 1,333 题 | 60.69% | 个人视觉记忆与推理 |
在仓库的 π-Bench 评测中,ReMe Agent 在 5 种用户角色上的平均 PROC 得分为 0.580 ,比相同测试模型配置的 NanoBot 高 2.4%。PROC 用于评估隐藏意图完成、针对性澄清、跨会话偏好和规范复用、跨任务依赖推断以及欠规格请求推进等主动性能力。
🧩 扩展与插件
插件是可选的独立 Python distribution,可以贡献 Component、Step、Job backend 和配置,并通过配置显式启用。每日论文与 Auto Fin 均已独立打包,使用说明分别见每日论文和 Auto Fin。
| 插件 | 能力 |
|---|---|
| 每日论文 | 发现并排序论文,使用 Agent 解读 PDF,生成文件化论文笔记和五分钟简报。 |
| Auto Fin | 拉取主题相关财联社新闻,搜索 ReMe 历史材料并生成带 wikilink 的 Markdown 报告。 |
安装、查看、校验、启用和卸载 ReMe 插件的方法见插件管理。
📚 文档
下列文档覆盖主要使用流程,并以当前代码的运行时契约为准。
| 文档 | 主要内容 |
|---|---|
| 快速开始 | 安装 ReMe、启动服务,并执行首次文件和记忆操作。 |
| 基础配置 | 配置 workspace、模型、Service、Job、Component、插件和命令行覆盖。 |
| 服务与部署 | 使用 HTTP、SSE、MCP 和 Studio,并理解默认安全边界。 |
| Memory as File | 理解 workspace 分层、frontmatter、wikilink、chunk 和文件事实来源模型。 |
| Auto Memory | 保留过滤后的对话来源记录,并提炼可复用的 daily 记忆卡片。 |
| Auto Resource | 导入支持的文本与图像资料,转换为可追溯来源的 daily 卡片。 |
| Auto Dream 与 Auto Link | 将 daily 记忆整理为持续演化的 digest 节点和可读 wikilink 关系。 |
| 记忆检索 | 使用 BM25、可选向量、RRF 融合、行号范围召回和渐进式链接扩展。 |
| Proactive 主题读取 | 安全读取兴趣主题,并将其接入宿主 Agent 的决策流程。 |
| 主动智能运行时 | 了解如何利用长期记忆持续跟进任务,并通过 Remy 查看进展与提醒。 |
| 应用场景 | 查看金融研究、研发记忆和个人知识库的完整使用示例。 |
| 框架说明 | 理解 Application、Job、Step、Component、service、配置和生命周期边界。 |
| Agent 集成 | 选择接口,并将 DSH、Claude Code、Codex、Qoder、ZCode、OpenClaw、Hermes 或其他 Agent 接入 ReMe。 |
| DSH 插件、Claude Code 插件、Qoder 插件 与 ZCode 插件 | 配置宿主原生召回、自动捕获、记忆整理与诊断。 |
| CLI 与 Job API | 查询命令语法,以及由默认配置自动生成的 Job 参数参考。 |
| 运维与恢复 | 诊断服务、维护索引,并备份、迁移和恢复 workspace。 |
| ReMe 博客 | 了解完整产品故事、设计动机、使用示例和评测摘要。 |
🛠️ 常用命令
运行 reme help 可查看完整 job 列表。常用 workspace 与维护命令如下:
| 命令 | 作用 |
|---|---|
reme status |
查看有状态数据组件的内存估算及进程 RSS。 |
reme search |
默认使用 BM25 和 wikilink 检索,启用后增加向量检索。 |
reme read / reme write / reme edit |
检查和维护 Markdown 记忆文件。 |
reme traverse / reme graph_snapshot |
浏览 wikilink 邻域或按类别组织的 digest 图。 |
reme chat |
与可感知 workspace 的只读 Agent 进行流式对话;需要 LLM 凭证。 |
reme reindex |
基于已摄取的 chunks 重建 BM25 和 Embedding 索引。 |
🤝 社区与贡献
- 问题反馈、需求与帮助:请先查看 Open Issues;如无相关讨论,可新建 Issue 说明背景、目标行为和影响范围。
- 代码贡献:改动前建议阅读贡献指南。架构与扩展方式以源码、schema 和测试为准。
- 文档贡献:请直接更新本仓库
docs/en/、docs/zh/或对应 package 目录中的规范源文件;文档站点会从这些文件生成。 - 提交规范:建议使用 Conventional Commits,例如
feat(search): add link expansion option、docs(zh): update quick start。 - 提交前检查:提交 PR 前请尽量运行
pre-commit run --all-files和pytest;如有依赖 LLM、embedding 或外部服务的测试无法运行,请在 PR 中说明。 - 项目文档:访问 reme.agentscope.io。
贡献者
感谢所有为 ReMe 做出贡献的朋友们:
📄 引用
@software{ReMe2026,
title = {Remember me, Refine me: Memory Management Kit for Agents},
author = {ReMe Team},
url = {https://reme.agentscope.io},
year = {2026}
}
⚖️ 许可证
本项目基于 Apache License 2.0 开源,详情参见 LICENSE 文件。