Frameworks to Build AI Agents
The libraries to build your own agents: OpenAI Agents SDK, Pydantic AI, smolagents, Google ADK, LlamaIndex, Semantic Kernel, Mastra, Agno and Haystack.
-
The OpenAI Agents SDK
The OpenAI Agents SDK is a lightweight Python framework for building agents and multi-agent workflows with few primitives: agents, tools, handoffs, guardrails, sessions and built-in tracing. It is the production-ready evolution of Swarm, works with the OpenAI API and with over 100 other LLMs.
-
Pydantic AI: typed agents
Pydantic AI is the agent framework from the Pydantic team: you build agents in Python where every model output is validated against a type you define. You declare the expected answer as a Pydantic model and the agent guarantees that structure, with dependency injection, tools and support for more than twenty model providers.
-
Hugging Face smolagents: Agents That Think in Code
smolagents is Hugging Face's agent library: in under a thousand lines of code it lets you build an agent that reasons by writing Python instead of filling in JSON. Its CodeAgent runs those actions as code, takes around 30% fewer steps than classic tool calling and works with any model, local or API.
-
Google ADK: The Agent Development Kit for Building Agents
Google ADK (Agent Development Kit) is Google's open-source framework for building, evaluating and deploying AI agents. It is code-first, works with Gemini and other models via LiteLLM, and offers workflow agents, tools and memory. Version 2.5.0 landed in July 2026 and deploys straight to Vertex AI.
-
Building Agents with LlamaIndex
LlamaIndex is a Python framework focused on connecting your data to a language model. Its AgentWorkflow module lets you build agents that reason and call tools: FunctionAgent for models with function calling, and ReActAgent for any model. This guide shows how to turn a RAG pipeline into an agent that acts over your own documents.
-
Microsoft’s Semantic Kernel
Semantic Kernel is Microsoft's open-source kit for integrating AI models into C#, Python and Java through a kernel that orchestrates plugins and functions. In 2026 its successor is Microsoft Agent Framework, which merges Semantic Kernel and AutoGen; Semantic Kernel itself keeps support for at least one more year.
-
Mastra: Agents in TypeScript
Mastra is an open-source TypeScript framework for building AI agents and applications with a single package: agents, tools, workflows, memory, RAG and evals. It was built by the team behind Gatsby, hit version 1.0 in January 2026 and connects to over 40 model providers through one interface.
-
Agno: a high-performance agent framework
Agno, the Python framework formerly known as Phidata, builds AI agents with one clear goal: performance. It creates each agent in about two microseconds and uses roughly 3.75 KiB of memory, so it scales to thousands of concurrent agents. It offers agents, teams and workflows, over twenty model providers and the AgentOS runtime.
-
Haystack: Pipelines and Agents
Haystack is a Python framework by deepset, Apache 2.0 licensed, for building AI applications as pipelines of connected components: retrievers, generators and routers. Since the 2.0 rewrite it allows cycles, which lets you add an Agent component that calls tools in a loop. It serves both RAG and production agents.