Basics
Your First Flow
Build your first intelligent workflow using Tool, Agent, and TaskFlow from chainless.
π§ What Youβll Build
In this tutorial, youβll learn how to:
- Define a Tool (a function with metadata)
- Create an Agent (a smart assistant that can use tools)
- Compose a TaskFlow (a sequential pipeline of agents)
This is the ideal place to begin your journey with chainless
.
π¦ File Structure
Create a file named:
π§ Step 1 β Define a Tool
Tools are simple functions wrapped with structure. Think of them as utilities your agents can use.
π§ Step 2 β Create an Agent
Agents can use tools and interact with language models.
π Step 3 β Compose with TaskFlow
A TaskFlow
runs agents in sequence and carries the input/output through the pipeline.
π§ͺ Full Code: first_flow.py
first_flow.py
βοΈ Running the Flow
1
Create a virtual environment
2
Install dependencies
3
Set your API key
.env
4
Run your script
β Output Example
π Whatβs Next?
- Add more tools like
WebSearch
,DocumentReader
, etc. - Create custom behaviors with
custom_start
- Use
TaskFlow
to chain multiple agents together (e.g., researcher β summarizer β reporter)
Let your agents do the thinking. Build once, automate forever β‘