Summary
The same coding agent in CrewAI, the OpenAI Agents SDK and LangGraph — and when to pick each
If you are building your own agent rather than running OpenClaw or Hermes, this is a quick orientation to the three most common Python frameworks. It uses one coding agent with four tools, built three times, from simplest to most control.
"How to Build AI Agents in Python - 3 Ways" by Tech With Tim — Watch on YouTube →
The shared agent
Every version gets the same four tools: list files, read file, write file, run command. That's enough for a small coding agent. In all three frameworks, a tool is a typed Python function with a decorator. Type hints matter because the framework turns them into the schema the model uses to call the tool.
CrewAI — describe it and run it
Simplest of the three. You describe an Agent (role, goal, backstory, tools, LLM), wrap work in a Task (description, expected output, agent), and run a Crew. The loop and memory are handled for you. His two-agent version pairs a read-only "tech lead" planner with a coder, passing the plan through context=[plan_task]. The shape he shows:
pip install crewai
# Agent(role=..., goal=..., backstory=..., tools=[...], llm=..., verbose=True)
# Task(description=..., expected_output=..., agent=..., context=[...])
# Crew(agents=[planner, coder], tasks=[plan_task, build_task]).kickoff()
Tip from the video: give the planner only non-destructive tools.
OpenAI Agents SDK — the middle ground
You manage the session yourself (he uses a SQLite session passed to the runner), and in return you get more control. The advanced example has four agents:
- a guardrail agent with a Pydantic structured output (
is_destructiveplus reasoning) wired in as an input guardrail. "Delete all the files" trips it before anything runs; - a triage agent with handoffs to a coder and an explainer, each with a handoff description so triage knows when to use it.
LangGraph — own the loop
The most complex and the most production-ready. There is no built-in agent loop. You build a StateGraph of nodes (agent, tools) and edges, including a conditional "should continue?" edge, and each node returns updated state. You call tools yourself, add a checkpointer, and get full observability and replay. His advanced version nests each specialist as a subgraph, adds a triage node with structured output, and adds a reviewer node that can send work back to the coder, with a maximum-revisions cap to stop infinite loops.
Which to choose
- CrewAI: fastest path to a working multi-agent pipeline you can describe in plain language.
- OpenAI Agents SDK: handoffs, guardrails and structured output without hand-writing the loop. Best if you're already on OpenAI models.
- LangGraph: when you need to control every transition, add human-in-the-loop, or run cycles like coder↔reviewer in production.
Code in the video is a high-level tour, not a full tutorial. APIs change, so check each framework's own docs (CrewAI, OpenAI Agents SDK, LangGraph) before copying. Deeper LangGraph coverage: freeCodeCamp's LangGraph course. (Includes a sponsor segment.)





