FastAgency: Getting Started with Multi-Agent Workflows in Minutes
Learn how to deploy multi-agent AI workflows with FastAgency in minutes — from cookiecutter scaffolding to production-ready deployment.
Getting Started with FastAgency
FastAgency makes it incredibly easy to deploy multi-agent workflows built with AG2 (formerly AutoGen). In this tutorial, you will set up a FastAgency project and launch a web-based multi-agent chat application in under 10 minutes.
Prerequisites
- Python 3.10 or later
- An OpenAI API key (or any LLM API key supported by AG2)
- pip installed
Step 1: Install Cookiecutter and Scaffold Your Project
pip install cookiecuttercookiecutter https://github.com/ag2ai/cookiecutter-fastagency.gitFollow the interactive prompts. Choose fastapi+mesop as your app type for a web-based chat UI with a REST API backend. The scaffold creates a complete project structure with a devcontainer, default workflow, and all dependencies.
Step 2: Set Your API Key
export OPENAI_API_KEY=sk-your-key-hereStep 3: Understand the Default Workflow
The generated workflow.py defines a simple two-agent conversation using AG2's ConversableAgent. The workflow is wrapped in FastAgency's Workflow class, which provides the unified interface for deployment across different UIs.

Step 4: Run Your Application
cd my_fastagency_appfastagency runThis starts a local web server. Open your browser to the displayed URL (typically http://localhost:8000) and start chatting with your multi-agent system.
Step 5: Run the Tests
pytest -sThe scaffold includes a test suite that validates your workflow. FastAgency's Tester class makes it easy to add more tests as your agent logic grows.
Deploying to Production
When you are ready to scale, FastAgency's network adapters let you switch from local development to production with minimal code changes. Use the FastAPIAdapter to serve your workflow as a REST API, or combine it with the NatsAdapter for distributed, multi-worker deployments.

Conclusion
FastAgency removes the friction between prototyping and production for multi-agent AI workflows. With cookiecutter scaffolding, a unified API, and scalable deployment options, it is the fastest way to bring your AG2 agents to the real world.