CourseAI Engineering: The Complete Course · Module 9: Agents and Tool Use · part 71 of 105
Part 71 · Module 9: Agents and Tool Use

Lesson 4: One returns task, four frameworks, compared

16 min read·13 Oct 2026
Module 9 · Lesson 4 · About 40 minutes · Needs: Lessons 1 to 3 of this module (tools, the loop with limits, the LangGraph approval graph)

The situation

Dev has read that a framework would replace his Lesson 2 loop with five lines. Sam asks what that framework will send to the model on BrightCart's behalf. Marta asks whether it costs more calls.

This lesson answers both with Aisha Rahman's message from Lesson 2: return the robot vacuum (order 5521, past the 30-day window) and the smart bulbs (order 6150, delivered five days ago). The same three tools, built four ways, with every request captured and compared.

ONE TASK, FOUR BUILDS plain loop 16 lines create_agent 6 lines FunctionAgent 9 lines Pydantic AI 5 lines same 3 tools, same message Aisha: orders 5521 and 6150
The same three tools and Aisha's message, built four ways; blue marks your own code, plain boxes the frameworks.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.