FastAgency
FastAgency is an open-source framework that accelerates the deployment of multi-agent AI workflows built with AG2 (formerly AutoGen) from prototype to production. It provides a unified programming interface to deploy the same workflows across console, web, and REST API interfaces with minimal code changes. It is designed for developers who use AG2 and need to scale their Jupyter notebook prototypes into production-ready applications.
✨ Key features
- Unified programming interface across console, web, and REST API
- Seamless external API integration via OpenAPI specifications
- Tester class for continuous integration testing of workflows
- CLI for orchestrating and managing multi-agent applications
- Support for scalable network adapters: FastAPI and NATS.io
- Cookiecutter project setup with devcontainer for development
🎯 Use cases
- Deploy AG2 workflows as interactive web chat applications
- Expose multi-agent workflows as REST API services
- Build console-based tools for testing and debugging workflows
- Integrate external APIs like weather data into agent workflows
- Scale workflows to distributed systems using NATS.io message broker
📦 Installation
🧰 Requirements: Requires Python 3.10+ and an OpenAI API key for LLM-based workflows; supports AG2 runtime.
pip install cookiecutter
cookiecutter https://github.com/ag2ai/cookiecutter-fastagency.git
Follow the prompts to set up your project. Then set your OpenAI API key:
export OPENAI_API_KEY=openai_api_key_here
🚀 Usage
import os
from typing import Any
from autogen import ConversableAgent, LLMConfig
from fastagency import UI
from fastagency.runtimes.ag2 import Workflow
llm_config = LLMConfig(
model="gpt-4o-mini",
api_key=os.getenv("OPENAI_API_KEY"),
temperature=0.8,
)
wf = Workflow()
@wf.register(name="simple_learning", description="Student and teacher learning chat")
def simple_workflow(ui: UI, params: dict[str, Any]) -> str:
initial_message = ui.text_input(
sender="Workflow",
recipient="User",
prompt="I can help you learn about mathematics. What subject you would like to explore?",
)
with llm_config:
student_agent = ConversableAgent(
name="Student_Agent",
system_message="You are a student willing to learn.",
)
teacher_agent = ConversableAgent(
name="Teacher_Agent",
system_message="You are a math teacher.",
)
response = student_agent.run(
teacher_agent,
message=initial_message,
summary_method="reflection_with_llm",
max_turns=3,
)
return ui.process(response)
Run locally with MesopUI:
gunicorn my
⚠️ Good to know
Currently only supports the AG2 runtime; other runtimes are planned for future releases.
❓ FAQ
What runtimes does FastAgency support?
Currently, the only supported runtime is AG2 (formerly AutoGen).
Can I use FastAgency to create a web application?
Yes, FastAgency supports MesopUI for web-based applications, allowing you to deploy your workflows as interactive web apps.
How do I integrate an external API into my workflow?
You can import an OpenAPI specification and connect it to your agents with just a few lines of code, as described in the documentation.
Does FastAgency provide testing capabilities?
Yes, FastAgency includes a Tester Class that allows you to write and execute tests for your multi-agent workflows, suitable for CI pipelines.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.