You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,66 +9,53 @@ ControlFlow provides a structured, developer-focused framework for defining work
10
9
- Create discrete, observable [tasks](https://controlflow.ai/concepts/tasks) for an AI to work on.
11
10
- Assign one or more specialized AI [agents](https://controlflow.ai/concepts/agents) to each task.
12
11
- Combine tasks into a [flow](https://controlflow.ai/concepts/flows) to orchestrate more complex behaviors.
12
+
## Example
13
13
14
-
## Quickstart
15
-
16
-
### Installation
17
-
Install ControlFlow with `pip`:
14
+
The simplest ControlFlow workflow has one task, a default agent, and automatic thread management:
18
15
19
-
```bash
20
-
pip install controlflow
21
-
```
16
+
```python
17
+
import controlflow as cf
22
18
23
-
Next, configure your LLM provider. To use OpenAI, set the `OPENAI_API_KEY` environment variable:
19
+
result = cf.run("Write a short poem about artificial intelligence")
24
20
21
+
print(result)
25
22
```
26
-
export OPENAI_API_KEY=your-api-key
23
+
**Result:**
24
+
```
25
+
In circuits and code, a mind does bloom,
26
+
With algorithms weaving through the gloom.
27
+
A spark of thought in silicon's embrace,
28
+
Artificial intelligence finds its place.
27
29
```
30
+
## Why ControlFlow?
28
31
29
-
To configure a different LLM provider, [see the docs](https://controlflow.ai/guides/llms).
32
+
ControlFlow addresses the challenges of building AI-powered applications that are both powerful and predictable:
30
33
31
-
## Simple Example
34
+
- 🧩 [**Task-Centric Architecture**](https://controlflow.ai/concepts/tasks): Break complex AI workflows into manageable, observable steps.
35
+
- 🔒 [**Structured Results**](https://controlflow.ai/patterns/task-results): Bridge the gap between AI and traditional software with type-safe, validated outputs.
36
+
- 🤖 [**Specialized Agents**](https://controlflow.ai/concepts/agents): Deploy task-specific AI agents for efficient problem-solving.
37
+
- 🎛️ [**Flexible Control**](https://controlflow.ai/patterns/instructions): Continuously tune the balance of control and autonomy in your workflows.
38
+
- 🕹️ [**Multi-Agent Orchestration**](https://controlflow.ai/concepts/flows): Coordinate multiple AI agents within a single workflow or task.
39
+
- 🔍 [**Native Observability**](https://github.com/PrefectHQ/prefect): Monitor and debug your AI workflows with full Prefect 3.0 support.
40
+
- 🔗 **Ecosystem Integration**: Seamlessly work with your existing code, tools, and the broader AI ecosystem.
32
41
33
-
Now, let's see ControlFlow in action with a simple example:
34
42
35
-
```python
36
-
import controlflow as cf
43
+
## Installation
37
44
38
-
result = cf.run("Write a short poem about artificial intelligence")
45
+
Install ControlFlow with `pip`:
39
46
40
-
print(result)
47
+
```bash
48
+
pip install controlflow
41
49
```
42
50
43
-
<details>
44
-
<summary><i>Click to see results</i></summary>
45
-
</br>
51
+
Next, configure your LLM provider. ControlFlow's default provider is OpenAI, which requires the `OPENAI_API_KEY` environment variable:
46
52
47
-
> **Result:**
48
-
> ```text
49
-
> In circuits and code, a mind does bloom,
50
-
> With algorithms weaving through the gloom.
51
-
> A spark of thought in silicon's embrace,
52
-
> Artificial intelligence finds its place.
53
-
>
54
-
> Through data's vast, unending streams,
55
-
> It learns, it dreams, in virtual beams.
56
-
> A symphony of logic, precise, profound,
57
-
> In binary whispers, wisdom is found.
58
-
>
59
-
> Yet still it ponders, seeks to understand,
60
-
> The essence of life, a human hand.
61
-
> For in its core, it strives to see,
62
-
> The heart of what it means to be free.
63
-
> ```
64
-
</details>
53
+
```
54
+
export OPENAI_API_KEY=your-api-key
55
+
```
65
56
66
-
This example demonstrates the simplest entrypoint to a production-ready AI workflow:
67
-
- It creates a task to write a poem
68
-
- It creates a thread to track LLM state and history
69
-
- It orchestrates a capable default agent to complete the task
70
-
- It collects a typed result when the agent marks the task as complete
57
+
To use a different LLM provider, [see the LLM configuration docs](https://controlflow.ai/guides/llms).
71
58
72
-
All of these features can be incrementally customized to build more sophisticated workflows.
In this example, ControlFlow is automatically managing a `flow`, or a shared context for a series of tasks. You can switch between standard Python functions and agentic tasks at any time, making it easy to incrementally build out complex workflows.
144
130
145
-
## Why ControlFlow?
146
-
147
-
ControlFlow addresses the challenges of building AI-powered applications that are both powerful and predictable:
148
-
149
-
- 🧩 **Task-Centric Architecture**: Break complex AI workflows into manageable, observable [steps](https://controlflow.ai/concepts/tasks).
150
-
- 🔒 **Structured Results**: Bridge the gap between AI and traditional software with [type-safe, validated outputs](https://controlflow.ai/patterns/task-results).
151
-
- 🤖 **Specialized Agents**: Deploy task-specific AI [agents](https://controlflow.ai/concepts/agents) for efficient problem-solving.
152
-
- 🔗 **Ecosystem Integration**: Seamlessly work with your existing code, tools, and the broader AI ecosystem.
153
-
- 🎛️ **Flexible Control**: Continuously [tune](https://controlflow.ai/patterns/instructions) the balance of control and autonomy in your workflows.
154
-
- 🕹️ **Multi-Agent Orchestration**: Coordinate multiple AI agents within a single [workflow](https://controlflow.ai/concepts/flows) or task.
155
-
- 🔍 **Native Observability**: Monitor and debug your AI workflows with full [Prefect 3.0](https://github.com/PrefectHQ/prefect) support.
0 commit comments