# AI agent framework

> Canonical: https://skillalmanac.com/glossary/ai-agent-framework | Last verified: 2026-11-24 | Index status: not offered to search engines

An AI agent framework is a software library that supplies the reusable parts of an agent, such as the model-and-tool loop, tool definitions and state handling, so developers write less of that code themselves.

Also called: agent framework, AI agent frameworks, agentic framework, agent frameworks, LLM agent framework.

## In plain language

An AI agent framework is a toolkit for building agents. An agent is a program where an AI model decides what to do next, uses tools such as search or file access, and repeats until the task is done. Without a toolkit, you write that loop, the tool descriptions and the memory handling yourself. A framework gives you ready-made versions. It is like building a website with a template system instead of from blank files. LangChain and LangGraph are two examples. The trade-off is that a framework adds layers between you and the model. Anthropic warns that this can hide the prompts and responses and make problems harder to debug.

## Technical definition

A framework wraps the agent loop: it sends messages and tool schemas to a model, parses tool-call requests, runs the matching function, appends the result and repeats until a stop condition. On top of that it commonly provides a uniform interface across model providers, persistence of state between steps, streaming of events, and a way to pause for human review. Designs differ. Some are high-level agent constructors; some, such as LangGraph, describe the workflow as a graph of shared state, nodes and edges.

## How it shows up when you use agents

Coding agents such as Claude Code and Codex are finished products. An agent framework is something different: a library you use when you build your own agent inside an application. You meet one when a team says "we built our support agent on a framework", or when a tutorial starts with an install command for one. [LangChain](/glossary/langchain) describes create_agent as a minimal, highly configurable harness, and LangGraph, from the same family, describes itself as a low-level orchestration framework and runtime for long-running, stateful agents.

What breaks when this is misunderstood: teams pick a framework before they understand the loop underneath, then cannot tell whether a failure comes from the prompt, the tool or the framework. Anthropic's guidance says frameworks add abstraction layers that obscure prompts and responses.

Next action: build the smallest loop once without a framework, as in the guide [How to build an AI agent](/learn/build-an-ai-agent). Then judge a framework by what it saves you: state saving, pausing for human review, or one interface for several model providers. The [agent harness](/glossary/agent-harness) term covers the same idea from the product side, and an [AI agent](/glossary/ai-agent) is what the framework produces.

## Common confusions

- **Framework versus agent.** A framework is code you build with. The agent is what runs, made of a model, tools and the loop.
- **Framework versus model API.** The API gives you the model. A framework sits on top of one or more APIs and adds loop, state and integration code.
- **Framework versus agent harness.** A harness is the runtime around a model in a finished product. A framework is a library for building one yourself. The line is blurry, because a framework can be used to build a harness.
- **Myth.** You need a framework to build an agent. Anthropic's guide recommends starting with the API directly, and a working loop is short.

## Worked examples in this catalogue

### [How to Build an AI Agent: A Minimal Tool Loop](https://skillalmanac.com/learn/build-an-ai-agent)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A minimal agent in one Python file: a loop that sends tools to the model, runs each requested tool, returns the results and stops at a hard cap on iterations.

Why it exercises the concept: It shows the loop that a framework packages for you. Building it once by hand makes it clear what a framework is hiding.

### [claude-api](https://skillalmanac.com/skills/anthropic/claude-api)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A reference for building applications on the Claude API and the Anthropic SDKs across several languages.

Why it exercises the concept: It covers working with the model API directly, which Anthropic suggests as a starting point before adopting a framework.

### [Claude Code](https://skillalmanac.com/tools/claude-code)

```
claude
```

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: An interactive coding agent that starts in your terminal, ready to take a task in your project folder.

Why it exercises the concept: It is a finished agent product, the contrast case: you use it as it is, whereas a framework is a library you build your own agent with.

## Related terms

- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)
- [Agent harness](https://skillalmanac.com/glossary/agent-harness.md)
- [Tool calling (function calling)](https://skillalmanac.com/glossary/tool-calling.md)
- [LangChain](https://skillalmanac.com/glossary/langchain.md)
- [Multi-agent system](https://skillalmanac.com/glossary/multi-agent-system.md)
- [Model Context Protocol (MCP)](https://skillalmanac.com/glossary/model-context-protocol.md)
- [Semantic Kernel](https://skillalmanac.com/glossary/semantic-kernel.md)
- [AutoGen (Microsoft)](https://skillalmanac.com/glossary/autogen.md)
- [PydanticAI](https://skillalmanac.com/glossary/pydantic-ai.md)
- [smolagents](https://skillalmanac.com/glossary/smolagents.md)

## Sources

- [LangChain overview](https://docs.langchain.com/oss/python/langchain/overview), LangChain (accessed 2026-11-23)
- [LangGraph overview](https://docs.langchain.com/oss/python/langgraph/overview), LangChain (accessed 2026-11-23)
- [Building effective agents](https://www.anthropic.com/engineering/building-effective-agents), Anthropic (accessed 2026-11-23)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
