ReMe/docs/zh/integrations.md
imrewce 354837f9af
feat(proactive): separate proactive refresh from auto dream (#488)
* refractor(proactive): upgrade proactive feature with disentangled job and steps

* refactor(proactive): apply audit fixes

- rename read-side job 'proactive' -> 'proactive_read' (less confusing vs the refresh pipeline)
- drop dedicated agent_wrapper.proactive; extraction reuses the default wrapper
- simplify schema: remove unused ProactiveExtractOutput/TopicUpdate, drop resource_paths
- extract no longer scans resource/ directly (daily notes already carry resource content)
- update tests and docs accordingly

* feat(proactive): strict extract-output gate and prompt total budget

- parse_extract_reply now requires a contract section (follow_ups/extends/updates
  as a list); non-empty replies with misspelled section names trigger the
  existing one-shot retry instead of silently checkpointing changed files
- pack_paths gains max_total_chars; extract packs newest daily material first,
  keeps the first file on overflow, and records omitted files in a trailer
  (default budget 300000 chars, configurable via max_total_chars)
- tests: schema gate unit, schema-error retry e2e, budget unit + e2e

* feat(proactive): add scenario-card plan step and generative agenda step

* feat(proactive): digest-personal profile personalization and leaner LLM contract

- extract/plan/agenda now draw a user profile block from <digest_dir>/personal/*.md
  (frontmatter description + body excerpt, per-file budget, profile.md fallback)
- all daily access honours the configured daily_dir (prompt paths parameterized,
  config-driven fallbacks) so workspaces using e.g. memory/ work unchanged
- schema trim: drop dead fields errors/material_paths, carry_forward_all -> count
- shrink LLM output contract: new topics emit title/reason/confidence/paths only;
  keywords removed end-to-end, evidence derived from paths[0] (updates keep it)

* fix(proactive): skip checkpoint when extract reply stays unusable after retry

Two consecutive unparseable replies now short-circuit the round without
checkpointing, so the same material is retried next round instead of being
silently consumed (closes the residual audit #1 gap: the structural gate
detected schema-wrong output but a double failure still checkpointed).

* fix(proactive): replace running bool with reference-counted job activity tracker for the idle gate

* refactor(proactive): remove job activity tracking and idle gate, restore job tree to upstream

* fix(proactive): address second audit round (readonly reader, mtime checkpoint, wider fallbacks, profile containment, horizon content, expiry boundary)

* refactor(dream): strip interests.yaml ownership from dream, proactive is now the sole writer

* refactor(dream): separate proactive topic generation

* ci: update renamed auto dream smoke test

* fix(proactive): complete refresh migration and docs

---------

Co-authored-by: jinli.yl <jinli.yl@alibaba-inc.com>
2026-09-07 17:23:37 +08:00

3 KiB
Raw Blame History

title description
Agent 集成 通过 CLI、HTTP、MCP、Skill 和宿主适配器把 ReMe 接入 Agent。

Agent 集成

ReMe 把记忆能力放在独立服务和用户拥有的 workspace 中。Agent 可以通过标准接口调用同一套记忆,而不必把存储逻辑绑定到某一个模型或宿主。

选择接入方式

场景 推荐方式
本机脚本或 Hook ReMe CLI
应用后端 HTTP Client
支持工具协议的 Agent MCP
TypeScript Agent @agentscope-ai/reme
Claude Code MCP + Skill + Stop Hook
Hermes Agent Memory provider adapter
Codex 或其他 coding agent reme_memory Skill 或 MCP

通用接入循环

一个完整但可控的 Agent 记忆循环通常包含:

  1. 会话开始或回答前,用 search 找到相关记忆;
  2. 对高价值结果使用 read,必要时用 traverse 展开关系;
  3. 在回答中保留 workspace-relative 来源路径;
  4. 会话结束后,把原始消息交给 auto_memory
  5. 由后台或定时任务把 daily 内容整理到 digest。

搜索不到内容时应明确返回空结果,不应把模型推测当成历史记忆。

MCP

默认 HTTP 服务在 http://127.0.0.1:2333/mcp 提供 streamable HTTP MCP。常用工具包括

  • search
  • read
  • traverse
  • list
  • auto_memory
  • proactive_read

根据宿主风险模型,可以用 service.jobs 只暴露只读工具,或将写入工具放在单独配置中。

CLI 和 Skill

仓库中的 skills/reme_memory/SKILL.md 描述了一个通用 Agent 工作流,包括安装检查、服务发现、检索、读取和写入边界。它适合能够执行本地命令的 Agent。

Skill 不应:

  • 未经允许安装或升级 Python 环境;
  • 发现端口冲突后停止未知进程;
  • 把召回的工具结果再次写入对话来源;
  • 将密钥或敏感信息写入记忆。

TypeScript、OpenClaw 与 DeepSeek Harness

统一 HTTP 客户端和包能力见 TypeScript Agent 集成。宿主的完整安装、配置和运行说明见 DeepSeek HarnessOpenClaw 指南。它们包含:

  • HTTP Client
  • DeepSeek Harness adapter
  • OpenClaw adapter
  • 构建与发布检查。

Claude Code

仓库的 integrations/claude_code/ 提供:

  • streamable HTTP MCP 配置;
  • reme-memory Skill
  • 会话停止时调用 auto_memory_cc 的 Hook。

完整安装步骤以仓库中的 integrations/claude_code/README.md 为准。

Hermes Agent

integrations/hermes_agent/ 提供 memory provider模型调用前检索相关记忆每轮结束后异步调用 auto_memory。完整配置见该目录 README。

生产接入建议

  • 明确选择稳定、绝对的 workspace_dir
  • 启动前复用 reme find_reme 发现的服务;
  • reme help 为当前 Job 契约;
  • 为写入动作设置超时和失败日志;
  • 不因记忆服务暂时不可用而阻塞宿主的核心回答流程;
  • 对远程访问使用认证、TLS 和最小 Job allowlist。