3. 记忆与上下文
10 模块知识库第 3 篇——讲 agent 如何在不同 session 之间保留信息:context window 限制、短期记忆、长期记忆、RAG、truncation 策略,以及在多 agent 间共享状态的方案。
本文覆盖 4 种 memory 与 context engineering,以及怎么用:
- 4 种 memory episodic / semantic / procedural / working,各适用什么场景
- Context Engineering 4 步流水线:压缩 / 摘要 / 检索 / 注入,跟 RAG 的关系
- RAG 6 步流水线 从 chunking 到重排序,每个环节的 2-3 个选型
- Chunking 3 策略 fixed / semantic / recursive 各自的 trade-off
选型快查 (TL;DR)
| 场景 | 推荐子能力 | 代表 agent |
|---|---|---|
| 长文档问答(1M+ context) | 1M+ context window | Claude Sonnet 4.6+ / GPT-5.5 / Antigravity / Qwen-Agent 1M |
| 跨 session 持久记忆 | Long-term memory + Memory bank | ChatGPT Memory / Claude Memory / Qwen-Agent 1M RAG |
| 私有知识库 RAG | Hybrid RAG + agent decomposition | Qwen-Agent 1M RAG / WorkBuddy |
| 多 agent 状态共享 | Shared memory layer | Coze 3 / Copilot Studio System variables |
| Session 内 / 跨 Session 共享 | CLAUDE.md / Project memory | Claude Code nested CLAUDE.md |
| Context 超限处理 | Compaction + sub-agent 隔离 | Claude Code /rewind / ChatGPT Agent 3 mode |
| 本地化长期记忆(隐私) | 100% 本地向量搜索 | Ollama + WorkBuddy |
1. 这是什么 + 为什么重要
记忆与上下文决定 agent 能处理多复杂、多长时间跨度的任务。本模块拆解三层结构:
| 层 | 时间跨度 | 典型实现 | 失败后果 |
|---|---|---|---|
| 短期(in-session) | 当前对话 | context window + 消息历史 | 答非所问、忘记前文 |
| 中期(project) | 项目级,跨 session | CLAUDE.md / AGENTS.md / Project memory | 重复约定、风格漂移 |
| 长期(cross-session) | 跨周跨月 | Memory bank / ChatGPT Memory / Vector store | 用户每次重新教偏好 |
为什么是 agent 的硬约束:
- 模型 context window 有上限(200K / 1M / 2M),超过必须压缩或截断
- 长任务、多 agent 协作必须解决"子 agent 上下文隔离 vs 主 agent 信息汇总"的张力
- 知识库(RAG)和长期记忆是 agent 从"工具"升级为"团队成员"的关键
2. 子模块分解
2.1 Context window(具体数字)
是什么:单次对话能塞多少 token,模型一次性"看见"的全部文本量。
跨 agent 数字表:
2.2 短期记忆(in-session)
是什么:当前 session 内的对话历史 + tool 调用结果 + 推理痕迹,在 context window 内维护。
跨 agent 差异表:
| Agent | 短期记忆机制 | 特殊能力 | 来源 |
|---|---|---|---|
| Claude Code | 完整 message history + thinking block + tool_use | /rewind Esc+Esc 回滚到任意 checkpoint;compaction 后自动 re-read project root CLAUDE.md | anthropic.com ✅ |
| ChatGPT Agent | Server-side / Standalone / ZDR 三种 compaction 模式 | Compaction item 是 opaque、encrypted、自动 carry state | platform.openai.com ✅ |
| Devin | Session transcript + 3h session timeout 自动 kill | 长 session 自动 sleep/wake | docs.devin.ai ✅ |
| Qwen-Agent | 5 步渐进截断 S1-S5 | 自动按 max_input_tokens 触发截断 | qwenlm.github.io ✅ |
| WorkBuddy | 对话历史 + auto 蒸馏 30 天前日志 | 用户可手动"压缩"前 N 轮(类似 GC) | cnblogs.com/fengZQ ⚠️ + TRAE SOLO 同款机制 blog.csdn.net ⚠️ |
| Manus | Wide Research sub-agent 独立 fresh context | 主 agent 拆分 + 汇总;Verify Agent 对抗测试 | manus.im ✅ |
| AutoGPT | LLM context window + Redis 工作记忆 + classic 4000 字硬限制 | 4000 字时强制要求 save important info to files | cnblogs.com ⚠️ |
| Antigravity | Session 内 rewind/checkpoint | Walkthrough Report 截图+录屏作证据 | blog.google ✅ |
| Coze 3 | {{ }} 变量引用语法 | 节点间显式传递 context | coze.cn/open/docs ✅ |
| TRAE Solo | 子 Agent 独立 context + 上下文进度条 | 手动 GC 压缩前 N 轮 | blog.csdn.net ⚠️ |
| Copilot Studio | System variables(user.Id / conversation.Id)+ topic-level/session-level/global 变量 | 三级 scope 显式管理 | learn.microsoft.com ✅ |
| Agentforce | State(短期 + 长期)+ Concierge 持久会话上下文 | Persistent Conversation Context 跨多 agent | engineering.salesforce.com ✅ |
2.3 长期记忆(跨 session)
是什么:跨多个 session 保留的用户偏好、项目状态、知识,agent 重新打开仍能"认识你"。
跨 agent 差异表:
| Agent | 长期记忆机制 | 自动 vs 手动 | 来源 |
|---|---|---|---|
| Claude Code | Auto memory(~/.claude/projects/<project>/memory/MEMORY.md 索引 + topic files);claude.ai Memory(Pro+) | 自动 + 用户说"remember this" | code.claude.com/docs/en/memory ✅ |
| ChatGPT Agent | ChatGPT Memory(自动 detect + 手动 toggle);Project prompt 共享 | 自动 detect | help.openai.com ✅ |
| Codex(ChatGPT Agent 子集) | Codex Chronicle(/memory list/add/clear) | 自动记录 build/lint/debug | platform.openai.com/codex/memories/chronicle ✅ |
| Devin | Knowledge(2000 字/entry,per-scope);Playbooks;Past session 自动学 | User/Devin 都可 add(approve 闭环) | docs.devin.ai/product-guides/knowledge ✅ |
| Qwen-Agent | MCP memory server;百炼"记忆库"自动提取关键信息 | 自动 + MCP 进程 | qwenlm.github.io ✅ + aliyun.com/bailian ✅ |
| WorkBuddy | MEMORY.md(长期)+ YYYY-MM-DD.md(当日日志);30 天日志自动蒸馏 | 自动 + 跨 Agent 记忆导入 | cnblogs.com/fengZQ ⚠️ |
| Agentforce | State 短期+长期;Data 360 Zero-Copy;Identity Resolution | CRM 原生自动 | engineering.salesforce.com ✅ |
| Antigravity | Memory Bank(企业版)+ Memory Profiles(精确调用);Global + Workspace Rules | 企业版自动;个人 workspace 手动 | cloud.google.com ✅ |
| Manus | Project 知识库(master instruction + 文件);Skills 跨 session 复用 | 用户创建 + 自动 | manus.im/docs/features/projects.md ✅ |
| Coze 3 | 用户级长期记忆(数据库 + 用户变量);Bot 知识库 | 数据库持久化 | coze.cn/open/docs ✅ |
| Copilot Studio | Dataverse(长期结构化);Work IQ(M365 上下文智能) | 自动 + admin 配 | learn.microsoft.com ✅ |
| Sierra | Agent Memory(per-customer 短期 + 长期);Customer Profile;Glossary | 自动 + 平台级 | sierra.ai ✅ |
| TRAE Solo | 人设配置 + 记忆自管理("记住这个") | 自动 + 手动 | news.qq.com ⚠️ |
| Cursor 2 | @Past Chats 跨对话引用;Plan 持久化为 .cursor/plans/ | 显式 @ | cursor.com/blog/agent-best-practices ✅ |
2.4 Knowledge base(KB)
是什么:用户上传的文档/数据,agent 检索使用,作为 LLM 知识的"外挂"。
跨 agent 差异表:
| Agent | KB 类型 | 检索方式 | 上限/容量 | 来源 |
|---|---|---|---|---|
| Claude Code | Knowledge file;Skills 资源;rules references | 全文 + MCP Resource | 单文件 200K token(WebFetch 单 URL 上限) | code.claude.com/docs ✅ |
| ChatGPT Agent | Vector store(file_search);OpenAI 托管 pgvector | 语义 + chunk 检索 | 单 store 10,000 files / 500K token/file;默认 800 token/chunk,200 overlap | platform.openai.com ✅ |
| Devin | Knowledge base(per-repo);DeepWiki living docs | Knowledge 注入到 session 起始 context | 2000 字/entry | docs.devin.ai ✅ |
| Qwen-Agent | 1M token RAG(hybrid RAG + agent-based decomposition) | hybrid RAG | needle-in-the-haystack 测试通过 | qwenlm.github.io/blog/qwen-agent-2405 ✅ |
| WorkBuddy | ima 知识库 + 腾讯乐享(企业版) + RAG_search | RAG | 由 ima/腾讯乐享决定 | news.qq.com ✅ |
| Agentforce | Knowledge Articles(向量化 + RAG)+ Data 360 Zero-Copy | Hybrid Search(关键词 + 向量) | CRM 原生,无外部 ETL | engineering.salesforce.com ✅ |
| Sierra | Knowledge Base + Glossary + 40+ 预建集成 | Context Engineering 8 种 context block + Progressive Disclosure | KB + Glossary 配 condition 激活 | sierra.ai ✅ |
| Coze 3 | 知识库(文档 RAG:PDF/Docx/TXT/网页) | RAG 切片 + 检索增强生成 | 高级专业版 500GB | coze.cn/open/docs ✅ + blog.csdn.net ⚠️ |
| Copilot Studio | SharePoint / OneDrive / Dataverse / Microsoft Graph connectors / public website / files | Azure AI Search(底层) | 由 SharePoint/OneDrive 配额 | learn.microsoft.com ✅ |
| Antigravity | Workspace 集成;Code Context Items | RAG | 由 workspace 决定 | antigravity.google/docs ✅ |
| TRAE Solo | 全仓库 RAG + 向量数据库索引(TRAE Enterprise) | 语义 + 文件级 | 10万文件 / 1.5 亿行代码,实时增量 | byteplus.com/product/trae ✅ |
| Cursor 2 | Codebase-wide semantic index(Cursor 自研) | 语义索引 | 大项目不用 Ctrl+F | cursor.com/blog/composer ✅ |
| AutoGPT | Vector store(Chroma / Pinecone / Milvus / Weaviate);Classic 本地 JSON | top_k 相似度(np.dot) | 理论无限 | blog.csdn.net ⚠️ |
| Accio Work | 阿里国际站 10亿+商品 / 5000万+企业;实时海关/汇率 | 阿里生态直连 | 26 年数据沉淀 | ai-bot.cn ⚠️ |
2.5 Project memory / Rules
是什么:项目级指令(AGENTS.md / CLAUDE.md / rules / .claude/CLAUDE.md 等),影响 agent 在该项目内的行为。
跨 agent 差异表:
| Agent | 文件格式 | 加载顺序 / 优先级 | 来源 |
|---|---|---|---|
| Claude Code | CLAUDE.md(5 层加载:Managed → User → Project → Local → Parent/Subdirs);.claude/rules/*.md(有 paths: frontmatter 按 glob 懒加载);@AGENTS.md import | 5 层递归 4 层上限;nested CLAUDE.md 不自动 re-inject | code.claude.com/docs/en/memory ✅ |
| ChatGPT Agent(Codex) | AGENTS.md(项目级自动读);.codex/rules/*.md(per-repo,配 paths:);@AGENTS.md 兼容 | team shared + commit | platform.openai.com/codex/guides/agents-md ✅ + platform.openai.com/codex/rules ✅ |
| Cursor 2 | .cursor/rules/*.md(每条 rule "always-on context" 自动读);Team Rules(admin 强制 / 推荐) | 用户级 + 项目级 + team 级 | cursor.com/blog/agent-best-practices ✅ + cursor.com/blog/enterprise ✅ |
| TRAE Solo | TRAE Rules(全局生效,团队共享) | 单层全局 | trae.cn ⚠️ |
| Antigravity | Global Rules(~/.gemini/GEMINI.md)+ Workspace Rules(.agent/rules) | 双层 | antigravity.google/docs ✅ |
| WorkBuddy | 自定义指令(类似 CLAUDE.md 最高等级);全局预设话术 | 用户级 | news.qq.com ,百炼走可视化编排) |
| — | Coze 3 | Bot 知识库;{{ }} 变量 | 节点级 |
| coze.cn/open/docs ✅ | Agentforce | Agent Script(确定性脚本);Metadata(自动读 CRM metadata) | 业务规则 + YAML 配置 |
| salesforce.com/agentforce/agent-builder ✅ |
2.6 Custom instructions / User preferences
是什么:用户级偏好(Custom Instructions / Memory / 人设配置),影响 agent 在所有对话/项目中的行为。
跨 agent 差异表:
| Agent | 配置入口 | 字符上限 | 来源 |
|---|---|---|---|
| ChatGPT Agent | Settings → Personalization → Custom Instructions | 1500 字符 | help.openai.com ✅ |
| Claude Code | claude.ai Memory(Settings → Memory) | Pro+ plan | claude.com/settings/memory ✅ |
| Codex | Project prompt + Custom Instructions | 无明示 | platform.openai.com ✅ |
| WorkBuddy | 个性化设置 → 自定义指令(类 CLAUDE.md 模板) | 由版本决定 | news.qq.com ,全局生效) |
| 无明示 | news.qq.com ⚠️ | Cursor 2 | @Past Chats 引用历史 |
| 由历史长度决定 | cursor.com/blog/agent-best-practices ✅ | Manus | Project master instruction |
| 无明示 | manus.im/docs/features/projects.md ✅ | Coze 3 | 数据库(用户变量);Persona 设置 |
| 由 plan 决定 | coze.cn/open/docs ✅ |
2.7 Context truncation / Compaction
是什么:上下文超限时如何处理 — sliding(滑动窗口)/ summarization(摘要)/ ZDR(零数据保留)。
跨 agent 差异表:
| Agent | 触发阈值 | 策略 | 用户可控 | 来源 |
|---|---|---|---|---|
| Claude Code | Sonnet 4.6 ~150K / Opus 4.7 ~700K | Skills re-attach(5000 tokens/FIFO)+ 保留 code patterns / 丢弃中间 reasoning | ✅ /compact <instructions> + Custom 规则写进 CLAUDE.md | anthropic.com ✅ |
| ChatGPT Agent | compact_threshold: 200000 | Server-side / Standalone / ZDR;Compaction item opaque | ✅ 配置参数 | platform.openai.com ✅ |
| Devin | 200K | Lossy summary;3h session timeout 自动 kill | ❌ 不可配置 | docs.devin.ai ✅ |
| Qwen-Agent | max_input_tokens 配置 | S1-S5 渐进截断 | ✅ 配置 + 5 步可调 | qwenlm.github.io ✅ |
| Antigravity | ADK 自动 | 过滤 + summarization + lazy-load artifacts | ✅ 部分 | google.github.io/adk-docs/context/caching ✅ |
| TRAE Solo | 用户触发 | 智能压缩 + 手动 GC 压缩前 N 轮 | ✅ 手动进度条 | blog.csdn.net ⚠️ |
| WorkBuddy | 262K 实测上限 | 上下文超限触发熔断 + Error 400 + 外部通道失效 ⚠️ | ❌ 无自动熔断 | cloud.tencent.com ⚠️ 开发者社区工单 |
2.8 RAG(向量 / 关键词 / 混合)
是什么:检索增强生成的实现方式 — 把外部知识喂给 LLM 的工程化路径。
跨 agent 差异表:
| Agent | 检索方式 | Chunk 策略 | 混合方式 | 来源 |
|---|---|---|---|---|
| ChatGPT Agent | file_search(vector store) | 默认 800 token / chunk,200 overlap | ranking_options.ranker: "auto" 混合(semantic + lexical) | platform.openai.com ✅ + platform.openai.com/docs/guides/retrieval ✅ |
| Agentforce | Data 360 Hybrid Search | N/A | 关键词 + 向量检索融合 | engineering.salesforce.com ✅ |
| Qwen-Agent | 1M token RAG(hybrid + agent decomposition) | needle-in-the-haystack 测试通过 | hybrid + agent-based decomposition | qwenlm.github.io ✅ |
| Sierra | Context Engineering 8 block | 按 condition 激活;Progressive Disclosure | state-based + observation-based condition | sierra.ai ✅ |
| Cursor 2 | Codebase-wide semantic index | Cursor 自研 RAG 索引 | semantic + grep strings | cursor.com/blog/composer ✅ |
| AutoGPT | Vector store + get_relevant | top_k(np.dot) | 向量为主 | cnblogs.com ⚠️ |
| Copilot Studio | Azure AI Search(底层) | SharePoint / OneDrive / Dataverse 原生索引 | 由 Azure AI Search 提供 | learn.microsoft.com ✅ |
| Antigravity | Workspace + KI(Knowledge Items) | Agentic RAG,AI 行动前查 KI 摘要 | Good/Bad examples 对比式少样本提示 | m.163.com ⚠️ |
2.9 Session persistence / Resume
是什么:session 中断后能否续上 / 跨设备接续,以及 session transcript / artifacts 的持久化。
跨 agent 差异表:
| Agent | Resume 机制 | 跨设备同步 | 持久化存储 | 来源 |
|---|---|---|---|---|
| Claude Code | claude --continue(最近)/ --resume(列表选)/ --resume <id>;/rename <name>;cleanupPeriodDays(默认 30 天);Esc + Esc /rewind 5 选项 | ✅ Teleport(web/iOS ↔ local CLI);Dispatch(mobile → Desktop);Remote Control | ~/.claude/sessions/<id>.jsonl(本机) | anthropic.com ✅ + code.claude.com/docs/en/overview ✅ |
| ChatGPT Agent | Codex --resume / --resume <id>;ChatGPT history 跨设备 | ✅ Chat history 跨 device sync(Web/iOS/Android) | OpenAI 端 60 天(Assistants thread) | platform.openai.com ✅ + help.openai.com ✅ |
| Devin | Cancel 后可恢复(企业版);3h session timeout 自动 sleep/wake;Replay URL | ❌ | app.devin.ai/sessions/<id>(audit-ready format) | docs.devin.ai ✅ |
| Manus | Mail Manus(专属邮箱);任务结束 state 保留(云端 persistent file system);Replay URL | ✅ Mail Manus + Scheduled Tasks 组合 | 云端 VM 文件系统持久 | manus.im ✅ + manus.im ✅ |
| TRAE Solo | 桌面端 ↔ 网页端多端同步(Remote 任务后台异步) | ✅ 桌面 + 网页 + 云端算力 | 任务列表持久化 | blog.csdn.net ⚠️ |
| Cursor 2 | .cursor/plans/ markdown 持久化 plan;Cloud Agent(异步长任务) | ✅ cursor.com/agents;Mobile app;IDE ↔ CLI | plan 文件 | cursor.com/blog/agent-best-practices ✅ |
| Antigravity | /resume 命令跨 CLI ↔ GUI 同步会话 | ✅ Antigravity CLI /resume;Session Sinking | 由 workspace 决定 | juejin.cn ⚠️ |
| WorkBuddy | 任务列表持久化(左侧);Checkpoints 会话状态快照;锁屏远程 | ✅ 微信小程序双模式(云端工作 / 连接电脑) | 由版本决定 | news.qq.com 。com/sswb/1762906.html](https://www.aliyun.com/sswb/1762906.html) ✅ |
| Agentforce | Persistent Conversation Context 跨多 agent | ✅ Enterprise-wide | CRM Data 360 | engineering.salesforce.com ✅ |
| Copilot Studio | Session record(30 天,CSV 导出:SessionID/StartDateTime/InitialUserMessage/TopicName/ChatTranscript) | ❌ | 由 admin 配 retention | learn.microsoft.com ✅ |
| AutoGPT | 断点续执行(PostgreSQL 状态持久化) | ❌ | PostgreSQL + Redis volume | blog.csdn.net ⚠️ |
| Coze 3 | 历史对话保存 + 复用 | ✅ 跨端同步(Mac/Windows/网页) | 由 plan 决定 | coze.cn/open/docs ✅ + news.qq.com ✅ |
| Sierra | Replan / Replay URL(每个 Wide Research 任务公开) | ❌ | Sierra 云端 | manus.im/docs/features/wide-research.md ✅ |
3. 横向对比总表
| Agent | Context window | 短期记忆 | 长期记忆 | Project rules | Custom instr | KB/RAG | Compaction | Resume |
|---|---|---|---|---|---|---|---|---|
| Claude Code | 200K / 1M (Sonnet 4.6+/Opus 4.7+) | 完整 + checkpoint | auto memory + claude.ai Memory | CLAUDE.md 5 层 + Rules | claude.ai Memory | Knowledge file + Skills refs | Auto 150K/700K + /compact | ✅ --continue/--resume + Teleport |
| ChatGPT Agent | 1M(GPT-5.5)/ 272K-1M(5.4)/ 200K(o3)/ 128K(4o) | compaction item + carry state | ChatGPT Memory + Project prompt | AGENTS.md + Codex Rules | Custom Instructions(1500 字) | file_search vector store | server-side/standalone/ZDR | Codex --resume + Chat history 跨设备 |
| Devin | 200K(SWE-1.6/Opus)/ 1M(Gemini 2.5 Pro) | session transcript + 3h timeout | Knowledge(2000 字/entry)+ Playbooks | Knowledge per-repo | ❌ | Knowledge + DeepWiki | Lossy summary + 3h kill | ✅ Cancel resume(企业) |
| Qwen-Agent | 1M(qwen3-max) | messages 数组 + 流式 | MCP memory server + 百炼记忆库 | ❌(无 project rules) | 百炼 persona | 1M token hybrid RAG | 5 步渐进截断 S1-S5 | ❌ |
| WorkBuddy | 262144(实测上限) | 对话历史 + 30 天蒸馏 | MEMORY.md + 跨 Agent 导入 | 自定义指令(类 CLAUDE.md) | 全局预设话术 | ima 知识库 + 腾讯乐享 | 上下文超限触发熔断 ⚠️ | ✅ 任务列表 + Checkpoints |
| Google Antigravity | 2M(Gemini 3 实验版)/ 1M(主推) | Session + Walkthrough Report | Memory Bank + Memory Profiles(企业) | Global + Workspace Rules | ❌ | Workspace + KI Agentic RAG | ADK 自动 + Context Offloading | ✅ /resume + Session Sinking |
| Agentforce | 200K(常用) | State 短期+长期 | CRM Data 360 Zero-Copy | Agent Script + Metadata | Einstein Memory | Data 360 Hybrid Search | Data 360 | Persistent Context 跨多 agent |
| Cursor 2 | 200K+ | Composer model 工具调用 | @Past Chats | .cursor/rules/ + Team Rules | ❌ | Codebase-wide semantic index | 自动 summarization | .cursor/plans/ 持久化 |
| Coze 3 | 256K | {{ }} 变量引用 | 数据库 + 用户变量 | Bot 知识库 | Persona | 知识库(RAG) | ❌ | ✅ 跨端同步(Mac/Win/网页) |
| Copilot Studio | 由底层模型决定 | System + 3 级 scope 变量 | Dataverse + Work IQ | topic-level/session/global 变量 | ❌ | SharePoint/OneDrive/Dataverse + Graph | ❌ | Session record(30 天,CSV) |
| TRAE Solo | 200K | 子 Agent 独立 context | 人设配置 + 记忆自管理 | TRAE Rules | 人设配置 | 全仓库 RAG(Enterprise) | 智能压缩 + 手动 GC | ✅ 桌面/网页/云端多端 |
| Sierra | 由 LLM constellation 决定 | session 内 | Agent Memory + Customer Profile + Glossary | Journeys(Goal + Guardrails) | Ghostwriter | KB + Glossary + 40+ 集成 | Conditional Context Activation | Replay URL(每 Wide Research) |
| Manus | 由模型决定 | Wide Research 独立 fresh context | Project master instruction | Project 共享 | Master instruction | Cloud Browser + MCP | Verify Agent 对抗测试 | ✅ Mail Manus + 云端持久 |
| AutoGPT | 128K(GPT-4) | ReAct loop + Redis 工作记忆 | Vector store(Chroma/Pinecone)+ Classic JSON | Goals file | ❌ | Vector store | Classic 4000 字硬限制 + auto save | ✅ PostgreSQL 断点续 |
| Accio Work | 国产大模型配置 | 每 Agent 独立 context + 主 Agent 协调 | 26 年阿里数据沉淀(10亿+商品 / 5000万+企业) | ❌ | ❌ | 阿里国际站实时数据 | Validator 层 | ❌ |
4. 选型建议
按使用场景选型:
| 场景 | 首选 | 备选 | 关键理由 |
|---|---|---|---|
| 超长文档问答(1M+) | Qwen-Agent 1M RAG / Antigravity | Claude Sonnet 4.6+(1M) / GPT-5.5(1M) | needle-in-the-haystack 测试通过 + hybrid RAG |
| 代码项目长 session | Claude Code(Teleport + Rewind + Worktree 隔离) | Cursor 2(Cloud Agent + git worktree) | 完整 CLAUDE.md 5 层 + checkpoint 5 选项 + auto-compaction 分档 |
| 跨会话项目记忆 | Claude Code auto memory / Codex Chronicle | Devin Knowledge + Playbook | 自动 + 显式 / +AGENTS.md 兼容 |
| 企业数据接入(CRM/数据湖) | Agentforce Data 360 | Copilot Studio(Dataverse + Graph connectors) | Zero-Copy + Hybrid Search + Identity Resolution |
| 代码库语义搜索 | Cursor 2 Codebase-wide semantic index | TRAE Enterprise(10万文件/1.5亿行) | 自研 RAG / 实时增量 |
| 客服场景(按 condition 激活) | Sierra Context Engineering 8 block + Progressive Disclosure | Agentforce KB + RAG | 按 state/observation 条件激活,避免 token 爆炸 |
| 国内合规 + 国产大模型 | Qwen-Agent / WorkBuddy / Coze 3 | TRAE Solo(国内版完全免费) | 信通院可信 / TC260 合规 / 私有化 |
| 长 session 超 3h | Manus(Mail Manus + Replay URL) | Devin(3h timeout + auto sleep/wake) | 云端 VM 持久 + 异步邮件触发 |
| 多设备同步办公 | Claude Code(Teleport) | TRAE Solo / WorkBuddy(微信小程序) | 跨 Web/iOS/CLI/Desktop 共享 engine |
| 开源自托管 | AutoGPT(Classic / Platform) | Qwen-Agent(Apache 2.0) | 数据自主可控 + Agent Protocol 标准 |
- 2026-06-23 初版建立
2. 触发与自动化
10 模块知识库第 2 篇——讲 agent 在没有用户主动输入时,如何被外部信号、时间表、事件、消息通道叫醒并执行。覆盖 Hook / Schedule / Cron / Webhook / Channel / Background task / Routine / Loop / API trigger 9 个子能力。
4. 工具与协议
10 模块知识库第 4 篇——讲 agent 怎么调用外部能力:Function Calling / MCP 协议 / Tool market / Browser Use / Computer Use 5 大工具范式,以及 Anthropic / OpenAI / Google 三大协议生态。