title, author, source, date, type, tags
| title |
author |
source |
date |
type |
tags |
| Atlas Agent 记忆架构:三索引 + 混合召回 + 写后提炼 |
Atlas Memory System (基于 noamschwartz/atlas-memory-demo) |
微信公众号 |
2026 |
article |
| agent-memory |
| elasticsearch |
| hybrid-retrieval |
| consolidation |
| bias |
|
Atlas Agent 记忆系统架构全解析
深度工程实践:Agent 记忆不是 KV 存储问题,是多索引信息检索问题。
核心论点
chat_history.append() 不是记忆系统——那是日志文件。真正的挑战:在三索引(episodic/semantic/procedural)+ catalog 四种不同生命周期的信息中,用对的衰减曲线和互补的检索通道,在查询瞬间找到对的那几条。
Atlas 架构
三索引 + 公共
| 索引 |
内容 |
衰减源 |
写入频率 |
| episodic |
原始消息+时间戳 |
timestamp |
每回合 |
| semantic |
提炼后稳定事实 |
last_used_at |
consolidation |
| procedural |
多步操作流程 |
豁免(1.0) |
consolidation |
| catalog |
公共共享知识 |
timestamp |
手动 |
检索管线
- Verbatim Pre-Recall — 用户原话,不经 LLM 改写
- BM25 + Dense 双通路并行 → RRF 融合 (rank_constant=30)
- Cross-encoder 重排序 (Jina v2, top-80→top-K)
- Reranker 失败降级为 RRF 顺序
Ablation 数据
- Full: R@10=0.89
- Dense-only: 0.845
- BM25-only: 0.708
- No-Reranker: -0.238
五条代码链路
- write_memory (refresh=True 保证同轮可见)
- recall_memory (混合检索+reranker)
- Verbatim Pre-Recall (绕过 LLM 改写层)
- Consolidation (episodic→semantic/procedural)
- Soft-Supersession (非破坏矛盾处理)
三个通用设计原则
- 衰减曲线是领域性决策—先定义信息有效周期,再定衰减参数
- BM25+vector 互补—BM25 抓精确 token,dense 抓语义意图,不可互相替代
- 记忆需要后台提炼+矛盾处理—consolidation 转化事件为事实,supersession 提供非破坏性更新
与 GBrain 的对比
| 维度 |
Atlas |
GBrain |
| 存储 |
ES 搜索引擎 |
Markdown+Git |
| 多租户 |
ES DLS (集群层) |
应用层 auth |
| 矛盾处理 |
Soft-Supersession 链 |
Git 版本历史 |
| 衰减 |
Per-index gauss |
无显式衰减 |
| 调试透明度 |
仅通过 API |
直接打开文件 |