Core Insights - Context engineering has emerged as a critical concept in agent development, addressing the challenges of managing extensive context generated during tool calls and long horizon reasoning, which can hinder agent performance and increase costs [2][4][7] - The concept was introduced by Andrej Karpathy, emphasizing the importance of providing the right information at the right time to enhance agent efficiency [4][5] - Context engineering encompasses five main strategies: Offload, Reduce, Retrieve, Isolate, and Cache, which aim to optimize the management of context in AI agents [3][14] Group 1: Context Engineering Overview - Context engineering is seen as a subset of AI engineering, focusing on optimizing the context window for LLMs during tool calls [5][7] - The need for context engineering arises from the limitations of prompt engineering, as agents require context from both human instructions and tool outputs [7][14] - A typical task may involve around 50 tool calls, leading to significant token consumption and potential performance degradation if not managed properly [7][8] Group 2: Strategies for Context Management - Offload: This strategy involves transferring context information to external storage rather than sending it back to the model, thus optimizing resource utilization [15][18] - Reduce: This method focuses on summarizing or pruning context to eliminate irrelevant information while being cautious of potential data loss [24][28] - Retrieve: This strategy entails fetching relevant information from external resources to enhance the context provided to the model [38][40] - Isolate: This approach involves separating context for different agents to prevent interference and improve efficiency [46][49] - Cache: Caching context can significantly reduce costs and improve efficiency by storing previously computed results for reuse [54][56] Group 3: Practical Applications and Insights - The implementation of context engineering strategies has been validated through various case studies, demonstrating their effectiveness in real-world applications [3][14] - Companies like Manus and Cognition have shared insights on the importance of context management, emphasizing the need for careful design in context handling to avoid performance issues [29][37] - The concept of "the Bitter Lesson" highlights the importance of leveraging computational power and data to enhance AI capabilities, suggesting that simpler, more flexible approaches may yield better long-term results [59][71]
超越 Prompt 和 RAG,「上下文工程」成了 Agent 核心胜负手
海外独角兽·2025-09-17 12:08