CrewAI Multi-Agent Crews
Tinitiate AI IT Training • 2026 Edition

CREWAI ROADMAP (2026)

Step-by-step guide to production agents with CrewAI

Model a team: agents with a role, goal and backstory take on tasks with expected outputs, a crew runs them in sequence or under a manager, and Flows add event-driven state, routing and persistence around your crews.

01

Setup, Models & Credentials

  • Install crewai and crewai-tools, scaffold a project with the CLI, and pick a model
  • LLM() routes through LiteLLM, so the same agent runs on Anthropic, OpenAI, Bedrock, Azure, Gemini or Ollama
  • crewai create crew
  • LLM(model=)
  • agents.yaml / tasks.yaml
  • @CrewBase
LEARN
CrewAI
Python
Pydantic
02

Harness, Runtime & Sandbox

  • An Agent has a role, goal, backstory, tools and model
  • A Task has a description, an expected_output and an owner
  • A Crew binds agents and tasks under a Process
  • Placeholders like {claim_id} are filled from kickoff inputs
  • Sandbox: allow_code_execution with code_execution_mode="safe" runs agent code in Docker
  • Agent
  • Task
  • Crew
  • Process.sequential
  • kickoff(inputs=)
LEARN
CrewAI
Docker
Python
03

State & Data Management

  • Inside a crew, data moves through task outputs and context=[other_task]
  • Around crews, a Flow holds typed Pydantic state in self.state that every step reads and writes; each run gets a unique state id
  • Flow[State]
  • self.state
  • context=[task]
  • output_pydantic
  • TaskOutput
LEARN
CrewAI
Pydantic
Python
04

Memory & Persistence

  • memory=True gives a crew short-term (current run), long-term (SQLite, across runs) and entity memory backed by embeddings
  • External memory such as Mem0 can be plugged in. @persist saves Flow state so a run can resume by id
  • memory=True
  • embedder
  • long-term memory
  • external memory
  • @persist
LEARN
CrewAI
Mem0
Python
05

Edges, Routing & Control Flow

  • Flows are the control-flow layer. @start marks entry points, @listen(step) runs after a step, @router returns a label that chooses the branch, and or_ / and_ join branches
  • Inside a crew, the Process decides order
  • @start
  • @listen
  • @router
  • or_ / and_
  • flow.plot()
LEARN
CrewAI
Python
Pydantic
06

Calling, Starting & Stopping

  • Start with kickoff, kickoff_async or kickoff_for_each over many inputs
  • Stop with agent limits: max_iter, max_execution_time and max_rpm
  • The CLI runs, replays from a given task and resets memories
  • kickoff / kickoff_async
  • kickoff_for_each
  • max_iter
  • max_execution_time
  • crewai replay -t
LEARN
CrewAI
Python
Pydantic
07

Errors, Retries & Limits

  • Agents retry failed LLM or tool calls up to max_retry_limit; respect_context_window summarises when the window overflows
  • Task guardrails send a failing output back to the agent for another attempt
  • max_retry_limit
  • respect_context_window
  • guardrail_max_retries
  • step_callback
LEARN
CrewAI
Python
Pydantic
08

Function Calling & Tools

  • Wrap functions with @tool or subclass BaseTool, or use crewai-tools (search, scraping, files, databases)
  • Attach tools to an agent or a single task. output_pydantic or output_json gives structured results
  • @tool
  • BaseTool._run
  • crewai_tools
  • output_pydantic
  • cache_function
LEARN
CrewAI
Pydantic
Python
09

RAG Pipeline

  • Knowledge sources (PDF, CSV, text, web) are chunked and embedded for an agent or a whole crew
  • RAG tools such as PDFSearchTool and WebsiteSearchTool let an agent decide when to retrieve
  • knowledge_sources
  • PDFKnowledgeSource
  • RagTool
  • PDFSearchTool
  • embedder
LEARN
CrewAI
Qdrant
Python
10

MCP Integration

  • MCPServerAdapter connects to stdio, SSE or streamable-HTTP MCP servers and exposes their tools as CrewAI tools
  • Use it as a context manager so the server is shut down cleanly
  • MCPServerAdapter
  • StdioServerParameters
  • streamable-http
  • tool filtering
LEARN
CrewAI
MCP
Python
11

Context Files: skills.md, memory.md, tools.md

  • skills.md: agents.yaml. Role, goal and backstory per agent carry each skill description
  • memory.md: Knowledge + external memory. Text knowledge sources or Mem0-backed external memory
  • tools.md: BaseTool schemas. name, description and args_schema document each tool
  • agents.yaml
  • Knowledge + external memory
  • BaseTool schemas
LEARN
Markdown
YAML
CrewAI
12

Multi-Agent Orchestration

  • Process.hierarchical adds a manager (manager_llm or a custom manager_agent) that plans, delegates and validates. allow_delegation lets agents ask each other
  • Flows chain several crews into one pipeline
  • Process.hierarchical
  • manager_agent
  • allow_delegation
  • async_execution
  • Flows of crews
LEARN
CrewAI
Python
Pydantic
13

Human-in-the-Loop (HITL)

  • human_input=True makes a task pause for reviewer feedback before it is final
  • In Flows, route risky cases to a review step and resume later from persisted state; the hosted platform adds HITL webhooks
  • human_input=True
  • @router review gate
  • @persist resume
  • HITL webhooks
LEARN
CrewAI
Python
Pydantic
14

Guardrails & Safety

  • A task guardrail is a function returning (passed, result_or_feedback), or a plain-language rule checked by an LLM
  • Failures go back to the agent with the feedback
  • Combine with tool restrictions and allow_code_execution=False
  • Task(guardrail=)
  • (bool, Any) contract
  • LLM guardrail string
  • guardrail_max_retries
LEARN
CrewAI
Pydantic
Python
15

Testing & Evaluation

  • crewai test runs the crew N times and scores each task; crewai train collects human feedback to improve agent behaviour
  • Unit-test custom tools directly and Flows with stubbed crews
  • crewai test -n
  • crewai train -n
  • tool.run()
  • stub crews
LEARN
CrewAI
pytest
Python
16

Auditing & Tracing

  • Every crew, agent, task, tool and LLM call emits events on the event bus; a BaseEventListener can write them to an audit store. output_log_file saves run logs, usage_metrics reports tokens, and integrations export to Langfuse, MLflow, Phoenix and others
  • BaseEventListener
  • crewai_event_bus
  • output_log_file
  • usage_metrics
  • OpenTelemetry
LEARN
CrewAI
OpenTelemetry
Python
17

MLOps, LLMOps & Edge Deployment

  • Keep agents and tasks in versioned YAML, gate merges on crewai test, and deploy with crewai deploy to CrewAI AMP, which exposes the crew as a REST API with kickoff and status endpoints
  • Or containerise main.py yourself
  • Edge: Local Python. Runs on local hardware with Ollama or llama.cpp models through LiteLLM
  • crewai deploy create
  • crewai deploy status
  • POST /kickoff
  • GET /status/{id}
LEARN
CrewAI
Docker
Python
18

LLM Training & Tuning

  • crewai train runs the crew with human feedback and saves improved guidance for each agent
  • Sharper expected_output descriptions and few-shot examples are the first lever
  • Any fine-tuned model plugs in through LLM(model=...)
  • crewai train -n
  • expected_output
  • few-shot examples
  • LLM(model=)
LEARN
CrewAI
Python
Pydantic
19

Security, Identity & Cost

  • Give each agent only the tools it needs, keep code execution off by default, cap request rates and cache tool results. result.token_usage shows cost per run; API keys stay in environment variables read by LiteLLM
  • max_rpm
  • cache=True
  • allow_code_execution=False
  • token_usage
LEARN
CrewAI
Python
Pydantic
Enterprise AI Architecture Matrix

17 architectural layers across 7 agent harnesses

How each harness implements the same layer, from sandboxing and state to MCP, guardrails, the skills.md / memory.md / tools.md context files and model tuning.

CrewAI column
LayerLangGraphCrewAIAWS BedrockAWS Strands AgentsAzure FoundryClaude SDKGoogle Gemini SDK
Harness & Sandbox
Your runtime

No built-in sandbox; graphs run in LangSmith Deployment or your own containers.

Docker code mode

allow_code_execution with code_execution_mode="safe" runs agent code in Docker.

AgentCore Runtime

Per-session microVM isolation, managed Code Interpreter; action groups run in Lambda.

In-process + AgentCore

The loop runs in your process; AgentCore Runtime adds session isolation.

Agent Service

Hosted runs with a sandboxed Code Interpreter for generated code.

Code execution + containers

Server-side code execution tool; Managed Agents give each session a container.

Code execution + Agent Engine

Built-in code_execution tool and ADK code executors; Agent Engine hosting.

State & Data
Typed state + checkpointers

Reducers merge updates; Postgres, SQLite or Redis checkpointers enable resume and time travel.

Flow state + crew memory

Pydantic Flow state with @persist; short-term, long-term and entity memory.

Session state APIs

sessionAttributes, prompt attributes, session summaries and AgentCore Memory.

agent.state + sessions

JSON agent.state, conversation managers and File or S3 session managers.

Threads

Server-side threads and runs; Standard setup stores threads in your Cosmos DB.

Client-owned messages

History sent each turn, compaction and the memory tool; SDK sessions resume by id.

Scoped session state

session.state with user:, app: and temp: prefixes; database or Vertex AI sessions.

Function Calling
@tool + ToolNode

Docstrings and type hints become the schema; ToolNode runs calls inside the graph.

@tool / BaseTool

Pydantic args_schema validation, the crewai-tools library and per-task tools.

Action groups / toolConfig

OpenAPI or function schemas executed by Lambda; Converse toolSpec schemas.

@tool decorator

Typed Python functions become tools; strands-agents-tools ships ready-made tools.

FunctionTool + OpenAPI

Auto function calling plus Azure Functions, OpenAPI and Logic Apps tools.

Tool Runner + strict tools

JSON-schema tools with strict: true and parallel calls; the Tool Runner drives the loop.

Automatic function calling

Python functions as tools; FunctionDeclarations for manual control.

Edge Deployment
Runs anywhere

Pure Python or JS; pair with local models through Ollama on edge servers.

Local Python

Runs on local hardware with Ollama or llama.cpp models through LiteLLM.

Cloud service

No on-device runtime; use AWS IoT Greengrass with local models at the edge.

Local model providers

OllamaModel and other local providers; the Python agent runs on edge hosts.

Foundry Local

Run models on-device with Foundry Local and ONNX Runtime; Azure IoT Edge.

Cloud API

Models run in the cloud; an edge host can run the Agent SDK and call the API.

Gemini Nano + Gemma

Gemini Nano on Android and Chrome; open Gemma models locally.

Start & Stop
invoke / stream / resume

recursion_limit caps steps; cancel and resume from the last checkpoint.

kickoff / max_iter

kickoff, kickoff_async, kickoff_for_each; max_iter and max_execution_time stop runs.

invoke_agent / endSession

Streaming sessions by sessionId; endSession closes; stopReason on Converse.

agent() / stream_async

Sync, async and streaming calls; Swarm and Graph timeouts and handoff limits.

Runs: create / cancel

Run statuses from queued to completed; runs.cancel and token caps.

stream + stop_reason

end_turn, tool_use, pause_turn and refusal; ClaudeSDKClient.interrupt().

run_async events

Event stream to a final response; max_llm_calls; escalate exits loops.

Testing & Eval
LangSmith evals

Unit-test nodes; datasets, LLM judges and trajectory evals.

crewai test

Scores each task over N runs; crewai train adds human feedback.

Bedrock Evaluations

LLM-as-judge jobs for models, Knowledge Bases and agents; test-alias traces.

pytest + metrics

Test tools as functions and assert on tool metrics; LLM-judge eval sets.

azure-ai-evaluation

Groundedness, intent, tool-call accuracy and safety evaluators; red teaming.

Evals + Batches

Code and LLM graders; large eval sets through the Batches API.

adk eval

Tool-trajectory and response-match scores; AgentEvaluator in pytest.

Auditing & Tracing
LangSmith traces

Node-level trace trees; checkpoint history as a replayable audit log.

Event listeners

Event-bus listeners, log files, and Langfuse or AgentOps integrations.

Invocation logs + CloudTrail

Prompt and response logs to CloudWatch or S3; API audit in CloudTrail.

OpenTelemetry built in

Spans for every cycle, model and tool call to X-Ray, CloudWatch or Langfuse.

Application Insights

OpenTelemetry tracing of runs and tool calls; Azure Monitor.

Usage logs + hooks

Request ids and token usage; Agent SDK hooks log tool calls.

Cloud Trace

ADK spans; events record author, calls and state deltas.

Orchestration
Supervisor / swarm graphs

Subgraphs, Command handoffs, Send fan-out, prebuilt supervisor and swarm.

Crews + Flows

Sequential or hierarchical crews; Flows chain crews with routers.

Multi-agent collaboration

Supervisor and collaborator agents; Flows and Step Functions.

Swarm, Graph, agents-as-tools

Model-driven or explicit multi-agent patterns; A2A protocol.

Connected agents

Agents as tools; Agent Framework sequential, concurrent, handoff and group chat.

Subagents

Agent SDK subagents with isolated context; Managed Agents multi-agent workflows.

Workflow agents

Sequential, Parallel and Loop agents; sub-agent transfer; AgentTool; A2A.

Guardrails
Guard nodes + middleware

Validator nodes route to END; PII and call-limit middleware.

Task guardrails

Function or LLM guardrails retry failing outputs with feedback.

Bedrock Guardrails

Content filters, denied topics, PII masking, grounding and Automated Reasoning checks.

Guardrails + hooks

Bedrock Guardrails on the model; hooks block or cancel tool calls.

Content Safety

Content filters, Prompt Shields, groundedness and protected-material detection.

Hooks + permissions

PreToolUse hooks deny calls; tool allow and deny lists; refusal stop reason.

Callbacks + Model Armor

before_model and before_tool callbacks; safety settings; Model Armor.

RAG Pipeline
Agentic RAG graphs

Retrieve, grade and rewrite loops over any LangChain vector store.

Knowledge + RAG tools

Knowledge sources per agent or crew; PDF, web and vector search tools.

Knowledge Bases

Managed ingestion, chunking and vector stores with filters and citations.

retrieve tool

Queries Bedrock Knowledge Bases; custom vector tools for other stores.

AI Search + File Search

Hybrid vector and semantic search, managed vector stores, Bing grounding.

Citations

Bring your own retrieval; document blocks return cited spans.

File Search / RAG Engine

Managed File Search stores; Vertex AI RAG Engine and Search grounding.

MCP Integration
MCP adapters

MultiServerMCPClient loads stdio and HTTP servers as LangChain tools.

MCPServerAdapter

Stdio, SSE and streamable-HTTP servers exposed as CrewAI tools.

AgentCore Gateway

Turns Lambda and OpenAPI targets into a secured MCP endpoint.

MCPClient

Native MCP client for stdio, SSE and streamable HTTP.

McpTool

Remote MCP servers with tool allow-lists and approval modes.

MCP connector

The API calls remote MCP servers directly; the Agent SDK runs local ones.

MCPToolset

Connects ADK agents to MCP servers with tool filters.

MLOps / LLMOps
LangSmith Deployment

langgraph.json, container builds, assistant versions and eval gates.

CrewAI AMP

crewai deploy exposes crews as APIs; versioned YAML configs.

Versions + aliases

Immutable agent versions, alias rollouts, CloudFormation or CDK.

AgentCore / Lambda

BedrockAgentCoreApp entrypoint; Lambda, Fargate or EKS.

GenAIOps

Evals in CI, Bicep or Terraform deploys, continuous evaluation.

Pinned models + versions

Eval-gated model changes; Managed Agents versions and schedules.

Agent Engine / Cloud Run

adk deploy to Vertex AI Agent Engine or Cloud Run.

Human-in-the-Loop
interrupt()

Pause any node; resume with Command(resume=...) to approve or edit.

human_input=True

Tasks pause for reviewer feedback; Flow routers queue risky cases.

Return of control

Hands planned actions back to the app; per-function user confirmation.

Interrupts

BeforeToolCall hooks pause for approval; handoff_to_user tool.

requires_action

Runs pause for tool outputs or MCP approvals before continuing.

can_use_tool

Approve or deny each tool call; permission modes set defaults.

Tool confirmation

require_confirmation on tools; long-running tools for async approvals.

skills.md
Prompts per node

Load skill files into node prompts and route to them with conditional edges.

agents.yaml

Role, goal and backstory per agent carry each skill description.

Agent instructions

Instructions plus prompt-override templates per orchestration step.

system_prompt

Load skill files into the system prompt or specialist agents-as-tools.

Agent instructions

Instructions per agent; connected agents for separate skills.

Agent Skills (SKILL.md)

Skill folders with SKILL.md load on demand in the API and Agent SDK.

Instructions + sub-agents

Skill text in instructions; sub-agent descriptions drive routing.

memory.md
Store namespaces

Memory notes in the long-term Store, written by a memory node.

Knowledge + external memory

Text knowledge sources or Mem0-backed external memory.

AgentCore Memory

Session summaries and long-term memory strategies.

Sessions + mem0 tool

Session managers persist state; the mem0_memory tool keeps long-term notes.

Threads + files

Thread history plus a File Search store holding memory notes.

CLAUDE.md + memory tool

The Agent SDK loads CLAUDE.md; the memory tool reads and writes memory files.

Memory Bank

MemoryService and load_memory recall long-term facts.

tools.md
Tool docstrings

Generate tools.md from @tool names, docstrings and Pydantic args.

BaseTool schemas

name, description and args_schema document each tool.

OpenAPI schemas

Action-group OpenAPI or function-detail definitions.

@tool docstrings

Docstrings become tool specs; tools can load from a directory.

OpenAPI specs

Function definitions and OpenAPI tool specs per agent.

JSON-schema tools

Name, description and input_schema; MCP servers describe their own tools.

FunctionDeclarations

Function docstrings or explicit declarations describe each tool.

LLM Training / Tuning
Model-agnostic

Use LangSmith traces as datasets; fine-tune in your model platform.

crewai train

Human feedback improves agent guidance; tuned models via LiteLLM.

Custom models

Fine-tuning, continued pre-training, distillation and model import.

Bedrock or SageMaker models

Point the model provider at a tuned Bedrock or SageMaker model.

Fine-tuning + distillation

Supervised, preference and reinforcement fine-tuning for supported models.

Prompting over tuning

Steer with prompts, Skills, examples and effort; no first-party fine-tuning.

Vertex AI tuning

Supervised and preference tuning for Gemini; LoRA for Gemma.