|
|
Multi-Agent Systems with CrewAI
Author: Venkata Sudhakar
CrewAI is an open-source framework for building multi-agent AI systems where multiple specialised AI agents collaborate to complete complex tasks. The key insight is that a single LLM agent trying to do everything often produces mediocre results across all subtasks, whereas multiple specialised agents - each with a clear role, goal, and set of tools - produce much better results by division of labour. CrewAI models this as a "crew" of agents working together, similar to how a human team operates. The three core CrewAI concepts are: Agent (an LLM with a specific role, goal, backstory, and set of tools), Task (a specific piece of work assigned to an agent, with a description of the expected output), and Crew (the team of agents and list of tasks, with a process that defines how they collaborate). The two main process types are sequential (tasks run one after another, output of each feeding into the next) and hierarchical (a manager agent delegates tasks to worker agents and synthesises the results). CrewAI is built on top of LangChain, so all LangChain tools work with CrewAI agents. The below example shows a CrewAI crew for data migration planning, with three specialised agents: a migration analyst, a risk assessor, and a report writer working sequentially.
It gives the following output (abbreviated),
[Senior Data Migration Analyst]: Analysing MySQL 5.7 to Cloud Spanner migration...
Key findings:
- 50M rows across 120 tables: estimated 8-12 hours initial load
- 23 stored procedures must be rewritten (Spanner has no stored procs)
- AUTO_INCREMENT not supported in Spanner (use UUID or sequence emulation)
- JSON columns require schema change to STRING or ARRAY types
- Recommended: phased CDC-based migration over 12 weeks
[Migration Risk Assessor]: Identifying top 5 risks...
Risk 1: Stored procedure rewrite failures - PROBABILITY: High, IMPACT: High
Mitigation: Audit all 23 procs in week 1, assign dedicated dev for rewrites
Risk 2: Schema incompatibility data corruption - PROBABILITY: Medium, IMPACT: High
Mitigation: Run parallel validation for 2 weeks before cutover
...
=== FINAL REPORT ===
EXECUTIVE SUMMARY
The proposed MySQL 5.7 to Cloud Spanner migration involves 50M rows and presents
high complexity due to 23 stored procedures and schema incompatibilities.
RECOMMENDATION: Proceed with phased 12-week migration using Datastream CDC.
TIMELINE: 12 weeks. IMMEDIATE ACTIONS:
1. Complete stored procedure audit by end of Week 1.
2. Provision Cloud Spanner instance and run schema compatibility validator.
3. Set up Datastream CDC pilot on 3 non-critical tables.
CrewAI vs LangGraph - when to choose each: Choose CrewAI when you want a high-level, role-based abstraction for multi-agent collaboration. CrewAI is easier to set up, reads naturally like a team structure, and is ideal for content generation, research, and analysis workflows where different "experts" contribute their speciality. Choose LangGraph when you need fine-grained control over state, complex conditional routing, cycles, or human-in-the-loop interrupts. LangGraph is lower level but more powerful for building production agents where you need to debug exactly what is happening at each step.
|
|