Free

CrewAI: build a multi-stage AI workflow in Python

Build a practice CrewAI workflow in Python for extracting facts, drafting and checking sources. Save each stage's result and test it with known data.

Tools

Installation instructions · Download source code (ZIP)

CrewAI combines several AI stages into a Python workflow. One stage might extract facts, another draft a report and a third check it against the sources.

What you can use it for

  • Turn a set of documents into a verifiable report.
  • Draft source-based content and send it to a person for approval.
  • Repeat data processing while retaining each stage's output.

How to install and start

  1. Ask Codex to check Python and install the uv package manager using its official documentation. CrewAI requires Python 3.10 or later, below 3.14.
  2. Install the CLI: uv tool install crewai.
  3. Create a separate practice project with crewai create crew and a chosen name. Configure a model and two simple tasks, such as extracting facts and preparing a report.
  4. In the project folder, run crewai install, then crewai run. Store model keys in local environment settings, not Git.

The official installation guide helps you choose a setup. Costs depend on the model, number of stages and retries.

How to work alongside Codex

CrewAI runs as a separate program, not a Codex plugin. Codex can create its project, define tasks, run the workflow and inspect output files. For a one-off task, try Codex itself first: a separate system is useful when the process genuinely repeats.

Useful instructions

Your first workflow automation covers inputs, outputs and verification. An assistant for your documents suits a document-search workflow. CrewAI is one possible implementation of these scenarios.

How to check the result

Start with a small collection containing known facts. Check the output against it, then repeat with the same input. Results should neither disappear nor become duplicates. Check what happens when a key is missing or a model fails. A second agent repeating the first answer is not a substitute for checking the document.

Prompt for Codex

Paste this into Codex with access to the project folder. Start with a local workflow and one verifiable output.

Help me automate a recurring task with CrewAI. First establish the inputs, intended output and how to verify it. Find current official CrewAI documentation and check the environment. After approval, create a separate practice project with the minimum useful stages, configure safe key storage, run a small example and verify the output against its sources. Do not publish automatically. Explain how to repeat the run and fix common errors.
Ask questions to make it better and suggest improvements.
In This Article
Saved