YAML Configuration
YAML for flow of control
In FloAI, YAML is used to define workflows, agents, and teams in a structured manner, allowing for flexible configurations. This page explains the key components of the YAML configuration file, detailing how each part contributes to the overall agentic flow. By breaking down each section, you'll understand how to create custom agents and teams, assign jobs, and configure tools.
Let's break down the structure of a YAML file and its key components:
Key Components of the YAML Structure
Name | Description |
---|---|
| The type of agentic Flo you're creating. This can be either |
| The name of the agentic flow. This can be an alphanumeric string and serves as the identifier for the Flo. |
| Depending on whether you're creating a team or a single agent, this key specifies the overall entity. |
| The router manages how tasks are handled within a team. It decides the flow of tasks and which agent performs what task based on the current state. Supported router types are |
| The name of the team or agent. It must be a valid alphanumeric string without spaces. |
| The job or task that the agent is expected to perform. This field specifies the core responsibility of the agent. |
| This optional field assigns a persona or role to the agent, giving it a specific identity (e.g., "Researcher", "Support Specialist"). |
| A list of tools that the agent can use to accomplish its job. These tools should be pre-defined and registered within the session. |
YAML Structure Breakdown
To understand the structure better, here's a detailed explanation of each part of a sample YAML configuration:
1. apiVersion
The version of the API you're using in FloAI. For most configurations, the value will be:
This ensures that the correct version of FloAI's configuration engine is used to interpret your YAML file.
Right now the only supported version is alpha-v1. If we are to bring changes in the yaml structure this version will change, but it will have backward compatibility
2. kind
The kind
field specifies the type of agentic flow you're creating. There are two primary types:
FloRoutedTeam
: Used to define a team of agents working together.FloAgent
: Used to define a single agent acting independently.
For example:
3. name
The name
field assigns a unique identifier to the Flo you're building. This is how the system will refer to the entire agentic flow.
Example:
4. team/agent
team
: If you're creating a team of agents, you'll use this key. Under theteam
key, you define the agents and their roles.agent
: If you're defining a single agent, you'll use this key instead ofteam
.
In the example above, we have a team configuration, so team
is used. The team
object contains:
name
: The name of the team.router
: Defines the routing logic within the team.
Example:
5. team.router
A router is responsible for managing the flow of tasks in a team. Routers decide how tasks are distributed among agents and ensure that the right agent is called based on the task at hand.
Currently supported routers include:
supervisor
: Manages tasks hierarchically, distributing tasks based on a decision tree or workflow.linear
: Executes agents in a linear fashion, one after another, in the order they are defined.llm
: The router determines which agent to invoke based on a natural language prompt.
Example of configuring a supervisor router:
6. (team/agent).name
The name
field under team
or agent
provides a unique name for the team or agent. This name is alphanumeric and must not contain spaces.
Example:
7. agent.job
The job
field specifies what the agent is responsible for. This defines the core task or function the agent will perform.
Example:
8. agent.role
The optional role
field assigns a persona or character to the agent. This can be useful for defining specialized roles in a team or giving an agent specific expertise (e.g., a researcher or a financial advisor).
Example:
9. agent.tools
The tools
field lists the tools the agent will use to accomplish its job. These tools must be registered with the FloSession beforehand.
Example:
Example: A Simple FloAgent Configuration
Here's an example of defining a single agent (FloAgent
) that performs one job:
In this example:
kind
: We are defining a single agent (FloAgent
).name
: The agentic flow is namedsingle-agent
.agent.name
: The agent's name isInformationFetcher
.agent.job
: The agent's task is to retrieve data based on user queries.agent.tools
: The agent has access to a tool calledDataFetcherTool
.
Advanced Configurations: Teams with Sub-Teams
FloAI supports composability, meaning you can nest sub-teams within teams, enabling complex workflows. Here's an example of a team configuration with sub-teams:
In this example:
The BloggingTeam has two sub-teams: ResearchTeam and WritingTeam.
Each sub-team has its own agents and supervisor router, enabling task delegation and coordination across multiple teams.
Conclusion
The YAML configuration in FloAI allows for extensive customization of agentic flows, enabling you to create simple or complex workflows. By understanding how to use key components like agents, teams, routers, and tools, you can effectively design workflows tailored to your needs.
As FloAI evolves, more router types and advanced configurations will become available, providing even greater flexibility in building agentic systems.
Last updated