Workflow
季逸超亲述 Manus 构建之谜,一文读懂 AI 智能体的上下文工程
AI科技大本营·2025-07-21 10:08

Core Insights - The article emphasizes the importance of context engineering in building AI agents, highlighting practical lessons learned from the Manus project [1][2][3] Group 1: Context Engineering - Manus decided to focus on context engineering rather than traditional end-to-end training of agents, significantly reducing product improvement cycles from weeks to hours [3] - The practice of context engineering is described as an experimental science, with Manus having restructured its agent framework multiple times to discover better methods for shaping context [3][4] Group 2: Key Metrics - The KV cache hit rate is identified as the most critical metric for production-level AI agents, directly impacting latency and cost [5] - Manus has achieved a significant cost reduction by utilizing KV caching, with cached input tokens costing $0.30 per million tokens compared to $3 per million for uncached tokens, representing a tenfold difference [8] Group 3: Action Space Management - To manage the complexity of the action space, Manus employs a masking technique to control tool availability without removing them, thus preventing confusion in the model [15][18] - The article advises against dynamically adding or removing tools during iterations, as it can invalidate the KV cache and disrupt the agent's performance [12][13] Group 4: Memory and Context Management - Manus treats the file system as an external context, allowing for unlimited capacity and persistent storage, which helps manage the challenges of context length limitations [23][26] - The strategy of keeping failed attempts in context is highlighted as a method to improve the agent's learning and reduce the likelihood of repeating mistakes [35] Group 5: Attention Control - Manus employs a mechanism of recitation by maintaining a todo.md file that updates throughout task execution, helping the model stay focused on core objectives [27][31] - The article warns against the pitfalls of few-shot prompting, which can lead to behavioral rigidity in agents, suggesting the introduction of diversity in actions and observations to maintain flexibility [36][38] Conclusion - Context engineering is presented as a foundational aspect of successful agent systems, with the design of memory, environment, and feedback being crucial for the agent's performance and adaptability [39][40]