Framework structure

CrewAI organizes work around three main concepts. Agents are individual AI workers with defined roles, goals, and tool access. Tasks are units of work assigned to specific agents, with descriptions of what needs to be accomplished and what context is available. The Crew coordinates the agents and tasks, defining the process (sequential or hierarchical), managing execution order, passing outputs between tasks, and collecting the final result. The framework handles the execution loop, tool invocation, and inter-agent communication, so developers focus on defining what each agent does and how tasks relate rather than building orchestration infrastructure.

Process types: sequential and hierarchical

Sequential process executes tasks in a defined order — agent one completes its task, passes output to agent two, and so on until all tasks are complete. This is the simpler process type and works well for linear workflows where each step builds directly on the previous one. Hierarchical process introduces a manager agent that can delegate tasks to worker agents, review their outputs, request revisions, and determine when the overall goal is met. The manager adds an oversight layer that improves output quality for complex tasks but increases token usage and execution time. Custom process flows can be defined for workflows that do not fit either pattern.

Tool integration and extensibility

CrewAI tools follow a standard interface that allows custom tools to be defined in Python and assigned to agents. Pre-built tools cover common tasks: web search, website reading, file operations, code execution, and directory traversal. Custom tools are plain Python classes that implement the interface, making integration with internal systems straightforward. Tools assigned to an agent are described to the model in the agent's context so it knows when and how to use them. Tool outputs are returned to the agent as text and incorporated into its next reasoning step.