Context Engineering
现代 Agent Engineering 学习路线:Context Engineering
0 子目录7 文档
文档
7Context Engineering 总览Context Engineering 总览 Freshness metadata last verified : 2026 08 24 version scope : provider neutral context architecture source type : official docs + engineering synthesis stability : version sensitive Context EngineeContext:模型本轮真正看到的信息Context:模型本轮真正看到的信息 Context 是一次模型调用输入中的信息集合,包括系统指令、用户消息、最近对话、工具定义、工具结果、检索片段、任务状态和运行时提示。它不是 Memory 的同义词,而是 Memory 被选择和装配后的 当前工作集 。 1. Context 的组成 不同层有优先级、可信度和生命周期。网页内容、文件内容属于数据,不能与系统规则混在同一语义层。 2. Context Engineering 核心不是“Input Context Builder:把多源状态装配成一次模型请求Input Context Builder:把多源状态装配成一次模型请求 所谓 “input 大拼接 prompt” 如果只是把规则、聊天记录、工具说明、检索结果和日志依次连接,系统会很快遇到冲突、重复、协议断裂和 token 浪费。生产级 Context Builder 应把多源信息建模成 有类型、有信任层、有预算、有来源的本轮状态投影 。 1. Context Builder 的输入与输出 输入是各模块的权威状态,不是一份已经拼好的Context Manifest 与 Context AssemblyContext Manifest 与 Context Assembly Freshness metadata last verified : 2026 08 24 version scope : provider neutral context architecture source type : engineering synthesis stability : stable concept 1. Manifest 是装配计划,不是最Token Budget、Compaction、Prompt Cache 与 HistoryToken Budget、Compaction、Prompt Cache 与 History Freshness metadata last verified : 2026 08 24 version scope : provider neutral; cache APIs vary by provider source type : official provider docs + engineering synthesis stabJIT Retrieval 与 Progressive DisclosureJIT Retrieval 与 Progressive Disclosure Freshness metadata last verified : 2026 08 24 version scope : stable retrieval patterns source type : engineering synthesis stability : stable concept JIT Retrieval 在产生具体信息需求后再检索; PContext Trust Boundary 与 Prompt Injection BoundaryContext Trust Boundary 与 Prompt Injection Boundary Freshness metadata last verified : 2026 08 24 version scope : 2026 prompt injection threat model source type : official security guidance + engineering synthesis stabili