文章大纲
简介
中文:智能体需要上下文才能执行任务。上下文工程就是在每一步把恰好合适的信息塞进有限的上下文窗口的艺术与科学。本文用「写-选-压-隔」四大策略拆解主流做法,并展示如何用 LangGraph 落地。
EN: Agents need context to perform. Context engineering is the art & science of filling the context window with exactly the right information at each step. We break it down into four patterns—write, select, compress, isolate—and show how to implement them with LangGraph.
上下文工程是什么? What is Context Engineering?
中文:
Andrej Karpathy 把 LLM 比作新型操作系统:
- LLM ≈ CPU
- 上下文窗口 ≈ RAM
操作系统必须精挑细选地加载内存;同理,上下文工程就是“把 RAM 填满正确内容”的过程。