Skip to content

artvandelay/codex-agentic-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Codex Agentic Patterns

Learn to build production-ready AI agents through real-world patterns extracted from OpenAI's Codex CLI

License: MIT Python 3.8+ OpenAI Documentation


Beautiful, searchable, mobile-friendly documentation with:

  • ✨ Interactive navigation through all 21 patterns
  • πŸ” Full-text search across all content
  • πŸ“± Mobile responsive design
  • πŸŒ“ Dark/light mode toggle
  • πŸ“Š Progress tracking through learning paths

🎯 What Is This?

The Codex Agentic Patterns is a comprehensive learning resource that teaches you to build intelligent AI agents by studying real production code from OpenAI's Codex CLI. Instead of toy examples, you'll learn from battle-tested patterns used in production systems.

πŸ“š What You'll Master

βœ… 21 Agentic Design Patterns - Complete coverage
βœ… 8 Fully Implemented Patterns - With runnable Python code
βœ… Production-Grade Examples - Not academic demos
βœ… Safety & Error Handling - Real-world robustness
βœ… Multi-Turn Conversations - Complex agent workflows
βœ… Tool Integration - External system connections
βœ… Human-in-the-Loop - Approval and oversight patterns


πŸš€ Quick Start

🌐 Option 1: Browse Online (Recommended)

Visit the Interactive Documentation β†’

No setup required! Browse all patterns, search content, and explore at your own pace.

πŸ’» Option 2: Run Code Locally

# Clone the repository
git clone https://github.com/artvandelay/codex-agentic-patterns.git
cd codex-agentic-patterns

# Navigate to learning materials  
cd docs/learning-material

# Install dependencies
pip install -r requirements.txt

# Set up environment
export OPENAI_API_KEY="your-key-here"

# Run your first example
cd 01-prompt-chaining
python pattern_simple.py

πŸŽ‰ Start learning production agentic patterns!


πŸ“– Learning Paths

🟒 Beginner (1-2 weeks)

Start here if you're new to AI agents:

🟑 Intermediate (2-3 weeks)

For developers with some AI experience:

πŸ”΄ Advanced (3-4 weeks)

For experienced developers wanting production patterns:


πŸ—οΈ What's Inside?

πŸ“ Repository Structure

codex-agentic-patterns/
β”œβ”€β”€ docs/learning-material/      πŸŽ“ Your learning journey starts here
β”‚   β”œβ”€β”€ 01-prompt-chaining/      βœ… Sequential workflows  
β”‚   β”œβ”€β”€ 02-routing/              βœ… Dynamic dispatch
β”‚   β”œβ”€β”€ 03-parallelization/      βœ… Concurrent execution
β”‚   β”œβ”€β”€ 05-tool-use/             βœ… External integration
β”‚   β”œβ”€β”€ 16-sandbox-escalation/   ⭐ Advanced: Multi-stage execution
β”‚   β”œβ”€β”€ 17-turn-diff-tracking/   ⭐ Advanced: Git-style diffs  
β”‚   β”œβ”€β”€ 18-rollout-system/       ⭐ Advanced: Session replay
β”‚   └── complete-agent-example/  πŸ† Full production agent
└── docs/                        πŸ“š Documentation site

πŸ”— Related Repositories

This learning resource analyzes patterns from:

πŸ“Š By The Numbers

  • 21 agentic patterns - Complete coverage from theory to practice
  • 8 patterns fully implemented in Python with runnable code
  • 13 patterns analyzed from Codex source with detailed explanations
  • 500+ lines complete production agent example
  • Production-grade error handling & safety mechanisms

πŸŽ“ How This Was Created

This learning resource was created using AI-assisted education with Cursor and grounded in real production code:

πŸ“ Our Process

  1. Source Analysis: Deep dive into OpenAI's Codex CLI Rust codebase
  2. Pattern Extraction: Identified agentic patterns using the Agentic Design Patterns textbook
  3. Python Implementation: Abstracted patterns into learnable Python examples
  4. Production Focus: Emphasized real-world complexity, not toy examples
  5. Iterative Refinement: Polished through multiple review cycles

πŸ™ Attribution

This work builds upon:

This is an educational resource created to make agentic AI patterns accessible to developers worldwide.


🌟 Why This Matters

❌ Traditional AI Tutorials

  • Toy examples that don't scale
  • Academic focus, not production-ready
  • Missing error handling & edge cases
  • No real-world complexity

βœ… Agentic Patterns Codebook

  • Production patterns from real systems
  • Complete error handling & retry logic
  • Safety mechanisms & approval workflows
  • Multi-turn conversations & state management
  • Tool integration with external systems

πŸ› οΈ Prerequisites

  • Python 3.8+ with pip
  • OpenAI API key (get one here)
  • Basic understanding of Python and APIs
  • Curiosity about building intelligent agents!

πŸ“š Learning Resources

🌐 Interactive Documentation (Start Here!)

🎯 Practice & Exercises

πŸ” Deep Analysis


🀝 Contributing

Found something unclear? Want to improve the materials?

  1. Open an issue - Report bugs or suggest improvements
  2. Start a discussion - Ask questions or share ideas
  3. Submit a PR - Fix typos, add examples, improve explanations

Guidelines: These are educational materials, so clarity and accuracy are paramount!


πŸ“„ License

This educational resource is licensed under the MIT License.

The original Codex CLI and textbook retain their respective licenses.


🌟 Star & Share

If this helped you learn agentic AI patterns, please:

⭐ Star this repository
🐦 Share on Twitter
πŸ’Ό Share on LinkedIn
πŸ“ Write a blog post

Help others discover production-grade agentic patterns!


πŸ”— Links


πŸš€ Ready to build the future of AI? Start learning β†’


Built with ❀️ using AI-assisted education β€’ Created October 2025 β€’ Version 1.0

About

Learn to build production-ready AI agents through real-world patterns extracted from OpenAI's Codex CLI

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published