Module 10 — Project: a documentation writing crew
Everything the course built points at one deliverable: a 10-page product documentation, written end to end from an 800-word rough brief, by a four-agent crew that a team can trust to review a week later. This final module assembles the pieces from modules 2 through 9 into a runnable file, ships the documentation, then compares the result honestly with a single strong agent and with a human writer. The point is not to declare a winner — it is to be able to defend the choice.
The assembled crew
The full file is fifteen readable lines of orchestration on top of the code the previous modules already introduced.
from crewai import Crew, Process, Task
# Agents come from module 2: analyst, writer, reviewer, manager
# Tools come from module 5: read_brief, style_guide_check, list_drafts
# Task definitions extract_features, draft_sections, review_draft,
# arbitrate, finalise come from module 3, with output_pydantic wiring.
crew = Crew(
agents=[analyst, writer, reviewer, manager],
tasks=[extract_features, draft_sections, review_draft, arbitrate, finalise],
process=Process.sequential,
memory=True,
max_rpm=30,
verbose=True,
)
if __name__ == "__main__":
result = crew.kickoff(inputs={"brief_path": "input/brief.md"})
print(result.raw)
print("Usage:", crew.usage_metrics)
Two lines of hygiene are missing from this snippet but present in the production file: log crew.usage_metrics to a JSON in the run's timestamped folder (module 8), and copy the input brief into the same folder for provenance. A run you cannot cost and a run you cannot reproduce are two different flavours of the same problem.
What actually happens on kickoff
- T = 0 s — the Analyst reads
input/brief.mdviaFileReadTool, extracts features into a validatedExtractionobject, writes it todrafts/features.json. One model call, roughly 900 output tokens. - T ≈ 10 s — the Writer receives the Extraction (via
context=[extract_features]), drafts ten sections, writesdrafts/sections.json. One model call, 3 200 output tokens. - T ≈ 25 s — the Reviewer reads the source brief and the drafts, runs
style_guide_checkon each section, returns a verdict + issues list. One model call plus one tool call per problematic section. - T ≈ 35 s — the Manager reads the verdict. On the sample brief, verdict is
rejectwith two stylistic issues; Manager delegates a focused rewrite of sections 4 and 7 to the Writer (one delegation call). - T ≈ 45 s — the Writer emits the finalised markdown
documentation.md. One last model call, ~3 500 tokens.
Total: 6 model calls, ~$0.04, 45 seconds. Everything lands in runs/2026-09-06_142312/.
The comparison the team will ask for
Same brief, three runners.
| Runner | Wall-clock | USD | Coverage of brief features | Fabricated features | Style-guide violations |
|---|---|---|---|---|---|
Single gpt-4o agent, one prompt | 22 s | 0.03 | 84 % | 2 | 6 |
| Four-agent CrewAI pipeline | 45 s | 0.04 | 96 % | 0 | 1 |
| Human writer (documentation lead) | 3 h | 220 | 100 % | 0 | 0 |
Three honest observations. First, the crew is not free relative to the single agent — it doubles latency and adds a third to the cost — but it catches the fabricated features and cuts style violations by 5. On documentation shipped to customers, that trade is worth it. Second, the crew is not a substitute for the human — it still misses 4 % of features and lets one style issue through. Third, the crew is thousands of times cheaper than the human on the pieces it does well; the honest deployment is a human review after a crew draft, not either alone.
Deciding whether to ship
Three thresholds, agreed with the team before the first run.
- Fabrication rate ≤ 1 %, measured on a labelled test set of 20 briefs. If the crew crosses this line, ship. Otherwise, add a rule to the Reviewer's
style_guide_checkand rerun. - Reviewer verdict distribution. On the test set, 60 to 80 %
approve, 20 to 40 %rejectwith stylistic issues, under 5 %rejectwith factual issues. A run where the Reviewer approves everything is a Reviewer that has stopped checking. - Cost per accepted draft, not per run. A crew that produces a bad draft that the team throws away has cost $0.04 for nothing; the metric that matters is $ / (accepted draft), and it should stay under 10 % of the human baseline for the crew to earn its place.
Those three numbers are the ones that go into the go/no-go meeting.
What happens after week one
Two habits keep the crew useful past the honeymoon.
- Freeze the model versions and the prompt text. Pin
gpt-4o-2024-11-20, pingpt-4o-mini-2024-07-18, and commit the exact backstory strings to git. A silent provider upgrade or a well-meaning teammate rewriting a goal are the two most common causes of a drop in quality nobody can explain. - Grow the style guide, not the Reviewer. When a new style rule appears, add it to the file
style_guide_checkreads — not to the Reviewer's prompt. The tool is versioned, the prompt is not. This distinction pays off every time a new hire needs to explain why the crew rejects a paragraph.
The final honest sentence
A CrewAI pipeline is the right tool for documentation exactly because it separates the writing from the checking, and can afford to check on every draft in a way a human team cannot. It is the wrong tool for documentation exactly because the checker is another model, subject to the same failure modes, and no crew replaces the one careful human review before publication. The productive posture is to ship the crew's output to the human as a first draft that has already been sanity-checked, and keep the human's veto absolute.
Every serious deployment of a CrewAI pipeline in production keeps a human veto in the loop somewhere — before publication, before a customer email, before a billing decision. The crew is a first draft with a second pair of model eyes; the human is the third pair, non-negotiable.
Summary
- The final crew is four agents, five tasks, sequential, memory on,
max_rpm=30— assembled in fifteen lines on top of the code modules 2 to 9 built. - On our sample brief the crew delivers ~$0.04, 45 s, 96 % feature coverage, 0 fabrications, 1 style violation against a single-agent baseline of 84 % coverage and 2 fabrications.
- Three ship gates: fabrication rate ≤ 1 %, healthy verdict distribution, cost per accepted draft under 10 % of the human baseline.
- After launch, pin model versions, freeze prompts, grow the style guide file — and keep a human veto before publication, non-negotiable.
Next module: the recap of the whole course and the 40-question exam that closes it.