diff --git a/README.md b/README.md index 3b30371a..3582bb05 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,9 @@ memory, then continuously indexes, links, and consolidates that memory for futur ## 📰 News -- [2026.07] - Our paper [Remember Me, Refine Me: A Dynamic Procedural Memory Framework for Experience-Driven Agent Evolution](https://aclanthology.org/2026.findings-acl.829/) has been accepted to Findings of ACL 2026. +- [2026.07] - Our + paper [Remember Me, Refine Me: A Dynamic Procedural Memory Framework for Experience-Driven Agent Evolution](https://aclanthology.org/2026.findings-acl.829/) + has been accepted to Findings of ACL 2026. ## 🚀 Quick Start @@ -82,13 +84,14 @@ pip install -e ".[core]" ### Environment Variables -Configure environment variables when you want LLM-powered memory evolution or embedding retrieval: +Configure environment variables when you want LLM-powered memory evolution or embedding retrieval. Embeddings are +disabled by default, so the default setup does not start an embedding model or require an embedding API key. ```bash cat > .env <<'EOF' -# Optional: enables semantic retrieval when the embedding store is configured. -EMBEDDING_API_KEY=sk-xxx -EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1 +# Optional: used only after embedding components are explicitly enabled in the config. +# EMBEDDING_API_KEY=sk-xxx +# EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1 # Required for auto_memory, auto_resource, and auto_dream. LLM_API_KEY=sk-xxx @@ -98,6 +101,12 @@ EOF Basic file operations, BM25 search, wikilink traversal, and reading proactive topics can run without LLM credentials. +> [!NOTE] +> To enable embedding-based semantic retrieval, uncomment `components.as_embedding` and +> `components.embedding_store` in [`reme/config/default.yaml`](reme/config/default.yaml), then change +> `components.file_store.default.embedding_store` from `""` to `default`. See the +> [memory search guide](docs/en/memory_search.md) for details. + ### Start the Service ```bash @@ -193,7 +202,8 @@ ReMe treats **memory as files**, progressively processing raw conversations and ## 🧭 Memory Design Philosophy -> Capture raw dialogs and resources, refine them into long-term preferences, reusable experience, and valuable knowledge, +> Capture raw dialogs and resources, refine them into long-term preferences, reusable experience, and valuable +> knowledge, > while keeping the result editable by humans and agents. ### Automatic Memory Flow @@ -202,13 +212,13 @@ ReMe follows a capture → index → consolidate → recall loop. Conversations background jobs keep files searchable; `auto_dream` distills stable knowledge into `digest/`; agents recall memory through search, wikilinks, or proactive topics. -| Capability | Entry point | What it does | Output | -|---------------------------------------------|--------------------------------------------------|-----------------------------------------------------------------------------------------------|----------------------------------------------------------| -| [`auto_memory`](docs/en/auto_memory.md) | Agent hook or `reme auto_memory` | Distills useful conversation facts while preserving the raw session. | `session/dialog/*.jsonl`, `daily//.md` | -| [`auto_resource`](docs/en/auto_resource.md) | Resource watcher or `reme auto_resource` | Turns files under `resource//` into source-linked daily cards. | `daily//.md` | -| [`auto_index`](docs/en/memory_search.md) | Background watcher or `reme reindex` | Maintains chunks, BM25/embedding indexes, and the wikilink graph. | Searchable `daily/`, `digest/`, and `resource/` content | -| [`auto_dream`](docs/en/auto_dream.md) | `dream_cron` or `reme auto_dream` | Consolidates changed daily cards into long-term personal, procedure, and wiki memory. | `digest/**`, `daily//interests.yaml` | -| [`proactive`](docs/en/proactive.md) | `reme proactive` before an agent decides to act | Reads topics generated by `auto_dream`; the host agent decides whether and how to mention them. | Structured topics from `daily//interests.yaml` | +| Capability | Entry point | What it does | Output | +|---------------------------------------------|-------------------------------------------------|-------------------------------------------------------------------------------------------------|---------------------------------------------------------| +| [`auto_memory`](docs/en/auto_memory.md) | Agent hook or `reme auto_memory` | Distills useful conversation facts while preserving the raw session. | `session/dialog/*.jsonl`, `daily//.md` | +| [`auto_resource`](docs/en/auto_resource.md) | Resource watcher or `reme auto_resource` | Turns files under `resource//` into source-linked daily cards. | `daily//.md` | +| [`auto_index`](docs/en/memory_search.md) | Background watcher or `reme reindex` | Maintains chunks, the BM25 index, the wikilink graph, and the optional embedding index. | Searchable `daily/`, `digest/`, and `resource/` content | +| [`auto_dream`](docs/en/auto_dream.md) | `dream_cron` or `reme auto_dream` | Consolidates changed daily cards into long-term personal, procedure, and wiki memory. | `digest/**`, `daily//interests.yaml` | +| [`proactive`](docs/en/proactive.md) | `reme proactive` before an agent decides to act | Reads topics generated by `auto_dream`; the host agent decides whether and how to mention them. | Structured topics from `daily//interests.yaml` | @@ -234,11 +244,11 @@ through search, wikilinks, or proactive topics. ReMe runs as a local memory service and offers multiple integration paths: CLI, HTTP API, MCP server, and SDK. Different agents can choose the path that fits their runtime while sharing the same local memory workspace. -| Agents | Recommended path | What works out of the box | -|------------------------------------------------------|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------| -| **QwenPaw** | Embed ReMe via the Python SDK. | Reuse the app's own lifecycle and model config while keeping memory local and file-based. | -| **Claude Code** | Start ReMe as an MCP service and install [plugins/reme](plugins/reme). | MCP recall tools, a `reme-memory` skill, and a Stop hook that records sessions automatically. | -| **Other CLI-capable agents (OpenClaw/Hermes/Codex)** | Copy or install [skills/reme_memory/SKILL.md](skills/reme_memory/SKILL.md). | Search/read/write memory and call `auto_memory`, `auto_dream`, and `proactive` via the CLI. | +| Agents | Recommended path | What works out of the box | +|------------------------------------------------------|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------| +| **QwenPaw** | Embed ReMe via the Python SDK. | Reuse the app's own lifecycle and model config while keeping memory local and file-based. | +| **Claude Code** | Start ReMe as an MCP service and install [plugins/reme](plugins/reme). | MCP recall tools, a `reme-memory` skill, and a Stop hook that records sessions automatically. | +| **Other CLI-capable agents (OpenClaw/Hermes/Codex)** | Copy or install [skills/reme_memory/SKILL.md](skills/reme_memory/SKILL.md). | Search/read/write memory and call `auto_memory`, `auto_dream`, and `proactive` via the CLI. |

Integration demos

@@ -274,22 +284,23 @@ ReMe operates the workspace through a unified job interface exposed by the CLI. reading, writing, editing, and automatic memory commands. Lower-level indexing, frontmatter, and file operation commands are mainly for maintenance, debugging, or advanced integration. Run `reme help` for the full job list. -| Command | Purpose | -|-------------------------------------------|--------------------------------------------------------------------------------------| -| `reme start` | Start the local ReMe service. | -| `reme version` / `reme health_check` | Check package and component status. | -| [`reme search`](docs/en/memory_search.md) | Retrieve memory with hybrid search. | -| `reme read` / `reme write` / `reme edit` | Inspect and maintain Markdown memory files. | -| `reme auto_memory` | Turn conversation messages into daily memory cards. Requires LLM credentials. | +| Command | Purpose | +|-------------------------------------------|----------------------------------------------------------------------------------------| +| `reme start` | Start the local ReMe service. | +| `reme version` / `reme health_check` | Check package and component status. | +| [`reme search`](docs/en/memory_search.md) | Retrieve memory with BM25 and wikilinks by default, plus vectors when enabled. | +| `reme read` / `reme write` / `reme edit` | Inspect and maintain Markdown memory files. | +| `reme auto_memory` | Turn conversation messages into daily memory cards. Requires LLM credentials. | | `reme auto_resource` | Interpret files under `resource/` into daily resource cards. Requires LLM credentials. | -| `reme auto_dream` / `reme proactive` | Consolidate daily memory into long-term digest and surface topics worth attention. | -| `reme reindex` | Rebuild search and wikilink indexes from existing files. | +| `reme auto_dream` / `reme proactive` | Consolidate daily memory into long-term digest and surface topics worth attention. | +| `reme reindex` | Rebuild search and wikilink indexes from existing files. | ## 🤝 Community and Support - **Issues and requests**: Check [Open Issues](https://github.com/agentscope-ai/ReMe/issues) first. If there is no related discussion, open a new issue with background, expected behavior, and impact scope. -- **Code contributions**: Before making changes, read the [contribution guide](https://docs.agentscope.io/reme/stable/en/contributing). Source, +- **Code contributions**: Before making changes, read + the [contribution guide](https://docs.agentscope.io/reme/stable/en/contributing). Source, schemas, and tests are the authoritative architecture and extension guide. - **Documentation contributions**: Submit user-facing documentation changes to the [unified documentation repository](https://github.com/agentscope-ai/docs) under `reme//{en,zh}/`. diff --git a/README_ZH.md b/README_ZH.md index 44d405e8..6a01a79b 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -26,7 +26,8 @@ > [0.2.x](https://github.com/agentscope-ai/ReMe/tree/v0.2.0.6) · > [MemoryScope](https://github.com/agentscope-ai/ReMe/tree/memoryscope_branch) -🧠 ReMe 是一个面向 **AI 智能体** 的 local-first 记忆层。它把对话和资料沉淀为文件化长期记忆,并持续完成索引、链接和整理,让后续 Agent 能够可靠召回。 +🧠 ReMe 是一个面向 **AI 智能体** 的 local-first 记忆层。它把对话和资料沉淀为文件化长期记忆,并持续完成索引、链接和整理,让后续 +Agent 能够可靠召回。 ## ✨ 核心创新 @@ -50,8 +51,9 @@ ## 📰 新闻 -- [2026.07] - 我们的论文 [Remember Me, Refine Me: A Dynamic Procedural Memory Framework for Experience-Driven Agent Evolution](https://aclanthology.org/2026.findings-acl.829/) -已被 Findings of ACL 2026 接收。 +- [2026.07] - + 我们的论文 [Remember Me, Refine Me: A Dynamic Procedural Memory Framework for Experience-Driven Agent Evolution](https://aclanthology.org/2026.findings-acl.829/) + 已被 Findings of ACL 2026 接收。 ## 🚀 快速开始 @@ -75,13 +77,14 @@ pip install -e ".[core]" ### 环境变量 -如果需要 LLM 驱动的记忆演化或 embedding 检索,可以配置环境变量: +如果需要 LLM 驱动的记忆演化或 embedding 检索,可以配置环境变量。embedding 默认关闭,因此默认配置不会启动 +embedding 模型,也不需要 embedding API key。 ```bash cat > .env <<'EOF' -# 可选:配置 embedding store 后启用语义检索。 -EMBEDDING_API_KEY=sk-xxx -EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1 +# 可选:仅在配置中显式启用 embedding 组件后使用。 +# EMBEDDING_API_KEY=sk-xxx +# EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1 # 必须:auto_memory、auto_resource 和 auto_dream 需要 LLM。 LLM_API_KEY=sk-xxx @@ -91,6 +94,12 @@ EOF 基础文件读写、BM25 检索、wikilink 遍历和 proactive topics 读取可以先不配置 LLM 凭证。 +> [!NOTE] +> 如需启用基于 embedding 的语义检索,请取消 [`reme/config/default.yaml`](reme/config/default.yaml) 中 +> `components.as_embedding` 和 `components.embedding_store` 的注释,并将 +> `components.file_store.default.embedding_store` 从 `""` 改为 `default`。完整说明见 +> [记忆检索文档](docs/zh/memory_search.md)。 + ### 启动服务 ```bash @@ -193,13 +202,13 @@ ReMe 将**记忆视为文件**,让原始对话和外部资料从 `session/`、 ReMe 遵循 capture → index → consolidate → recall 的循环。对话和资料先变成 daily 记忆卡片;后台任务保持文件可检索; `auto_dream` 将稳定知识沉淀到 `digest/`;Agent 再通过搜索、wikilink 或 proactive topics 召回记忆。 -| 能力 | 入口 | 作用 | 输出 | -|---------------------------------------------|-----------------------------------|-------------------------------------|----------------------------------------------------------| -| [`auto_memory`](docs/zh/auto_memory.md) | Agent hook 或 `reme auto_memory` | 提炼有长期价值的对话事实,同时保留原始 session。 | `session/dialog/*.jsonl`、`daily//.md` | -| [`auto_resource`](docs/zh/auto_resource.md) | 资源监听或 `reme auto_resource` | 将 `resource//` 下的文件转为带来源链接的 daily 卡片。 | `daily//.md` | -| [`auto_index`](docs/zh/memory_search.md) | 后台监听或 `reme reindex` | 维护 chunks、BM25/embedding 索引和 wikilink 图谱。 | 可检索的 `daily/`、`digest/`、`resource/` 内容 | -| [`auto_dream`](docs/zh/auto_dream.md) | `dream_cron` 或 `reme auto_dream` | 将变化的 daily 卡片整理为长期 personal、procedure 和 wiki 记忆。 | `digest/**`、`daily//interests.yaml` | -| [`proactive`](docs/zh/proactive.md) | Agent 决定主动行动前调用 `reme proactive` | 读取 `auto_dream` 生成的 topics;是否以及如何提醒用户由宿主 Agent 决定。 | 来自 `daily//interests.yaml` 的结构化 topics | +| 能力 | 入口 | 作用 | 输出 | +|---------------------------------------------|----------------------------------|----------------------------------------------------|------------------------------------------------------| +| [`auto_memory`](docs/zh/auto_memory.md) | Agent hook 或 `reme auto_memory` | 提炼有长期价值的对话事实,同时保留原始 session。 | `session/dialog/*.jsonl`、`daily//.md` | +| [`auto_resource`](docs/zh/auto_resource.md) | 资源监听或 `reme auto_resource` | 将 `resource//` 下的文件转为带来源链接的 daily 卡片。 | `daily//.md` | +| [`auto_index`](docs/zh/memory_search.md) | 后台监听或 `reme reindex` | 维护 chunks、BM25 索引、wikilink 图谱及可选的 embedding 索引。 | 可检索的 `daily/`、`digest/`、`resource/` 内容 | +| [`auto_dream`](docs/zh/auto_dream.md) | `dream_cron` 或 `reme auto_dream` | 将变化的 daily 卡片整理为长期 personal、procedure 和 wiki 记忆。 | `digest/**`、`daily//interests.yaml` | +| [`proactive`](docs/zh/proactive.md) | Agent 决定主动行动前调用 `reme proactive` | 读取 `auto_dream` 生成的 topics;是否以及如何提醒用户由宿主 Agent 决定。 | 来自 `daily//interests.yaml` 的结构化 topics |
@@ -225,10 +234,10 @@ ReMe 遵循 capture → index → consolidate → recall 的循环。对话和 ReMe 作为本地记忆服务运行,并提供 CLI、HTTP API、MCP server 和 SDK 等多种接入方式。不同 Agent 可以选择适合自身 runtime 的路径,同时共享同一个本地 memory workspace。 -| Agent | 推荐接入方式 | 开箱可用能力 | -|------------------------------------------------------|-----------------------------------------------------------------------|--------------------------------------------------------------------| -| **QwenPaw** | 通过 Python SDK 嵌入 ReMe。 | 复用应用自身生命周期和模型配置,同时保持 memory 本地、文件化。 | -| **Claude Code** | 以 MCP service 启动 ReMe,并安装 [plugins/reme](plugins/reme)。 | MCP recall tools、`reme-memory` skill,以及自动记录会话的 Stop hook。 | +| Agent | 推荐接入方式 | 开箱可用能力 | +|------------------------------------------------------|-------------------------------------------------------------------|-----------------------------------------------------------------| +| **QwenPaw** | 通过 Python SDK 嵌入 ReMe。 | 复用应用自身生命周期和模型配置,同时保持 memory 本地、文件化。 | +| **Claude Code** | 以 MCP service 启动 ReMe,并安装 [plugins/reme](plugins/reme)。 | MCP recall tools、`reme-memory` skill,以及自动记录会话的 Stop hook。 | | **Other CLI-capable agents (OpenClaw/Hermes/Codex)** | 复制或安装 [skills/reme_memory/SKILL.md](skills/reme_memory/SKILL.md)。 | 通过 CLI 搜索/读取/写入记忆,并调用 `auto_memory`、`auto_dream` 和 `proactive`。 |

集成演示

@@ -264,22 +273,23 @@ ReMe 作为本地记忆服务运行,并提供 CLI、HTTP API、MCP server 和 ReMe 通过 CLI 暴露的统一 job interface 操作 workspace。Agent 通常只需要使用检索、读取、写入、编辑和自动记忆相关命令;更底层的索引、 frontmatter 和文件操作接口主要用于维护、调试或高级集成。完整 job 列表可以运行 `reme help` 查看。 -| 命令 | 作用 | -|-----------------------------------------|---------------------------------------------| -| `reme start` | 启动本地 ReMe 服务。 | -| `reme version` / `reme health_check` | 检查包版本和组件状态。 | -| [`reme search`](docs/zh/memory_search.md) | 执行混合记忆检索。 | -| `reme read` / `reme write` / `reme edit` | 检查和维护 Markdown 记忆文件。 | -| `reme auto_memory` | 将对话 messages 转为 daily 记忆卡片;需要 LLM 凭证。 | -| `reme auto_resource` | 将 `resource/` 下的文件解读为 daily 资料卡片;需要 LLM 凭证。 | -| `reme auto_dream` / `reme proactive` | 将 daily 记忆整理为长期 digest,并暴露值得关注的主题。 | -| `reme reindex` | 基于已有文件重建检索和 wikilink 索引。 | +| 命令 | 作用 | +|-------------------------------------------|---------------------------------------------| +| `reme start` | 启动本地 ReMe 服务。 | +| `reme version` / `reme health_check` | 检查包版本和组件状态。 | +| [`reme search`](docs/zh/memory_search.md) | 默认使用 BM25 和 wikilink 检索,启用后增加向量检索。 | +| `reme read` / `reme write` / `reme edit` | 检查和维护 Markdown 记忆文件。 | +| `reme auto_memory` | 将对话 messages 转为 daily 记忆卡片;需要 LLM 凭证。 | +| `reme auto_resource` | 将 `resource/` 下的文件解读为 daily 资料卡片;需要 LLM 凭证。 | +| `reme auto_dream` / `reme proactive` | 将 daily 记忆整理为长期 digest,并暴露值得关注的主题。 | +| `reme reindex` | 基于已有文件重建检索和 wikilink 索引。 | ## 🤝 社区与支持 - **问题反馈与需求**:请先查看 [Open Issues](https://github.com/agentscope-ai/ReMe/issues);如无相关讨论,可新建 Issue 说明背景、目标行为和影响范围。 -- **代码贡献**:改动前建议阅读 [贡献指南](https://docs.agentscope.io/reme/stable/zh/contributing)。架构与扩展方式以源码、schema 和测试为准。 +- **代码贡献**:改动前建议阅读 [贡献指南](https://docs.agentscope.io/reme/stable/zh/contributing)。架构与扩展方式以源码、schema + 和测试为准。 - **文档贡献**:用户可见文档请提交到[统一文档仓库](https://github.com/agentscope-ai/docs)的 `reme//{en,zh}/` 目录。 - **提交规范**:建议使用 Conventional Commits,例如 `feat(search): add link expansion option`、 `docs(zh): update quick start`。 diff --git a/reme/__init__.py b/reme/__init__.py index bbeacdc9..0ca5442f 100644 --- a/reme/__init__.py +++ b/reme/__init__.py @@ -1,6 +1,6 @@ """ReMe CLI package.""" -__version__ = "0.4.0.9" +__version__ = "0.4.1.0" from . import config from . import constants diff --git a/reme/config/default.yaml b/reme/config/default.yaml index 12928842..2276ca23 100644 --- a/reme/config/default.yaml +++ b/reme/config/default.yaml @@ -599,20 +599,20 @@ components: default: backend: regex - as_embedding: - default: - backend: ${EMBEDDING_BACKEND:-openai} - model: ${EMBEDDING_MODEL_NAME:-text-embedding-v4} - dimensions: 1024 - credential: - api_key: ${EMBEDDING_API_KEY:-} - base_url: ${EMBEDDING_BASE_URL:-https://dashscope.aliyuncs.com/compatible-mode/v1} - parameters: { } - - embedding_store: - default: - backend: local - as_embedding: default +# as_embedding: +# default: +# backend: ${EMBEDDING_BACKEND:-openai} +# model: ${EMBEDDING_MODEL_NAME:-text-embedding-v4} +# dimensions: 1024 +# credential: +# api_key: ${EMBEDDING_API_KEY:-} +# base_url: ${EMBEDDING_BASE_URL:-https://dashscope.aliyuncs.com/compatible-mode/v1} +# parameters: { } +# +# embedding_store: +# default: +# backend: local +# as_embedding: default as_llm: default: @@ -687,7 +687,7 @@ components: default: backend: local store_name: local - # embedding_store: default +# embedding_store: default embedding_store: "" keyword_index: default file_graph: default