Skip to content
AI Engineering
The Tooling Landscape

Agent frameworks: do you need one?

A framework packages the agent loop, tool plumbing and state. It helps with speed and costs you visibility.

Chapter 12: The Tooling LandscapeLesson 3 of 4Level: CoreAbout 12 min
Words on this page (13)
agent
: A model run in a loop that chooses its own tools and steps until the task is done.
tool
: A function the model can ask your program to run, described by a name, description and argument schema.
SDK
: Software development kit: a library that wraps an API for a programming language.
guardrail
: A rule or check that limits what a system may do or output.
Hugging Face
: A hub for sharing open models, datasets and demos, and the maker of widely used libraries.
retrieval
: Finding the most relevant pieces of text for a query.
trace
: The full record of one run: inputs, model calls, tool calls, outputs, timing and cost.
prompt
: The input text you give a model, including instructions, examples and data.
weights
: The learned numbers that define a trained model. A model whose weights are published is called open-weight.
tool use
: The model asks your program to run a function and reads the result.
system prompt
: Standing instructions placed at the start of every call that set the model's role and rules.
logarithm
: The power you raise a base to in order to get a number. log base 2 of 8 is 3 because 2 to the power 3 is 8.
API
: Application programming interface: a way for one program to call another, usually over HTTP.

The options

LangGraph models an as a graph of steps with persistent state. Pydantic AI builds typed agents around validated outputs. The OpenAI Agents and Claude Agent SDK provide the loop, , handoffs and from each lab. smolagents from is a small library where agents write and run code. CrewAI and AutoGen focus on multiple cooperating agents. LlamaIndex and Haystack lean toward and document pipelines. The OpenAI Agents SDK (with AgentKit for visual building), Google's Agent Development Kit (ADK) and Vertex AI Agent Builder are the labs' own offerings.

Do you need one?

You can write the core loop in under 100 lines. A framework is worth it when you need durable state, human approval steps, or many integrations. It is a cost when it hides or makes behavior hard to inspect. A sound path is to write the loop yourself once to learn it, then choose a framework with that understanding.

A worked example: when a framework earns its place

You need an agent that can pause for human approval, survive a server restart and resume from the same step. Building that yourself takes weeks. A framework with checkpoints gives it to you. For a script that calls a model twice, a framework is more than help.

How to evaluate one

Can you see the exact prompts it sends? Can you swap models? How does it handle errors and retries? Who maintains it and how often does it break? Try it on a small real task before committing.

What a framework does for you

Every agent has the same loop: call the model, check for a , run it, add the result and repeat until done. A framework wraps that loop and adds three things: saved state, retries and tracing.

Saved state is the part beginners miss. Imagine a six-step task that pauses for approval at step 4. The framework writes a checkpoint after each step. If the server restarts, it resumes at step 4 instead of step 1. Doing this by hand means handling storage, repeated steps and half-finished tool calls.

A second example: the framework gets in the way

You want to change one sentence of the . Some frameworks add their own instructions around yours and builds the final prompt several layers down. Your edit does nothing visible. To confirm, the raw request sent to the provider, or use the framework's tracing, and read what the model actually received. If you cannot do either, treat that as a warning sign.

Trade-offs

Benefits: less code for state, approvals and tracing, and a shared structure for a team. Costs: a new set of ideas to learn, upgrades that can break your code, and abstractions that leak when something goes wrong. Moving off a framework later is work, because its concepts spread through your code.

Real mechanism versus marketing: nothing in a framework makes the model smarter. It organizes the same calls.

Try it yourself

  1. Write the loop yourself in about 30 lines, with one tool and a step cap.
  2. Rebuild the same agent in a framework you are curious about.
  3. Compare line counts.
  4. Check whether you can print the exact prompt each version sends.
  5. Break a tool on purpose and see which version gives the clearer error.

Expect the framework version to be shorter and the hand-written one to be easier to inspect.

Common mistake

Choosing by popularity alone.

Check yourself

When is a framework most worth using?

What is the main risk of a framework?

You can write your agent loop in 80 lines. Why might that be a good first step?

Go deeper

  • Repo
    LangGraphRepo★ 43k

    LangChain · Graph-based orchestration with state and human-in-the-loop.

  • Repo
    Pydantic AIRepo★ 21k

    Pydantic · Typed agent framework.

  • Repo

    OpenAI · Lightweight agents, handoffs and guardrails.

  • Repo

    Anthropic · The agent loop behind Claude Code as a library.

  • Repo
    smolagentsRepo★ 30k

    Hugging Face · Minimal agent library.

  • Docs

    Anthropic · The agent loop, tools and permissions as a library.

  • Docs

    Google · Google's open-source framework for building and deploying agents.

  • Docs

    deepset · Pipelines for retrieval and agent workflows.

  • Docs

    LlamaIndex · Data connectors, indexes and agent workflows over your documents.

  • Article

    OpenAI · OpenAI's visual builder and agent platform.

Spotted a mistake or something unclear? Report it on GitHub.

On this page