tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Agentic AI > CrewAI > CrewAI Agents and Tasks

CrewAI Agents and Tasks

Author: Venkata Sudhakar

CrewAI is a multi-agent framework where you define a team of specialised AI agents, each with a role, goal, and backstory, then assign them tasks to execute in sequence or in parallel. Unlike a single LLM call, a CrewAI crew orchestrates multiple agents where each agent focuses on what it does best. One agent might research a topic, another analyses the findings, and a third writes the final report. Each agent can be given tools, and agents can delegate subtasks to each other.

The three core building blocks are Agent (defines who the agent is - role, goal, backstory, tools), Task (defines what to do - description, expected output, which agent handles it), and Crew (assembles agents and tasks, defines the process - sequential or hierarchical - and kicks off execution). In sequential process, tasks run one after another and each task can use the output of the previous one. In hierarchical process, a manager agent automatically delegates tasks to the best-suited worker agent.

The below example builds a two-agent migration assessment crew: a researcher agent that analyses the migration scope, and a risk analyst agent that produces the final risk report.


Defining Tasks and running the Crew,


It gives the following output,

[Migration Researcher] Using tool: Database Schema Analyser
[Migration Researcher] Schema analysis: 180 tables, 45 stored procedures...
[Migration Researcher] Findings: HIGH complexity Oracle system detected.
  Top risks: (1) CONNECT BY queries need CTEs, (2) DBMS_JOB -> pg_cron,
  (3) RAW data type -> BYTEA conversion

[Risk Analyst] Processing researcher findings...
[Risk Analyst] Producing risk report...

=== FINAL REPORT ===
Risk Level: CRITICAL
Recommended Timeline: 20 weeks
Blockers:
  1. 45 stored procedures require manual PL/pgSQL conversion
  2. CONNECT BY hierarchical queries not supported in PostgreSQL natively
  3. DBMS_JOB scheduler must be replaced with pg_cron
Immediate Next Action: Run AWS Schema Conversion Tool to get auto-conversion
  percentage estimate before committing to timeline.

CrewAI shines for workflows where different steps genuinely need different expertise and context. Use sequential process when tasks have a clear linear dependency - each builds on the previous. Use hierarchical process when you want a manager agent to autonomously decide which worker handles each subtask. Keep each agent focused on one thing: a researcher that researches, an analyst that analyses, a writer that writes. Giving every agent every tool leads to confused, unfocused output.


 
  


  
bl  br