# Multi Agent Orchestration 101

**Build multi-agent systems from scratch in Python 3, then wire them to OpenAI and Claude.**

## Why I Wrote This Series

I've been building AI-powered systems for a while now — from single LLM wrappers, to RAG pipelines, to autonomous agents. At some point I hit a wall. A single agent was useful, but the moment a problem required parallelism, specialisation, or coordination across different capabilities, I realised I needed something more.

I started reading about multi-agent frameworks. There are good ones — AutoGen, CrewAI, LangGraph. But every time I tried to use them, I found myself cargo-culting abstractions I didn't understand. **So I did what I always do when I don't understand something: I built it from scratch.**

This series documents that journey. No toy examples, no hand-wavy diagrams. Just real Python, real API calls, and the actual mistakes I made along the way.

***

## What You Will Learn

This 5-part series covers everything from first principles to production-grade orchestration:

### Part 1: What is a Multi-Agent System? (Pure Python)

* Why a single agent is not enough
* Agent primitives: memory, tools, goals
* Building a minimal agent loop from scratch in Python 3
* Adding inter-agent messaging with a simple queue
* Running two agents that coordinate on a shared task

### Part 2: Giving Agents Tools and Memory

* Structured tool definitions (JSON Schema)
* A tool dispatcher that any agent can use
* Short-term vs long-term memory patterns
* Sharing context across agents without a framework

### Part 3: Orchestrating Agents with OpenAI

* OpenAI function calling as the tool interface
* Building a supervisor agent that delegates to worker agents
* Parallel vs sequential agent execution
* Handling errors and retries in an orchestrated system

### Part 4: Orchestrating Agents with Claude

* Anthropic's tool use API (same concepts, different flavour)
* Claude's extended thinking for planning agents
* Mixing Claude and OpenAI agents in one system
* When to choose Claude over GPT and vice versa

### Part 5: Production Patterns

* Structured logging and tracing across agents
* Rate limiting, cost tracking, and token budgets
* Graceful degradation when an agent fails
* Patterns I wish I had known from the start

***

## Prerequisites

* Python 3.11+
* Basic understanding of async/await
* An OpenAI or Anthropic API key (free tier works for most examples)

If you have read my [LLM API Development 101](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/llm-api-development-101) series, you already have everything you need.

***

## Series Parts

| Part                                                                                                                                                | Title                        | Focus                                   |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | --------------------------------------- |
| [1](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/multi-agent-orchestration-101/part-1-building-agents-from-scratch) | Building Agents from Scratch | Pure Python agent loop, no frameworks   |
| [2](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/multi-agent-orchestration-101/part-2-tools-and-memory)             | Tools and Memory             | Tool dispatcher, context sharing        |
| [3](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/multi-agent-orchestration-101/part-3-openai-multi-agent-workflow)  | OpenAI Multi-Agent Workflow  | Function calling, supervisor pattern    |
| [4](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/multi-agent-orchestration-101/part-4-claude-multi-agent-workflow)  | Claude Multi-Agent Workflow  | Tool use API, extended thinking         |
| [5](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/multi-agent-orchestration-101/part-5-production-patterns)          | Production Patterns          | Observability, cost control, resilience |
