Workflow
生成式 Agent
icon
Search documents
Karpathy:我不是要造新词,是「上下文工程」对 Agent 来说太重要了
Founder Park· 2025-07-04 13:10
Core Viewpoint - The concept of "Context Engineering" has gained traction in the AI industry, emphasizing that the effectiveness of AI applications relies more on the quality of context provided than on the prompts used to query the AI [1][3]. Group 1: Definition and Importance of Context Engineering - Context Engineering is defined as the discipline of designing and constructing dynamic systems that provide appropriate information and tools to large language models (LLMs) at the right time and in the right format [19]. - The quality of context provided to an AI agent is crucial for its effectiveness, surpassing the complexity of the code or framework used [24]. - A well-constructed context can significantly enhance the performance of AI agents, as demonstrated by examples where rich context leads to more relevant and useful responses [25]. Group 2: Components of Context Engineering - Context Engineering encompasses various elements, including prompt engineering, current state or dialogue history, long-term memory, and retrieval-augmented generation (RAG) [15][11]. - The distinction between prompts, prompt engineering, and context engineering is clarified, with prompts being the immediate instructions given to the AI, while context engineering involves a broader system that dynamically generates context based on task requirements [15][19]. Group 3: Strategies for Implementing Context Engineering - Four common strategies for implementing Context Engineering are identified: writing context, selecting context, compressing context, and isolating context [26]. - Writing context involves saving information outside the context window to assist the agent in completing tasks, such as maintaining a calendar or email history [28][29]. - Selecting context refers to pulling necessary information into the context window to aid the agent, which can include filtering relevant memories or examples [36][38]. - Compressing context focuses on retaining only the essential tokens needed for task execution, often through summarization techniques [43][44]. - Isolating context involves distributing context across multiple agents or using environments to manage context effectively, enhancing task focus and reducing token consumption [47][50].