Skip to content

πŸ€– My comprehensive learning journey through OpenAI Agents SDK - from basics to production-ready applications. Learning by teaching, building by doing. Inspired by expert educational resources, enhanced with personal insights and practical projects.

License

Notifications You must be signed in to change notification settings

ZohaibCodez/agents-sdk-from-zero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– My OpenAI Agents SDK Learning Journey

A hands-on, teaching-by-doing path to mastering the OpenAI Agents SDK.

License: MIT Python OpenAI Agents SDK Learning Status Last Commit GitHub Stars GitHub Forks


πŸ“– About This Repository

This repository documents my comprehensive learning journey through the OpenAI Agents SDK, following a hands-on, teaching-by-doing approach. As I master each concept, I create my own explanations, examples, and projects to solidify understanding and help fellow learners.


🎯 Learning Philosophy

"The best way to learn is to teach." β€” Richard Feynman

I believe in learning through active creation and explanation. This repo captures not just what I've learned, but how I learned it β€” including challenges, breakthroughs, and real applications.


πŸ™ Acknowledgments & Attribution

This journey is inspired by @mjunaidca's agents-sdk-decoded β€” a brilliant expert-level educational resource.

πŸ” What Makes My Approach Different

  • πŸ“ Personal explanations in my own words
  • 🎯 Focused on practical understanding
  • πŸš€ Live examples built step-by-step
  • πŸ“Š Documenting the learning process
  • πŸ’‘ Beginner-friendly + real-world mindset

🧭 Learning Objectives

By the end of this journey, I aim to:

  • βœ… Master the OpenAI Agents SDK from fundamentals to advanced patterns
  • βœ… Build production-ready agentic applications
  • βœ… Understand the DACA framework for scalable systems
  • βœ… Create developer-friendly documentation
  • βœ… Help others learn agentic AI β€” one concept at a time

πŸ—‚οΈ Repository Structure

.
β”œβ”€β”€ πŸ“ modules/
β”‚   β”œβ”€β”€ πŸ“ 01_agents/
β”‚   β”œβ”€β”€ πŸ“ 02_runner/
β”‚   β”œβ”€β”€ πŸ“ 03_results/
β”‚   β”œβ”€β”€ πŸ“ 04_stream/
β”‚   β”œβ”€β”€ πŸ“ 05_tools/
β”‚   β”œβ”€β”€ πŸ“ 06_handoffs/           # NEW: Advanced handoff, input filtering, callbacks, prompt engineering
β”‚   β”œβ”€β”€ πŸ“ 07_lifecycle/          # NEW: Agent lifecycle hooks, monitoring, analytics
β”‚   β”œβ”€β”€ πŸ“ 08_exceptions/         # In Progress: Exception handling, error flows
β”‚   β”œβ”€β”€ πŸ“ 09_guardrails/         # In Progress: Guardrails, input validation, safety
β”‚   └── πŸ“ projects/
β”‚       β”œβ”€β”€ πŸ“ 01_fantasy_world_generator/
β”‚       β”œβ”€β”€ πŸ“ 02_university_helpdesk_orchestration/   # NEW: Advanced multi-agent orchestration project
β”‚       └── πŸ“„ README.md
β”œβ”€β”€ 🚫 .gitignore
β”œβ”€β”€ πŸ“„ .python-version
β”œβ”€β”€ 🐍 main.py
β”œβ”€β”€ πŸ“‹ pyproject.toml
β”œβ”€β”€ πŸ“– README.md
β”œβ”€β”€ πŸ”’ uv.lock
β”œβ”€β”€ πŸ“„ .env.example
β”œβ”€β”€ πŸ“„ LICENSE

Note: Each module and project contains its own README for detailed explanations, code summaries, and learning notes.


πŸ“ˆ Progress Tracker

Module/Section Status
πŸš€ 01_agents βœ… Completed Core agent patterns, context, instructions, structured outputs, advanced orchestration, tool behavior control, agent handoffs
⚑ 02_runner βœ… Completed Agent execution, RunResult exploration, execution lifecycle, synchronous execution, streaming patterns, real-time event processing, advanced context, handoffs, chat, exceptions
πŸ“Š 03_results βœ… Completed RunResult basics, results handling, and multi-turn conversation management
πŸ“‘ 04_stream βœ… Completed Advanced streaming patterns, real-time events, token-by-token streaming, run item events, and streaming with agent handoffs
πŸ”§ 05_tools βœ… Completed Function tools, custom configurations, agents as tools, error handling, context-aware tools, advanced tool choice patterns
🀝 06_handoffs βœ… Completed Advanced handoff orchestration, input filtering, callbacks, structured handoff data, prompt engineering
πŸ”„ 07_lifecycle βœ… Completed Agent lifecycle hooks, monitoring, analytics, session management, performance tracking
🚨 08_exceptions 🚧 In Progress Exception handling, error flows, advanced error management
πŸ›‘οΈ 09_guardrails 🚧 In Progress Guardrails, input validation, safety, compliance
🧩 Projects πŸš€ Started: Real-world agentic applications and showcases
... ...

πŸ—ƒοΈ Projects

The modules/projects/ folder contains real-world, showcase projects that demonstrate advanced agentic workflows, tool integrations, and creative applications using the OpenAI Agents SDK.

Featured Projects

  • Fantasy World Generator: An interactive multi-agent system that builds a fantasy world, including magic systems, maps, lore, and magical creatures. Demonstrates agent orchestration, agents-as-tools, streaming, and creative AI workflows.
  • University Smart Helpdesk Orchestrator: A real-world multi-agent system simulating a university helpdesk. Features advanced orchestration, context-aware routing, escalation handling, streaming UX, and smart agent handoffs. Demonstrates context models, escalation logic, and real-time agent transitions.

See each project's README for setup and usage instructions.


πŸ†• Recent Advanced Additions

  • Agent Handoffs & Input Filtering: See modules/06_handoffs/ for advanced handoff orchestration, input filtering, callbacks, and prompt engineering.
  • Agent Lifecycle Hooks & Monitoring: See modules/07_lifecycle/ for RunHooks, AgentHooks, session management, and analytics.
  • Guardrails & Exception Handling: See modules/08_exceptions/ and modules/09_guardrails/ for in-progress work on error management and safety.
  • University Helpdesk Orchestration Project: See modules/projects/02_university_helpdesk_orchestration/ for advanced multi-agent orchestration, escalation, and context-aware routing.
  • All previous advanced streaming, tool integration, and orchestration features remain available in their respective modules.

πŸ› οΈ Setup & Installation

πŸ“¦ Prerequisites

  • Python (version specified in .python-version)
  • uv package manager installed
  • .env file with OpenAI/Gemini/OpenRouter API keys

πŸš€ Quick Setup

# Clone the repository
git clone https://github.com/ZohaibCodez/agents-sdk-from-zero.git
cd agents-sdk-from-zero

# Initialize environment
uv venv
.venv\Scripts\activate   # For Windows
# or
source .venv/bin/activate   # For macOS/Linux

# Install dependencies
uv sync

# Copy environment variables
cp .env.example .env # Then add your API key inside

πŸ”§ Dev Environment Overview

  • Python version: Managed by .python-version
  • Dependency manager: uv (uv add, uv sync)
  • Virtual environment: .venv/
  • API secrets: Stored in .env file

πŸ“ˆ Learning Methodology

  1. Understand – Study SDK internals and examples
  2. Apply – Build simplified working demos
  3. Explain – Write markdown explanations and insights
  4. Extend – Build real tools and integrations
  5. Repeat – Keep iterating and improving

🀝 Contributing & Feedback

This is a personal learning repo, but:

  • πŸ’¬ Ask questions via GitHub Issues
  • ✍️ Suggest improvements if you spot unclear parts
  • 🌟 Star the repo if it helps β€” it motivates me to keep going!

🎯 Final Goal: Master the OpenAI Agents SDK from foundation to production-ready apps.
πŸ“š Philosophy: Learn deeply. Build consistently. Teach simply.


πŸ”— Connect & Learn Together

  • πŸ“’ Follow this repo for updates
  • 🀝 Let's build the Agentic future, one concept at a time

πŸ“š Learning Never Stops – This repository is a living record of my OpenAI Agents SDK mastery. Join me on the journey!

Last Updated: 2025-07-13

About

πŸ€– My comprehensive learning journey through OpenAI Agents SDK - from basics to production-ready applications. Learning by teaching, building by doing. Inspired by expert educational resources, enhanced with personal insights and practical projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published