DS DevShelfHub Projects · AI tools
Tutorials / CrewAI / API Reference

CrewAI API Reference: Classes, Methods & Decorators

By DevShelfHub

Complete documentation for 58 classes, 30 methods, and 16 decorators. Each page includes detailed explanations, parameters, code examples, common mistakes, and when NOT to use. If you are new to the framework, start with the CrewAI introduction and core concepts tutorials, then dive into classes like Agent or Task as you build.

104 Pages Fully Searchable
CrewAI api reference tutorial — CrewAI API Reference: Classes, Methods & Decorators

How to use this catalog

Each card opens a focused page: import line, parameters, runnable examples, common mistakes, and alternatives so you can decide quickly while coding. Start from the core concepts tutorial for Agent/Task/Crew basics, then jump here for class-level detail on planning and reasoning, tools, or Flows and persistence when those topics match what you are building.

Agent
crewai
An autonomous worker defined by role, goal, backstory, tools, and LLM — the basic unit of work in a Crew.
LiteAgent
crewai
A lightweight single-agent runtime — execute one agent with tools and guardrails, without setting up a Crew.
Task
crewai
A unit of work executed by an Agent — described in natural language with an expected output contract.
ConditionalTask
crewai.tasks.conditional_task
A Task that executes only if a runtime condition (callable returning bool) is True.
Crew
crewai
The orchestrator: binds agents + tasks + process + shared services (memory, knowledge, embedder, manager).
CrewBase
crewai.project
Decorator/class scaffold that combines YAML config with @agent/@task/@crew methods into a tidy project layout.
Process
crewai
Enum selecting the crew's execution mode: sequential or hierarchical.
LLM
crewai
Provider-agnostic language-model wrapper with temperature, tokens, fallbacks, and streaming support.
BaseLLM
crewai
Subclass-this base for implementing custom LLM integrations.
Flow
crewai.flow.flow
Event-driven orchestrator built on @start/@listen/@router with typed state and persistence.
TaskOutput
crewai
Result of a single Task — exposes raw text, Pydantic parsed form, JSON dict, and agent metadata.
CrewOutput
crewai
Aggregate result of a Crew kickoff — final raw text, per-task outputs, and token usage.
LLMGuardrail
crewai
LLM-based output validator — declares pass/fail criteria and runs an LLM to enforce them.
BaseTool
crewai.tools
Subclass-this base for custom tools — defines name, description, args_schema, _run, _arun.
AgentPlanner
crewai.agents.planner
Internal planner that runs when Crew(planning=True) — produces a step-by-step plan prepended to each task.
SecurityConfig
crewai.security
Configures crew-level security: fingerprints, redaction patterns, telemetry safety.
Fingerprint
crewai.security
Hashable, stable identifier auto-assigned to every Agent and Crew for telemetry without PII leakage.
JsonProvider
crewai.state
Stores Flow state as JSON files under db_storage_path — readable, debuggable backend.
SqliteProvider
crewai.state
Default CrewAI Flow state backend — embedded SQLite for durable, concurrent-safe persistence of @persist flows.
CheckpointConfig
crewai.state.checkpoint_config
Bundles the storage provider and policy used by @persist.
HumanFeedbackProvider
crewai.flow.human_feedback
Abstract base for human-feedback providers — implement to integrate Slack, email, webhook, custom UIs.
PendingFeedbackContext
crewai.flow.human_feedback
The context object passed to HumanFeedbackProvider.request — carries prompt, metadata, and routing keys.
LLMCallHookContext
crewai.hooks
Context passed to before/after LLM-call hooks — carries prompt, response, model, agent identity.
ToolCallHookContext
crewai.hooks
Context passed to before/after tool-call hooks — tool name, input args, result, agent identity, and run metadata.
BaseEventListener
crewai.events
Subclass-this base for custom event listeners that hook into the global crewai_event_bus.
BaseKnowledgeSource
crewai.knowledge.source
Subclass-this base for custom knowledge sources beyond the built-in PDF/CSV/JSON/Excel/Text/Docling adapters.
StringKnowledgeSource
crewai.knowledge.source
Use a raw string as a knowledge source — fastest path for prototyping or test fixtures.
PDFKnowledgeSource
crewai.knowledge.source
Loads, chunks, and embeds PDF documents for retrieval by agents — the default PDF RAG path before Docling.
CSVKnowledgeSource
crewai.knowledge.source
Loads tabular CSV data into the knowledge store with per-row embeddings.
JSONKnowledgeSource
crewai.knowledge.source
Loads JSON documents into the knowledge store.
ExcelKnowledgeSource
crewai.knowledge.source
Loads xlsx workbooks (one row per chunk by default).
TextFileKnowledgeSource
crewai.knowledge.source
Loads UTF-8 plain text and Markdown files into CrewAI's knowledge pipeline for chunked embedding and retrieval.
CrewDoclingSource
crewai.knowledge.source
Layout-aware document loader for complex PDFs (tables, multi-column, scans).
MCPServerStdio
crewai.mcp
Connect to a local MCP server launched as a subprocess via stdio transport.
MCPServerSSE
crewai.mcp
Connect to a remote MCP server over Server-Sent Events.
MCPServerHTTP
crewai.mcp
Connect to a remote MCP server over streamable HTTP — the modern remote transport.
MCPServerAdapter
crewai_tools
Wraps any MCP server (Stdio/SSE/HTTP) and exposes its tools as CrewAI BaseTool instances.
A2AClientConfig
crewai.a2a
Configures an outbound A2A connection: base URL, auth, transports, and update mode (polling/push/streaming).
A2AServerConfig
crewai.a2a
Configures exposing a CrewAI agent as an A2A server — agent card, auth, transports.
APIKeyAuth
crewai.a2a.auth
A2A auth method: static API key in a header.
BearerTokenAuth
crewai.a2a.auth
A2A auth method: OAuth-style bearer token in Authorization header.
OAuth2ClientCredentials
crewai.a2a.auth
A2A auth method: OAuth2 client-credentials grant — exchanges client_id/secret for a short-lived token.
HTTPBasicAuth
crewai.a2a.auth
A2A auth method: HTTP Basic (username + password). Legacy; prefer token-based auth.
EnterpriseTokenAuth
crewai.a2a.auth
A2A auth method tailored for CrewAI Enterprise/AMP — uses platform-issued tokens with org scope.
StreamingConfig
crewai.a2a.updates
Configures an A2A client to receive task and agent updates over a streaming transport instead of polling.
PollingConfig
crewai.a2a.updates
Configures an A2A client to fetch updates by polling.
PushNotificationConfig
crewai.a2a.updates
Configures an A2A client to receive updates via push notifications (HMAC-signed webhooks).
QdrantConfig
crewai.rag.qdrant.config
Configuration object for the Qdrant vector store — used by QdrantVectorSearchTool and RAG client.
SerperDevTool
crewai_tools
Google search results via Serper.dev API — fast, low-cost web search for agents.
ScrapeWebsiteTool
crewai_tools
Fetches and cleans the text content of a URL.
FirecrawlScrapeWebsiteTool
crewai_tools
LLM-friendly web scraping via Firecrawl — handles JS, returns clean Markdown.
FileReadTool
crewai_tools
Reads the contents of a local file.
FileWriterTool
crewai_tools
Writes content to a local file path.
PDFSearchTool
crewai_tools
Semantic search within a PDF — agent supplies the query, tool returns top chunks.
DallETool
crewai_tools
Image generation via OpenAI DALL·E — returns an image URL or bytes.
CodeInterpreterTool
crewai_tools
Executes Python code in a sandbox — analyses data, performs calculations, generates plots.
BedrockInvokeAgentTool
crewai_tools
Invoke an AWS Bedrock Agent from inside a CrewAI agent — cross-platform delegation.
InvokeCrewAIAutomationTool
crewai_tools
Invokes a deployed CrewAI AMP automation from another crew — composing automations across the platform.

CrewAI API Reference FAQ

What does the CrewAI API reference on DevShelfHub include?

It is a searchable catalog of 58 classes, 30 module-level methods, and 16 decorators with purpose statements, parameters, import lines, runnable examples, common mistakes, and alternatives so you can pick the right API quickly.

How many CrewAI classes, methods, and decorators are documented?

There are 104 total reference pages: 58 class guides, 30 method guides, and 16 decorator guides, each written for Python developers shipping agents and crews.

Is the CrewAI API reference free to read?

Yes. Every page is free to read on DevShelfHub and focuses on practical usage rather than auto-generated stubs.

How do I search for a CrewAI class or decorator?

Use the search box at the top of this page to filter cards by name, then switch tabs for classes, methods, or decorators depending on what you need.

How does this reference relate to the official CrewAI docs?

DevShelfHub complements the official docs with opinionated when-to-use guidance, pitfalls, and cross-links between related APIs so you can navigate the framework faster during implementation.

Where should I start if I am new to CrewAI?

Read the CrewAI introduction and core concepts tutorials on DevShelfHub first, then return here when you need class-level detail while coding agents, tasks, crews, flows, or A2A integrations.