llm-wiki wiki · sources 2026-06-12

agentscope-ai/ReMe 是 AgentScope 生态的 memory management toolkit。它同时保留“memory as files”的 ReMeLight 和更完整的 vector/service pipeline:personal memory、task memory、tool memory、working memory 都有独立 summary/retrieve op,目标是解决长对话 context window 和跨 session stateless 两个问题。

核心架构图

┌──────────────────────────── agent conversation / trajectory ─────────────────┐
│ messages · tool results · task traces · user preferences                      │
└───────────────────────────────┬───────────────────────────────────────────────┘
                                │
┌───────────────────────────────▼───────────────────────────────────────────────┐
│ ReMe memory orchestration                                                     │
│ context check · compact · summarize · retrieve · pre_reasoning_hook           │
└───────────────┬───────────────────────────────┬───────────────────────────────┘
                │                               │
┌───────────────▼──────────────┐  ┌─────────────▼──────────────────────────────┐
│ ReMeLight file memory         │  │ vector/service pipeline                     │
│ MEMORY.md · daily journal     │  │ personal/task/tool/working ops + vector DB  │
└───────────────┬──────────────┘  └─────────────┬──────────────────────────────┘
                │                               │
┌───────────────▼───────────────────────────────▼──────────────────────────────┐
│ recalled context: compact summary · semantic/BM25 hits · task/tool lessons    │
└───────────────────────────────────────────────────────────────────────────────┘

模块分层

层/目录 责任
reme/reme_light.py + reme/memory/file_based/** 文件型记忆系统:MEMORY.md、daily journal、dialog JSONL、tool_result cache。
reme_ai/summary/** personal/task/tool/working 四类总结 pipeline,包含 observation、reflection、dedup、validation、trajectory segmentation。
reme_ai/retrieve/** personal/task/tool/working 检索 pipeline,包含 query rewrite、semantic rank、rerank/fusion、文件 grep/read/write。
reme_ai/vector_store/** 向量记忆更新、频率/效用更新、recall op。

关键数据流

  1. ReMeLight 在 pre-reasoning 前检查 token,过阈值则压缩老消息、保留近期上下文,并把长 tool output offload 到文件。
  2. 长期记忆写入 MEMORY.mdmemory/YYYY-MM-DD.md,原始对话进入 dialog/YYYY-MM-DD.jsonl,便于人工迁移/修改。
  3. vector pipeline 将 personal/task/tool/working memory 拆成不同 summary 和 retrieve op,按场景选择信息,而不是用一个大表统管所有记忆。

设计决策

对比定位

mem0 相比,ReMe 更框架内生,记忆类型更细;和 memsearch 相比,它不是 Markdown journal + Milvus shadow index,而是 context management + file/vector memory;和 tencentdb-agent-memory 相比,ReMe 更轻、更贴 AgentScope hooks。

相关链接