Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic Design Patterns Documentation

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.

What's Included

This repository contains four main types of documentation for each pattern:

Mermaid Diagrams (/mermaid-diagrams)

Visual flowcharts in plain English showing how each pattern works, designed to be easily understood without technical jargon.

Pattern Discussions (/pattern-discussion)

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

ASCII Art Diagrams (/ascii-art)

Text-based diagrams perfect for copying into Miro boards, documentation, or anywhere that doesn't support rich graphics.

Code (/code)

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.

The 21 Patterns

Core Patterns

  1. Prompt Chaining - Breaking complex tasks into sequential steps
  1. Routing - Directing requests to the right handler
  1. Parallelization - Running multiple tasks simultaneously
  1. Reflection - Self-evaluation and improvement
  1. Tool Use - Integrating external capabilities

Advanced Patterns

  1. Planning - Strategic task decomposition
  1. Multi-Agent Collaboration - Coordinating multiple agents
  1. Memory Management - Storing and retrieving context
  1. Learning and Adaptation - Improving over time
  1. Model Context Protocol - Standardized agent communication

System Patterns

  1. Goal Setting and Monitoring - Tracking objectives
  1. Exception Handling and Recovery - Graceful error management
  1. Human-in-the-Loop - Incorporating human feedback
  1. Knowledge Retrieval (RAG) - Accessing external knowledge
  1. Inter-Agent Communication - Agent-to-agent messaging

Optimization Patterns

  1. Resource-Aware Optimization - Efficient resource usage
  1. Reasoning Techniques - Structured thinking approaches
  1. Guardrails/Safety Patterns - Ensuring safe operations
  1. Evaluation and Monitoring - Performance tracking

Strategic Patterns

  1. Prioritization - Managing task importance
  1. Exploration and Discovery - Finding new solutions

Quick Start

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.

Running the Code

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 rich

Add your NVIDIA API key to code/resources/.env:

API_KEY=your_nvidia_api_key

Then run an example:

python prompt-chaining.py

Source

These patterns are distilled from extensive research on agentic AI systems, made accessible through simple visual representations and clear explanations.

Contributing

Feel free to suggest improvements or additional patterns through issues or pull requests.

License

MIT License - Use these patterns freely in your projects!

About

Comprehensive docs for 21 agentic AI design patterns: mermaid diagrams, ASCII art, pattern discussions, and LangChain code examples

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages