This directory contains runnable examples demonstrating key features of Agency Swarm v1.x.
multi_agent_workflow.py – Multi-agent collaboration with validation patternsagency_context.py – Sharing data between agents using agency contextstreaming.py – Real-time streaming responsesguardrails.py – Input and output guardrailscustom_persistence.py – Chat history persistence between sessionstools.py – Tool patterns: BaseTool and @function_tool with validationagent_file_storage.py – Vector store creation and FileSearch tool usagemessage_attachments.py – File processing and message attachmentsweb_search.py – Domain-filtered WebSearchTool example with source URL extractioncustom_send_message.py – Custom SendMessage configurations and patternsinteractive/hybrid_communication_flows.py – Combining SendMessage and handoffs in a software development workflowagency_visualization.py – Interactive HTML visualizationinteractive/tui.py – Terminal UI chat interface (sets up the matching terminal app automatically on first run and shows a short setup message)interactive/copilot_demo.py – Copilot UI chat interfacefastapi_integration/ – FastAPI server and client examples
server.py – FastAPI server with streaming supportclient.py – Client examples for testing endpointsmcp_servers.py – Using tools from MCP servers (local and hosted)connectors.py – Google Calendar integration using OpenAI hosted toolsthird_party_models.py – Using third-party models (Claude, Gemini, Grok) via LiteLLMobservability.py – OpenAI, Langfuse and AgentOps tracing integrationRun any file with python examples/<name>.py after setting your OPENAI_API_KEY.