CrewAI is an open-source Python framework for orchestrating teams of role-playing AI agents that collaborate to complete a task. You define Agents…
Understand CrewAI as a framework for role-based teams of collaborating agents.
CrewAI is a Python framework for building multi-agent systems where several specialized agents work together, each playing a defined role, to complete a larger task. Rather than one general agent doing everything, you compose a researcher, a writer, and an editor, and let them collaborate.
CrewAI is standalone — it does not depend on LangChain — and centers on a simple mental model: give each agent a role and a goal, give the crew tasks, and press run.
Learn the three building blocks and how they connect.
A CrewAI Agent is defined by a role ('Senior Researcher'), a goal ('find the most credible recent sources'), an optional backstory that shapes its behavior, the tools it may use, and the LLM it runs on. The role and goal are effectively a structured system prompt that steers how the agent thinks and acts.
A Task has a description of what to do and an expected_output that tells the agent what 'done' looks like; each task is assigned to an agent and can pass its result to the next. A Crew bundles the agents and tasks and runs them under a process.
Tasks can share context, so the writer agent receives the researcher's findings automatically as it works.
researcher = Agent(role="Researcher", goal="Find key facts on {topic}", tools=[search]) writer = Agent(role="Writer", goal="Write a clear summary") t1 = Task(description="Research {topic}", expected_output="5 bullet facts", agent=researcher) t2 = Task(description="Summarize the facts", expected_output="1 paragraph", agent=writer) crew = Crew(agents=[researcher, writer], tasks=[t1, t2], process="sequential") result = crew.kickoff(inputs={"topic": "vector databases"})
Two role-based agents, two tasks, one sequential crew. The researcher runs first; its output feeds the writer's task; kickoff runs the whole crew and returns the final result. Curly-brace placeholders are filled from the inputs.
Choose how a crew coordinates: fixed order or a manager delegating.
A sequential process runs tasks in the order you list them, each agent handing results to the next — simple and predictable, ideal when the steps are known ahead of time.
A hierarchical process adds a manager agent that decides which agent handles what, delegates tasks, and reviews their work. It is more flexible for open-ended goals but less predictable and uses more model calls, so start sequential and move to hierarchical only when you need dynamic delegation.
Decide when multiple role-based agents beat a single agent.
A crew shines when a task splits cleanly into distinct specialties — research, then writing, then review — where each role benefits from its own instructions and tools. Separation can improve quality because each agent stays focused on one job.
The cost is more model calls, more latency, and more places to go wrong. If a single well-prompted agent with a few tools already solves the task, use that; reach for a crew when the roles are genuinely different and the workflow is worth coordinating.
Every agent and task is extra LLM calls. Keep crews as small as the problem allows, give each agent a sharp role and expected_output, and watch for agents duplicating each other's work.
CrewAI orchestrates teams of role-playing agents. You define Agents (role, goal, tools), Tasks (description plus expected_output), and a Crew that runs them sequentially or hierarchically. Sequential is a predictable pipeline; hierarchical adds a delegating manager agent. Crews shine when a task splits into distinct specialties, but each agent is more cost and latency, so keep them small and use a single agent when it suffices.
Design a 3-agent crew that turns a topic into a blog post (researcher, writer, editor). Write each agent's role and goal, each task's expected_output, and decide whether sequential or hierarchical fits — then name one way two agents might redundantly overlap.
What is CrewAI?
CrewAI composes specialized, role-based agents into a crew that runs tasks together; it is independent of LangChain.
What are the core building blocks of CrewAI?
An Agent has a role and goal, a Task defines the work and its expected output, and a Crew executes the agents and tasks together.
What is the difference between a sequential and a hierarchical process in CrewAI?
Sequential is a predictable pipeline; hierarchical dynamically assigns and checks work through a manager agent at higher cost.
When should I use a CrewAI crew instead of a single agent?
Crews help when roles are genuinely different, but they add calls, latency, and coordination overhead, so keep them as small as the problem allows.