Agent Frameworks & SDKs

OpenAI Agents SDK, Pydantic-AI, smolagents, Strands, and LangGraph — pick by what your agent needs.

The framework layer is where you actually wire a model to tools and get a working agent loop. Each of the five covered here optimizes for a different shape of the same problem — pick based on what your agent actually needs to do, not by star count.

Quick pick: OpenAI-first production loop → OpenAI Agents SDK; typed outputs and tests → Pydantic-AI; minimal Hugging Face stack → smolagents; AWS-native simplicity → Strands; explicit graphs and branching → LangGraph. See our Python AI SDKs comparison for a longer side-by-side.

OpenAI Agents SDK

Pydantic-AI

smolagents

Strands Agents SDK

LangGraph

Why it matters

Choosing the wrong abstraction (graph vs simple loop) wastes weeks when requirements change. In interviews people ask why you picked a framework, not that you imported one.

Where people get stuck

  • Using LangGraph for a single-tool chatbot. Graph complexity should match how much you branch and how durable the run has to be.
  • Switching frameworks every week. Learn one loop properly, then compare with a reason.
  • Ignoring lock-in. Know what is portable (tool schemas, prompts) and what is tied to one SDK or host.

Try this

Write five bullets on what your agent needs (branching, AWS, Hugging Face models, strict types, minimal dependencies) and map each one to a framework in this chapter.

Interview question

How do you choose an agent framework?

Match control flow (linear or graph), hosting, typing and testing needs, cloud vendor and team familiarity. Then prototype your riskiest tool call in it for a day.

YouTube learning

Core concepts from video walkthroughs:

Threads in the same domain as this chapter — go deeper on iHateReading without leaving the roadmap.

Python AI agent SDKs in 2026: OpenAI vs Pydantic-AI vs smolagents vs Strands cover

Python AI agent SDKs in 2026: OpenAI vs Pydantic-AI vs smolagents vs Strands

Same three-tool agent in four frameworks — pick by execution model and testing needs.

Agent harnessing: the part of building AI agents nobody talks about cover

Agent harnessing: the part of building AI agents nobody talks about

Loop, tools, memory, sandbox, and tracing live in your code — not the model weights.

Smallest AI Agent cover

Smallest AI Agent

Minimal file-reading agent to learn LLM tool loops without framework magic.

AI Agent cover

AI Agent

What agents are and how they differ from a single chat completion.