fast-agent: Build and Orchestrate Multimodal AI Agents and Workflows

fast-agent: Build and Orchestrate Multimodal AI Agents and Workflows

Summary

fast-agent is a powerful Python framework designed for creating and interacting with sophisticated multimodal AI agents and workflows. It offers a simple, declarative syntax for defining agents, comprehensive model support, and unique features like end-to-end tested MCP (Multi-modal Communication Protocol) integration. Developers can rapidly build, test, and deploy complex agent applications with advanced capabilities such as structured outputs, vision, and various orchestration patterns.

Repository Info

Updated on January 9, 2026
View on GitHub

Introduction

fast-agent is a robust Python framework that empowers developers to define, prompt, and test sophisticated multimodal AI agents and workflows with remarkable ease. It stands out as the first framework to offer complete, end-to-end tested support for MCP (Multi-modal Communication Protocol) features, including sampling and elicitation. With its simple, declarative syntax, fast-agent allows you to concentrate on composing effective prompts and MCP servers, streamlining the creation of powerful agent applications.

The framework provides comprehensive model support, integrating natively with providers like Anthropic, OpenAI, and Google, alongside Azure, Ollama, Deepseek, and many others via TensorZero. It simplifies the use of structured outputs, PDF, and vision capabilities, all thoroughly tested. fast-agent also includes features like Agent Skills, an interactive Shell Mode, advanced MCP Transport Diagnostics, and robust OAuth support, making it an indispensable tool for modern AI development.

Installation

Getting started with fast-agent is straightforward. It is recommended to use the uv package manager for Python.

First, install uv if you haven't already:

# Install uv (if needed)
pip install uv

Then, install fast-agent-mcp and run an interactive session:

uv pip install fast-agent-mcp          # install fast-agent!
fast-agent go                          # start an interactive session
fast-agent setup                       # create an example agent and config files
uv run agent.py                        # run your first agent

Examples

fast-agent simplifies the creation and orchestration of AI agents through intuitive decorators and workflows.

Basic Agent Definition

Define a simple agent with a clear instruction and run it interactively:

import asyncio
from fast_agent import FastAgent

# Create the application
fast = FastAgent("Agent Example")

@fast.agent(
  instruction="Given an object, respond only with an estimate of its size."
)
async def main():
  async with fast.run() as agent:
    await agent.interactive()

if __name__ == "__main__":
    asyncio.run(main())

Run this agent with uv run sizer.py. You can specify a model using --model, for example: uv run sizer.py --model sonnet.

Chaining Agents for Workflows

Combine multiple agents into a sequential workflow using the @fast.chain decorator:

@fast.agent(
    "url_fetcher",
    "Given a URL, provide a complete and comprehensive summary",
    servers=["fetch"], # Name of an MCP Server defined in fastagent.config.yaml
)
@fast.agent(
    "social_media",
    """
    Write a 280 character social media post for any given text.
    Respond only with the post, never use hashtags.
    """,
)
@fast.chain(
    name="post_writer",
    sequence=["url_fetcher", "social_media"],
)
async def main():
    async with fast.run() as agent:
        # using chain workflow
        await agent.post_writer("http://llmindset.co.uk")

This example demonstrates how to fetch a URL and then summarize it into a social media post.

MAKER Workflow for Reliability

The MAKER workflow enhances reliability by repeatedly sampling a worker agent and using K-voting to reduce errors, ideal for long chains of simple steps.

@fast.agent(
  name="classifier",
  instruction="Reply with only: A, B, or C.",
)
@fast.maker(
  name="reliable_classifier",
  worker="classifier",
  k=3,
  max_samples=25,
  match_strategy="normalized",
  red_flag_max_length=16,
)
async def main():
  async with fast.run() as agent:
    await agent.reliable_classifier.send("Classify: ...")

Why Use fast-agent?

fast-agent offers a compelling set of features that make it an excellent choice for developing advanced AI agent applications:

  • Comprehensive MCP Support: It is the first framework with complete, end-to-end tested support for the Multi-modal Communication Protocol, ensuring robust and compliant deployments.
  • Declarative and Flexible Syntax: Its simple, declarative approach allows developers to focus on agent logic and prompt engineering rather than boilerplate code, facilitating rapid development and version control.
  • Extensive Model Integration: With native support for leading LLM providers and broad compatibility via TensorZero, fast-agent ensures you can leverage a wide array of models for your applications.
  • Advanced Multimodal Capabilities: Seamlessly integrate structured outputs, PDF processing, and vision support into your agents, enabling richer interactions and data handling.
  • Robust Workflow Orchestration: Beyond basic agents, fast-agent provides powerful workflow patterns like Chain, Parallel, Evaluator-Optimizer, Router, Orchestrator, MAKER, and Agents As Tools, allowing for complex task decomposition and execution.
  • Developer-Friendly Features: Includes an interactive shell for debugging, advanced transport diagnostics for reliability, secure OAuth with KeyRing storage, and easy management of secrets, enhancing the development experience.

Links