A comprehensive visual and textual documentation of 21 essential agentic design patterns for building intelligent AI systems with its code examples using langchain and opensource models.
This repository contains four main types of documentation for each pattern:
Visual flowcharts in plain English showing how each pattern works, designed to be easily understood without technical jargon.
Detailed explanations covering:
- When to use each pattern
- Where it fits in your architecture
- Concise pattern definitions
- Pros and cons
- Implementation considerations
- Embedded Mermaid diagrams
Text-based diagrams perfect for copying into Miro boards, documentation, or anywhere that doesn't support rich graphics.
Runnable examples implementing each pattern with LangChain and NVIDIA NIM endpoints. See Running the Code to get started.
Available so far: Prompt Chaining - more examples in progress.
- Prompt Chaining - Breaking complex tasks into sequential steps
- Routing - Directing requests to the right handler
- Parallelization - Running multiple tasks simultaneously
- Reflection - Self-evaluation and improvement
- Tool Use - Integrating external capabilities
- Planning - Strategic task decomposition
- Multi-Agent Collaboration - Coordinating multiple agents
- Memory Management - Storing and retrieving context
- Learning and Adaptation - Improving over time
- Model Context Protocol - Standardized agent communication
- Goal Setting and Monitoring - Tracking objectives
- Exception Handling and Recovery - Graceful error management
- Human-in-the-Loop - Incorporating human feedback
- Knowledge Retrieval (RAG) - Accessing external knowledge
- Inter-Agent Communication - Agent-to-agent messaging
- Resource-Aware Optimization - Efficient resource usage
- Reasoning Techniques - Structured thinking approaches
- Guardrails/Safety Patterns - Ensuring safe operations
- Evaluation and Monitoring - Performance tracking
- Prioritization - Managing task importance
- Exploration and Discovery - Finding new solutions
Each pattern includes:
- A visual diagram showing the flow (Mermaid + ASCII)
- Embedded diagrams directly in pattern discussions
- Plain English explanations
- Concise pattern definitions
- Real-world use cases
- Implementation tips
Navigate to any folder to explore the patterns in your preferred format.
Examples live in /code and use LangChain with NVIDIA NIM endpoints.
cd code
python -m venv .venv
.venv\Scripts\activate # Windows (use: source .venv/bin/activate on macOS/Linux)
pip install langchain-nvidia-ai-endpoints python-dotenv colorama richAdd your NVIDIA API key to code/resources/.env:
API_KEY=your_nvidia_api_keyThen run an example:
python prompt-chaining.pyThese patterns are distilled from extensive research on agentic AI systems, made accessible through simple visual representations and clear explanations.
Feel free to suggest improvements or additional patterns through issues or pull requests.
MIT License - Use these patterns freely in your projects!