Agent framework

Also known as: agent SDK

On this page 7

An agent framework is a software library or SDK that provides the reusable building blocks for AI agents: the control loop that lets a language model reason and act, interfaces for tool calling, state and memory handling, multi-step orchestration, and observability. Developers use it to turn a model that only produces text into a system that plans, calls functions, reads results and continues until a goal is reached.

The synonym agent SDK is common when a model provider publishes the library for its own models. Whatever the name, a framework does not make a model smarter. Its value lies in reliable plumbing: consistent message formats, retries, permissions, tracing and the structure needed to test and operate agents in production.

What an agent framework provides

At its core, an agent framework implements the agent loop: send the conversation and available tool definitions to the model, detect whether the model requested a tool, execute that tool, append the result, and repeat until the model returns a final answer or a stop condition is met. Everything else in the framework supports this loop.

The table below lists the components most frameworks share and the problem each solves.

ComponentRoleTypical form
Agent loop runnerAlternates model calls and tool executionRun function with step limit
Tool interfaceDescribes functions the model may callSchemas generated from typed functions
Memory and stateKeeps conversation and task dataMessage history, stores, checkpoints
OrchestrationCoordinates steps or several agentsGraphs, handoffs, supervisors
GuardrailsValidates inputs, outputs and actionsChecks, approvals, policy hooks
TracingRecords every step for debuggingSpans with prompts, calls and costs
Core components of an agent framework

Many frameworks also support the Model Context Protocol (MCP), which lets an agent use tools exposed by external servers through a standard interface instead of custom integrations.

Architectural styles

Agent frameworks differ mainly in how much control flow they leave to the model. At one end, the model decides each next step freely in a loop; at the other, developers define an explicit graph in which the model only fills in specific decisions. The right point on this spectrum depends on how predictable the task is.

StyleWho decides the next stepBest fit
Single-agent loopThe model, at every stepOpen-ended tasks with good tools
Graph or state machineDeveloper-defined edges, model at branchesRepeatable business workflows
Supervisor with subagentsA coordinating agent delegatesTasks splitting into specialist parts
Conversational multi-agentAgents exchange messages in turnsDebate, review and simulation
Handoff chainEach agent passes control to the nextTriage and routing scenarios
Common orchestration styles

Graph-based designs make checkpointing and resumption easier, which matters for long-running tasks and for human-in-the-loop approvals, where execution must pause for hours and continue exactly where it stopped.

Framework, protocol and agent compared

Several neighboring terms are easily confused. An AI agent is the running system that pursues a goal; the framework is the library used to build it; a protocol such as MCP or the Agent2Agent protocol defines how agents connect to tools or to each other, independent of any framework.

TermWhat it isRelation to the framework
AI agentA system that acts toward a goalBuilt with a framework or by hand
Tool callingModel capability to request functionsThe mechanism the framework drives
MCPProtocol for exposing tools and contextPlugged into frameworks as a tool source
Agent orchestrationCoordination of steps and agentsA feature set inside frameworks
Workflow engineGeneral durable task executorSometimes hosts framework-based agents
Agent framework versus related terms

Choosing an agent framework

Choosing an agent framework starts with the question of how much abstraction the task needs. A simple tool-using assistant can be written in a few dozen lines against a model API; a framework pays off when the system needs persistence, multiple agents, approvals, evaluation and production monitoring.

SituationRecommended choiceReason
One model, a few toolsDirect API calls or a thin SDKFewer layers to debug
Long-running, resumable tasksGraph framework with checkpointsDurable state and recovery
Strong vendor alignmentThe provider’s own agent SDKEarly access to model features
Need to switch modelsModel-agnostic frameworkAvoids lock-in to one provider
Regulated actionsFramework with approvals and audit tracesSupports review and accountability
Decision guide for framework selection

Other criteria include language support, maturity of the documentation, stability of the API between versions, support for streaming, and how easily the framework can be tested with recorded runs rather than live model calls.

Pitfalls in practice

Most failures of agent systems come from unclear tools and missing limits, not from the framework itself. A model chooses tools from their names and descriptions, so vague descriptions lead to wrong calls, and an agent without a step or cost budget can loop for a long time.

  • Over-abstraction: heavy frameworks can hide prompts and make behavior hard to reason about.
  • Too many tools: dozens of similar tools confuse selection; group or reduce them.
  • Unbounded loops: set maximum steps, timeouts and spending limits.
  • Prompt injection through tool output: text from web pages or files may try to redirect the agent.
  • Weak evaluation: without task-level test suites, changes cannot be judged safely.

Least-privilege permissions are essential. Tools that write, send or delete should require explicit confirmation or run in a sandbox, and every action should be traceable after the fact.

The simple explanation

A language model on its own can only talk. An agent framework gives it hands and a checklist. It connects the model to tools such as search, a calendar or a database. It also keeps track of what has been done so far.

Think of it as the frame and wiring of a robot, while the model is the brain. A good frame does not make the brain cleverer. It makes the robot dependable, safe and easier to repair.

How it is used in practice

An insurance company builds an assistant that prepares claim files. Using a graph-based agent framework, the team defines four steps: read the claim form, fetch the policy from an internal system, check coverage rules, and draft a recommendation. Each step exposes only the tools it needs, and the policy lookup tool is read-only.

Before any recommendation reaches the customer, the graph pauses for a claims handler’s approval, and the framework stores a checkpoint so the case can resume the next day. Tracing records every model call and tool result. During a pilot of several hundred claims, handlers review complete drafts instead of assembling files manually, and every recommendation remains auditable step by step.