Skip to content

feat(notebook): add agents handoffs cookbook with multi-agent routing#250

Open
abdelhadi703 wants to merge 1 commit intomistralai:mainfrom
abdelhadi703:feat/agents-handoffs-notebook
Open

feat(notebook): add agents handoffs cookbook with multi-agent routing#250
abdelhadi703 wants to merge 1 commit intomistralai:mainfrom
abdelhadi703:feat/agents-handoffs-notebook

Conversation

@abdelhadi703
Copy link
Copy Markdown

Description

Adds a Jupyter notebook demonstrating Mistral's Agents API handoff capabilities. The cookbook currently has Chainlit-based agent examples (travel_assistant, food_diet_companion) but no .ipynb notebook covering handoffs — this fills that gap.

Content

  • Simple handoff: Triage agent routing queries to a Code Expert (code_interpreter) and a Research Expert (web_search)
  • Server mode: Automatic handoff execution with real-time SSE event handling (AgentHandoffStartedEvent, AgentHandoffDoneEvent)
  • Client mode: Manual handoff routing with handoff_execution="client" for custom control flow
  • Multi-agent network: Travel assistant pattern with 4 agents (triage + flights + hotels + activities) and cross-handoffs via agents.update()
  • Conversation history: Inspecting AgentHandoffEntry via get_history()
  • Cleanup: Proper agent deletion

Conventions

  • API key via os.environ with getpass fallback (no hardcoded keys)
  • Pinned SDK version (mistralai>=1.6.0)
  • Colab badge at the top
  • Clean cell outputs
  • All API calls verified against the mistralai Python SDK v1.10.0 signatures

Testing

  • Notebook JSON is valid
  • All API method names and parameters verified against SDK source
  • Event types (AgentHandoffStartedEvent, AgentHandoffDoneEvent, MessageOutputEvent) match SDK definitions
  • End-to-end run with API key (requires live API access)

Add a Jupyter notebook demonstrating Mistral's Agents API handoff
capabilities including simple triage routing, server/client execution
modes, multi-agent travel network pattern, and conversation history
inspection.
@abdelhadi703
Copy link
Copy Markdown
Author

Hi @mistralai/team,

Gentle reminder on this multi-agent routing cookbook. It shows how to implement agent handoffs with Mistral.

Happy to make adjustments based on review. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant