Quick Start
Two tracks: a Python-only Crew (learn the objects) and a Flow + Crew (the official production entry). CLI scaffolding is in Installation; the snippets below run as scripts.
Set .env: OPENAI_API_KEY. Web-search examples also need SERPER_API_KEY (serper.dev).
Minimal Crew (Python)
What happens: kickoff runs the task list with Process.sequential. The agent reasons from role / goal / backstory. {topic} comes from inputs. The return value is a CrewOutput; use result.raw.
Add a search tool
Requires pip install 'crewai[tools]' and SERPER_API_KEY. More in Tools.
Minimal Flow: @start and @listen
Official Flow decorators include @start() (entry points) and @listen(...) (run after another method completes). Production apps keep state on the Flow and put autonomous work in a Crew step.
Flow[ResearchState] uses Pydantic for structured state; a dict also works. kickoff() returns the last completed method’s return value. flow.plot() writes an HTML diagram.
CLI equivalent: crewai create flow latest-ai-flow, configure agents in crew.jsonc, load with from crewai.project import load_crew, then crew.kickoff(...) inside @listen. See the official Quickstart.
Talk to one agent
With no task list, use Agent.kickoff():
Checklist
- Install
crewai(oruv tool install crewai) and setOPENAI_API_KEY - Run the minimal
Crew.kickoff - Add
SerperDevToolif you have a Serper key - Wrap the same Crew in a
@start/@listenFlow - Continue with Agents and Crews and Processes