Stage 5: Exploration of AI Application Scenarios
Chinese-English translation of Agentic Design Patterns, covering 21 AI agent design patterns, including core architectural methods such as prompt chaining, routing, and multi-agent collaboration, with Python code examples.
Agentic Design Patterns - Detailed Learning Resource for Intelligent Agent Design Patterns
📚 Course Overview
"Agentic Design Patterns: A Hands-On Guide to Building Intelligent Systems" is a comprehensive technical guide written by Antonio Gulli, Senior Director and Distinguished Engineer in the Google CTO's office, focusing on building intelligent, autonomous AI agent systems.
This 424-page practical guide covers the core concepts and practical methods of agent design in modern artificial intelligence systems. Through 21 battle-tested design patterns, the book helps developers build complex agent systems from scratch.
Author Background
- Name: Antonio Gulli
- Position: Senior Director and Distinguished Engineer, Google CTO's Office
- Experience: Over 30 years of experience in AI, search, and cloud technologies
- Education: Ph.D. in Computer Science from the University of Pisa, Italy
- Other Works: "Deep Learning with Keras"
Version Information
- Original Publisher: Springer
- Total Pages: 424 pages
- Release Date: December 3, 2025
- Chinese Translation: Bilingual (Chinese-English) translation provided by ginobefun
- Public Welfare Nature: All royalties from the original book will be donated to Save the Children
🎯 Learning Objectives
This course aims to help learners:
- Understand the core concepts of agent systems - Grasp what makes an AI system a true "agent."
- Master 21 design patterns - Learn a complete technical stack from basic to advanced.
- Practice hands-on coding - Understand the implementation of each pattern through practical code examples.
- Build production-grade systems - Learn how to combine patterns to create complex autonomous systems.
- Understand best practices - Gain battle-tested solutions and architectural designs.
📖 Core Content Structure
Front Matter
- Dedication
- Acknowledgment
- Foreword
- A Thought Leader's Perspective
- Introduction
- What makes an AI system an "agent"?
21 Core Design Patterns
Foundational Patterns (Chapters 1-5)
Chapter 1: Prompt Chaining
- Concept: A divide-and-conquer task decomposition pattern.
- Principle: Breaks down complex tasks into a series of smaller, more manageable sub-problems.
- Application: Each sub-problem is solved independently with a specially designed prompt, where the output of the previous step serves as the input for the next.
- Value: Forms a clear, logical processing pipeline.
Chapter 2: Routing
- Concept: Intelligent decision-making and dynamic distribution.
- Principle: Selects the appropriate action path based on environmental state, user input, or execution results.
- Application: Decides which functional module, tool, or sub-process to hand a request to.
- Value: Equips the agent with dynamic decision-making capabilities.
Chapter 3: Parallelization
- Concept: Concurrent execution and performance enhancement.
- Principle: Executes multiple independent tasks simultaneously to improve efficiency and response speed.
- Application: Transforms sequential waiting operations into concurrent execution.
- Value: A key technique for optimizing complex workflow performance.
Chapter 4: Reflection
- Concept: Self-assessment and iterative improvement.
- Principle: Continuously optimizes output quality by introducing feedback loops.
- Application: The agent reviews its own work, identifies issues, and generates improved versions.
- Value: A self-optimization mechanism to enhance output quality.
Chapter 5: Tool Use
- Concept: Integration of external tools and APIs.
- Principle: Extends the agent's capabilities.
- Application: Calls external APIs, databases, computational tools, etc.
- Value: Enables the agent to perform real-world actions.
Intermediate Patterns (Chapters 6-11)
Chapter 6: Planning
- Concept: Multi-step plan formulation and execution.
- Application: Strategic planning for complex tasks.
Chapter 7: Multi-Agent Collaboration
- Concept: Collaborative work architecture.
- Application: Multiple agents working together to complete complex tasks.
Chapter 8: Memory Management
- Concept: Short-term and long-term memory management.
- Application: Context preservation and historical information retrieval.
Chapter 9: Learning and Adaptation
- Concept: Learning from experience.
- Application: Agents continuously improve and adapt.
Chapter 10: Model Context Protocol (MCP)
- Concept: Standardized interaction protocol.
- Application: Standardized communication between agents.
Chapter 11: Goal Setting and Monitoring
- Concept: Dynamic goal management.
- Application: Goal tracking and progress monitoring.
Advanced Patterns (Chapters 12-21)
Chapter 12: Exception Handling and Recovery
- Concept: Graceful error handling.
- Application: System fault tolerance and recovery.
Chapter 13: Human-in-the-Loop
- Concept: Human-AI collaborative decision-making.
- Application: Human intervention at critical decision points.
Chapter 14: Knowledge Retrieval (RAG)
- Concept: Retrieval-Augmented Generation technique.
- Application: Dynamic knowledge base integration.
Chapter 15: Inter-Agent Communication (A2A)
- Concept: Agent communication protocols.
- Application: Distributed agent systems.
Chapter 16: Resource-Aware Optimization
- Concept: Resource optimization management.
- Application: Balancing cost and performance.
Chapter 17: Reasoning Techniques
- Concept: Enhanced reasoning capabilities.
- Application: Complex logical inference.
Chapter 18: Guardrails/Safety Patterns
- Concept: Safety assurance mechanisms.
- Application: Ensuring safe and controllable agent behavior.
Chapter 19: Evaluation and Monitoring
- Concept: Performance evaluation system.
- Application: System quality measurement and monitoring.
Chapter 20: Prioritization
- Concept: Task priority management.
- Application: Resource allocation and task scheduling.
Chapter 21: Exploration and Discovery
- Concept: Autonomous exploration mechanisms.
- Application: Discovery of new knowledge and solutions.
Appendices
Appendix A: Advanced Prompting Techniques
- In-depth prompting engineering tips.
Appendix B: AI Agents: From Graphical Interfaces to Real-World Environments
- Applications of agents in different environments.
Appendix C: Quick Overview of Agent Frameworks
- Comparison and selection guide for mainstream frameworks.
Appendix D: Building Agents with AgentSpace
- Practical tutorial for the AgentSpace platform.
Appendix E: AI Agents in the Command Line
- Agent development in CLI environments.
Appendix F: Deep Dive: Inside the Agent Reasoning Engine
- Technical details of reasoning engines.
Appendix G: Coding Agents
- Code generation and programming assistance agents.
💻 Technical Frameworks
This book uses three mainstream agent development frameworks as its practical "canvas":
1. LangChain & LangGraph
- Features: Flexible construction of complex operational sequences.
- Advantages: Mature ecosystem, rich component library.
- Applications: Suitable for rapid prototyping and complex process orchestration.
2. Crew AI
- Features: Structured multi-agent orchestration framework.
- Advantages: Focuses on team collaboration patterns.
- Applications: Suitable for building collaborative agent teams.
3. Google Agent Developer Kit (Google ADK)
- Features: A complete development toolkit provided by Google.
- Advantages: Full lifecycle support for building, evaluating, and deploying.
- Applications: Suitable for enterprise-grade application development.
👥 Target Audience
1. AI Engineers
- Learn to build intelligent, reliable AI systems.
- Master production-grade agent development skills.
2. Software Architects
- Understand agent component system design.
- Learn large-scale system architectural patterns.
3. Product Managers
- Understand agent technology capabilities and limitations.
- Better plan AI product features.
4. Researchers
- Learn the latest agent design methods.
- Gain inspiration for research directions.
5. Students
- Systematically learn artificial intelligence and agent systems.
- Lay the foundation for a future AI career.
🚀 How to Use This Resource
Suggested Learning Paths
1. Sequential Reading Path (Recommended for Beginners)
- Read the front matter first to understand basic concepts.
- Learn the 21 design patterns in chapter order.
- Later chapters build on earlier foundations, progressing step-by-step.
2. Topic-Oriented Path (For Experienced Developers)
- Foundational Building: Chapters 1-5
- Collaboration & Memory: Chapters 6-8
- Advanced Functionality: Chapters 9-17
- Safety & Monitoring: Chapters 18-19
- Optimization Techniques: Chapters 20-21
3. Practice-First Path
- Quickly browse the theoretical sections.
- Directly run code examples.
- Refer back to theory for deeper understanding when encountering issues.
- Modify code for experimentation.
4. Reference Manual Mode
- Use this book as a design pattern reference manual.
- Consult relevant chapters when facing specific problems.
- Engage in community participation and discussions.
🛠️ Setting Up the Practice Environment
Local Environment Setup
1. Clone Repository
git clone https://github.com/ginobefun/agentic-design-patterns-cn.git
cd agentic-design-patterns-cn
2. Create Virtual Environment (Recommended)
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# macOS/Linux:
source venv/bin/activate
# Windows:
venv\Scripts\activate
3. Install Dependencies
pip install langchain langchain-community langchain-openai langgraph
4. Configure API Key
Create a .env file:
touch .env
Add to the .env file:
# OpenAI API Key
OPENAI_API_KEY=your-openai-api-key-here
# Or use OpenRouter (compatible with OpenAI API)
OPENAI_API_KEY=your-openrouter-api-key-here
OPENAI_API_BASE=https://openrouter.ai/api/v1
5. Run Example Code
# Ensure virtual environment is activated
source venv/bin/activate
# Run Chapter 1 example: Prompt Chaining
python codes/Chapter-01-Prompt-Chaining-Example.py
# Run other chapter codes
# python codes/Chapter-XX-Example.py
Online Environment (Google Colab)
- Each code example file includes a Google Colab link.
- Can be run directly online without local configuration.
- Suitable for quick experiments and learning.
Important Notes
- 🔑 API Key Security: Never commit
.envfiles containing real API keys to version control. - 💰 API Costs: Running the code will incur API call costs; please monitor usage.
- 🌐 Network Connection: Requires a network connection to access LLM API services.
- 🔄 Compatibility: Supports OpenAI API and OpenAI API-compatible services (e.g., OpenRouter).
📝 Translation Guidelines
Formatting Characteristics
- Highlighting: Chinese content uses
<mark>text</mark>for yellow highlighting. - Bilingual Comparison: English paragraphs are immediately followed by their Chinese translation.
- Terminology: Important terms retain their English form, with Chinese in parentheses.
- Spacing Rules: Spaces are added between Chinese and English, and between numbers.
Translation Principles
- Accuracy: 100% faithful to the original meaning.
- Fluency: Conforms to natural Chinese expression.
- Professionalism: Maintains the rigor of technical documentation.
- Consistency: Terminology translation is consistent throughout.
🌟 Core Value and Features
1. Systemic and Comprehensive
- 21 design patterns covering all aspects of agent development.
- A complete learning path from foundational to advanced.
- Theory and practice are closely integrated.
2. Practice-Oriented
- Each chapter provides practical, runnable code examples.
- Real-world implementations based on mainstream frameworks.
- Directly applicable to production environments.
3. Multi-Framework Support
- LangChain/LangGraph examples.
- Crew AI examples.
- Google ADK examples.
- Learn universal patterns across frameworks.
4. Free and Open
- Original book is freely available.
- Chinese translation is open source.
- Community-driven for continuous improvement.
5. Authoritative
- Author is a senior expert from Google CTO's office.
- Possesses 30 years of industry experience.
- Content is battle-tested.
🤝 Community Involvement
How to Contribute
- Error Reports - Report translation errors or formatting issues.
- Translation Improvements - Provide better translation suggestions.
- Chapter Translation - Participate in translating unfinished chapters.
- Proofreading and Review - Help proofread translated chapters.
Contribution Process
- Fork this repository.
- Create a feature branch (
git checkout -b feature/your-contribution). - Commit your changes (
git commit -m 'Add: your contribution'). - Push to the branch (
git push origin feature/your-contribution). - Create a Pull Request.
📚 Related Resources
Official Links
- Original Book Link: Amazon
- Original Document: Google Docs
- Chinese Translation Repository: GitHub
- Author's LinkedIn: Antonio Gulli
Framework Documentation
- LangChain: https://python.langchain.com/
- LangGraph: https://langchain-ai.github.io/langgraph/
- Crew AI: https://www.crewai.com/
- Google ADK: Refer to Appendix D
💡 Learning Suggestions
Beginners
- Start with the front matter to understand the basic concepts of agents.
- Focus on learning the first 5 foundational patterns.
- Run the code examples at least once for each chapter.
- Try modifying code parameters to observe the effects.
- Learn advanced patterns after understanding the basics.
Intermediate Developers
- Quickly browse the foundational chapters.
- Focus on learning intermediate and advanced patterns in Chapters 6-14.
- Attempt to combine multiple patterns to solve real-world problems.
- Study advanced techniques in the appendices.
- Participate in community discussions and contributions.
Advanced Developers
- Use this book as a reference manual.
- Focus on pattern combination and architectural design.
- Study framework source code implementations.
- Contribute new examples and best practices.
- Mentor others in their learning journey.
🎓 Learning Outcomes
Upon completing this course, you will be able to:
- ✅ Understand Agent System Architecture - Master the core concepts and design principles of agents.
- ✅ Implement 21 Design Patterns - Independently implement various agent design patterns.
- ✅ Choose Appropriate Frameworks - Select and use development frameworks based on requirements.
- ✅ Build Complex Systems - Combine multiple patterns to build production-grade agent systems.
- ✅ Optimize and Debug - Evaluate, monitor, and optimize agent performance.
- ✅ Ensure Security - Implement safety guardrails and error handling mechanisms.
- ✅ Team Collaboration - Design and implement multi-agent collaborative systems.
📄 Copyright Information
Original Book Copyright
- Author: Antonio Gulli
- Publisher: Springer
- Copyright: Original book copyright belongs to the author and publisher.
- Public Welfare Nature: All royalties are donated to Save the Children.
Translation Copyright
- Translator: ginobefun
- License: CC BY-NC 4.0
- Purpose: Solely for learning and exchange, promoting the development of the Chinese AI community.
Usage Restrictions
- ✅ Allowed: Free to copy, distribute, display, and adapt the work (with attribution to the translator).
- ❌ Prohibited: Any form of commercial use.
- 📧 Commercial Collaboration: For commercial use, please contact the translator and the original copyright holder.
🌈 Summary
"Agentic Design Patterns" is a systematic, comprehensive, and practice-oriented guide to agent development. It not only provides 21 battle-tested design patterns but also includes rich code examples and best practices. Whether you are an AI engineer, a software architect, or a learner interested in agent technology, this book will provide you with invaluable knowledge and practical experience.
By studying this book, you will master the core skills required to build intelligent, autonomous, and reliable AI systems, preparing you to build the next generation of applications in the AI era.
Let's build a smarter future together! 🚀