Unlock the Power of AI Agents: A Comprehensive Guide to fast-agent
Harness the groundbreaking potential of AI agents and workflows with fast-agent, the first framework boasting complete, end-to-end tested MCP feature support, including sampling. Whether you're using Anthropic (Haiku, Sonnet, Opus) or OpenAI models (gpt-4o/gpt-4.1 family, o1/o3 family), fast-agent empowers you to build sophisticated applications with ease.
Why fast-agent? Build Effective Agents in Minutes
- Simple Declarative Syntax: Focus on crafting your prompts and MCP servers, leaving boilerplate behind. Maximize your efficiency and get to the core of building effective agents.
- Multi-Modal Mastery: Seamlessly integrate images and PDFs for both Anthropic and OpenAI endpoints. Expand your agent's capabilities beyond text.
- Rapid Development & Testing: Passthrough and playback LLMs enable quick iterations on your Python glue-code. Streamline your workflow for faster deployment.
- MCP Native: Enjoy native MCP support for enhanced functionality. Keep an eye out for our full documentation site and even more MCP examples coming soon!
Agent Application Development Made Easy
- Configuration is Simple: Your agent applications' prompts and configurations are stored in easy-to-manage files, simplifying version control. Spend less time managing files and more time building!
- Real-Time Debugging: Interact with individual agents and components during workflow execution to fine-tune and diagnose issues. Achieve optimal performance through precise tuning.
- Painless Model Selection: Easily test interactions between models and MCP servers. Experiment with different models to find the perfect fit for your needs.
Quick Start: Your First Steps with fast-agent
Ready to dive in? Let's get you up and running.
-
Install uv: If you don't have it already, install the uv package manager for Python.
-
Install fast-agent:
-
Set up an example agent:
-
Run your first agent:
- Specify a model:
-
Explore Workflow Examples:
Explore our examples, including a Researcher Agent (with Evaluator-Optimizer workflow) and a Data Analysis Agent (similar to ChatGPT), demonstrating MCP Roots support.
Windows Users: Configuration changes may be needed for Filesystem and Docker MCP Servers. Check configuration files for detailed instructions.
Basic Agents: Defining Your AI Powerhouse
Creating an agent is surprisingly straightforward:
Interact with your agent:
Or enter interactive chat:
Combining Agents and Leveraging MCP Servers
Use the fast-agent quickstart workflow to generate useful examples, like chaining agents. Use uv run workflow/chaining.py
to start your example. Fast-agent searches for configuration files in the current directory before traversing up the parent directories.
Create chained workflows with MCP Servers:
Workflows: Advanced Agent Orchestration
Chain: Sequential Agent Execution
Achieve a more declarative approach by calling agents sequentially.
Human Input: Bridging AI and Human Intelligence
Enable agents to request human input for complex tasks or context acquisition.
Parallel: Concurrent Agent Processing
Maximize speed and efficiency by sending messages to multiple agents simultaneously.
Evaluator-Optimizer: Iterative Content Refinement
Combine a content generator with an evaluator for continuous improvement of output quality.
Router: Intelligent Agent Delegation
Direct messages to the most appropriate agent based on content analysis.
Orchestrator: Complex Task Management
Divide complex tasks among available agents using an LLM to generate a plan.
Agent Features: Fine-Grained Control
Calling Agents
- Brevity is Key: Omit name and instruction arguments.
- Flexible Access: Use dot notation or dictionary access.
Defining Agents
Control every aspect of your agent's behavior, from its basic instructions to its integration with MCP Servers. See basic definitions for:
- Basic Agent
- Chain
- Parallel
- Evaluator-Optimizer
- Router
- Orchestrator
Multimodal Support: Expanding Your Horizons
Add resources to prompts easily using the inbuilt prompt-server or MCP Types.
MCP Tool Result Conversion
fast-agent intelligently handles the conversion of ImageResources and EmbeddedResources for MCP Tool Results, enriching your agent's interactions.
MCP Prompts
Utilize apply_prompt(name,arguments)
for seamless integration.
Sampling LLMs
Configure your sampling LLMs per Client/Server pair in fastagent.config.yaml
.
Secrets File
fast-agent will automatically look for a fastagent.secrets.yaml
file in the root folder of your agent definitions.
Dive Deeper
fast-agent builds on the mcp-agent project by Sarmad Qadri.
Contributing
Contributions and PRs are welcome - feel free to raise issues to discuss. Guidelines for contributing and roadmap coming soon. Get in touch!