This commit is contained in:
2026-06-01 10:46:01 +08:00
parent 2faf4bb002
commit e96b955fda
221 changed files with 10219 additions and 332 deletions

View File

@@ -0,0 +1,41 @@
---
title: "Context Engineering上下文工程"
created: 2026-05-30
updated: 2026-05-30
type: concept
tags: [context, engineering, agent]
sources: [[agent-harness-engineering-survey]]
confidence: high
---
# Context Engineering
> 三阶段工程演进的第二阶段2025从优化单次模型输入到管理多步推理中模型每步可见的完整信息状态。
## 核心转变
Context Engineering 的关键转变在于从"输入是什么"到"模型在每一步应该看到什么"。
## 指导原则
找到**最小的高信号 token 集**最大化每一步期望结果的概率Anthropic Applied AI Team, 2025
## 三大技术支柱
- **渐进式披露**Progressive Disclosure按需加载信息而非全量预加载
- **压缩**Compaction移除已完成使命的 token
- **记忆检索**:只拉入与当前任务最相关的记录
## 上下文包含的内容
在部署的 Agent 中,上下文包括:系统 prompt + 工具定义 + 历史轮次 + 工具调用结果 + 检索文档 + 动态注入的工作状态。所有这些都在争抢有限的注意力预算。
## 三阶段定位
Context Engineering 位于 [[three-engineering-phases|三阶段工程演进]] 的中层——它包含 Prompt Engineering 的实践,同时被 [[agent-harness-engineering|Harness Engineering]] 所扩展。
## 相关概念
- [[three-engineering-phases]] — 三阶段工程演进
- [[context-management]] — C 层:短/中/长期上下文管理
- [[context-drift]] — 上下文漂移的三种退化机制
- [[prompt-to-harness-evolution]] — 详细演化分析