The anatomy of a crew: agents, tasks, YAML
Goal. Understand the three pieces a crew is made of — agents, tasks, and the crew that runs them — by editing the generated files.
Open config/agents.yaml and change the 'writer' agent's goal to: "Write a punchy 5-bullet summary a busy founder can read in 30 seconds." Then open config/tasks.yaml and tighten its task description to match.
CrewAI separates who the agents are (agents.yaml), what they do (tasks.yaml), and how they're assembled (the Python crew.py). Edit the YAML — you rarely touch the Python at first.
- 1Open
config/agents.yaml. Each agent has a role, a goal, and a backstory — plain-English fields that shape how it behaves. This is where you define your researcher and writer. - 2Open
config/tasks.yaml. Each task has a description and an expected output, and is assigned to one of your agents. Tasks are the work; agents are the workers. - 3Glance at
crew.py: it imports the YAML and assembles the agents and tasks into aCrew. Together these form the crew — a team that collaborates to finish the work.
You'll see. How a crew decomposes into readable parts: role-playing agents in one file, their tasks in another, and a short Python file that binds them into a team.
Cost. Editing config files costs nothing — you only spend LLM tokens when you actually run the crew.
Takeaway. A crew is just agents + tasks + an assembly step. Configuring it in YAML keeps the structure clear and easy to change.