
What is ControlFlow?
ControlFlow is a Python framework for building agentic AI workflows.An agentic workflow is a process that delegates at least some of its work
to an LLM agent. An agent is an autonomous entity that is invoked repeatedly
to make decisions and perform complex tasks. To learn more, see the AI
glossary.
- Create discrete, observable tasks for an AI to solve.
- Assign one or more specialized AI agents to each task.
- Combine tasks into a flow to orchestrate more complex behaviors.
Quickstart
Here’s a simple but complete ControlFlow script that writes a poem:run()
function is the main entry point for ControlFlow. This single line of code creates a task, assigns it to an agent, and immediately executes it, returning the result. You can completely customize those behaviors by learning more about tasks, agents, and flows.
Key features
Let’s explore some of ControlFlow’s key features:Structured results
ControlFlow tasks can return more than just text, including any structured data type supported by Pydantic:Custom tools
Provide any Python function as a tool for agents to use:Multi-agent collaboration
Assign multiple agents to a task to enable collaboration:User interaction
Quickly give agents the ability to chat with users:Flows
Use flows to create complex workflows by running all tasks with a shared context and message history:Why ControlFlow?
- 🔗 Seamless Integration: Blend AI capabilities with your existing Python codebase effortlessly.
- 🎛️ Fine-grained Control: Balance automation with oversight, maintaining control over your AI workflows.
- 📈 Scalability: From simple scripts to complex applications, ControlFlow grows with your needs.
- 🔍 Transparency: Gain insights into your AI’s decision-making process with built-in observability.
- 🚀 Rapid Prototyping: Quickly experiment with AI-powered features in your applications.
- 🤝 Productivity: Focus on your application logic while ControlFlow handles the intricacies of AI orchestration.
Next Steps
- Install ControlFlow
- Explore the Core Concepts
- Browse Patterns for common use cases
- Check out the API Reference