Multi-agent orchestration via Mistral's Agents API — register agents, manage conversations, delegate via handoffs, bind function calling tools. Use when buil...
Production-tested multi-agent orchestration using Mistral's Agents API. Implements the orchestrator-delegate pattern where a lead agent coordinates specialist agents via Conversations and Handoffs.
Orchestrator (Papa Bois pattern)
├── Registers specialist agents via Agents API
├── Creates conversations with handoff configuration
├── Delegates tasks by naming the target agent
└── Collects results from completed handoffs
Specialists (Anansi, Devi, Firefly patterns)
├── Receive delegated tasks with full conversation context
├── Execute their speciality (story gen, audio, code)
└── Return results to the orchestrator conversation
Agents: Pre-registered on Mistral platform with specific system prompts and model configs. Each agent has a unique ID (ag_...).
Conversations: Multi-turn threads that preserve context across handoffs. The child's name, language, and prompt all carry through without re-injection.
Handoffs: The orchestrator names a specialist agent; Mistral routes the conversation to that agent. Context is preserved automatically.
Function Calling: Tools (like TTS, SFX) are bound to the orchestrator agent, not the delegates. Tools follow the conversation context.
from mistralai import Mistral
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
# Register agents (one-time setup)
orchestrator = client.beta.agents.create(
model="mistral-large-latest",
name="orchestrator",
instructions="You coordinate specialist agents...",
)
specialist = client.beta.agents.create(
model="mistral-large-latest",
name="writer",
instructions="You write content when delegated to...",
)
# Create conversation with handoff
response = client.beta.conversations.create(
agent_id=orchestrator.id,
inputs="Write a blog post about AI agents",
handoffs=[{"agent_id": specialist.id, "name": "writer"}],
)
scripts/orchestrator.py — Full orchestrator implementation with agent registration, conversation management, and handoff delegationreferences/agent-patterns.md — Common multi-agent patterns and when to use eachThis skill uses patterns that may trigger automated security scanners:
ZIP package — ready to use