Comparisons / Agno vs OpenAI Agents SDK
Agno vs OpenAI Agents SDK: Which Agent Framework to Use?
Agno agno (formerly phidata) is a lightweight python framework for building agents. OpenAI Agents SDK openai's agents sdk (evolved from swarm) provides agent, runner, handoffs, and guardrails. Here is how they compare — and what the same patterns look like in plain Python.
By the numbers
Agno
39.2k
5.2k
Python
Apache-2.0
2022-05-04
Agno (formerly Phidata)
OpenAI Agents SDK
20.6k
3.4k
Python
MIT
2025-03-11
OpenAI
GitHub stats as of April 2026. Stars indicate community interest, not necessarily quality or fit for your use case.
| Concept | Agno | OpenAI Agents SDK | Plain Python |
|---|---|---|---|
| Agent | `Agent(model=OpenAIChat(), instructions=[...])` class with `run()` method | `Agent(name, instructions, model, tools)` | A function that POSTs to `/chat/completions` and returns the response |
| Tools | Function tools via `@tool` decorator or built-in toolkits (web search, SQL, etc.) | Python functions with type hints, auto-converted to schemas | A dict of callables: `tools = {"search": search_web, "sql": run_query}` |
| Agent Loop | `Agent.run()` handles tool dispatch internally, configurable via `show_tool_calls` | `Runner.run()` handles the loop internally | A `while` loop: call LLM, check for `tool_calls`, execute, repeat |
| Memory / Knowledge | Knowledge bases (PDF, URL, vector DB) injected via `knowledge` param + built-in memory | — | A list of relevant chunks injected into the system prompt via a retrieval function |
| Multi-Agent (Teams) | `Team` class with `agents` list, `mode` (sequential, parallel, coordinate), and shared memory | — | A function that calls agent functions in sequence or parallel, passing results between them |
| Storage | `SqlAgentStorage`, `PostgresAgentStorage` for persisting sessions and state | — | `json.dump()` / `json.load()` to a file, or a simple DB insert |
| Handoffs | — | `Handoff` between `Agent` objects for multi-agent routing | Call a different agent function based on the LLM's tool choice |
| Guardrails | — | `InputGuardrail` and `OutputGuardrail` with tripwire pattern | Two lists of rule functions checked before and after the LLM |
| Context | — | Typed context object passed through the agent lifecycle | A `state` dict updated inside the loop |
What both do in plain Python
Every concept in the table above — agent, tools, loop, memory, state — maps to a handful of Python primitives: a function, a dict, a list, and a while loop. Both Agno and OpenAI Agents SDK wrap these primitives in their own class hierarchies and APIs. The underlying pattern is the same ~60 lines of code. The difference is how much ceremony each framework adds on top.
When to use Agno
Agno adds value when you want a batteries-included agent with minimal boilerplate — especially for multi-modal agents or team orchestration. But each of its abstractions maps to a small piece of plain Python. If your agent is straightforward, writing it directly gives you full control with zero framework overhead.
What Agno does
Agno gives you a single `Agent` class that wires together an LLM, tools, instructions, knowledge bases, and storage. You configure an agent **declaratively** — pass in a model, a list of tools, and optional knowledge sources — and call `agent.run()`. It handles the tool-calling loop, injects knowledge into context, and persists conversation state. Agno also supports **multi-modal agents** (vision, audio) and team-based orchestration where multiple agents coordinate on tasks. The framework ships with built-in toolkits for common tasks: - web search - SQL queries - file operations Compared to LangChain, it's **lighter** — fewer abstractions, less indirection. The tradeoff is a smaller ecosystem and fewer third-party integrations.
The plain Python equivalent
Every Agno abstraction maps to plain Python. The `Agent` class is a function that POSTs to the LLM API, checks for `tool_calls`, dispatches them from a dict, and loops. Knowledge bases are a retrieval function that fetches relevant chunks and injects them into the system prompt. Memory is a `messages` list. Storage is `json.dump()`. Teams are a function that calls multiple agent functions and combines their outputs. The entire agent — with tools, knowledge retrieval, memory, and multi-agent coordination — fits in about **60 lines**. No base classes, no decorators. When something breaks, you debug your function, not a framework's internals.
When to use OpenAI Agents SDK
The Agents SDK is the thinnest framework on this list — it barely abstracts beyond what you'd write yourself. Use it when you want OpenAI's conventions and auto-schema generation. Skip it when you want full control or use non-OpenAI models.
What the OpenAI Agents SDK does
The Agents SDK (formerly Swarm) is OpenAI's opinionated take on agent architecture. It provides **four primitives**: - `Agent` (system prompt + tools + model) - `Runner` (the agent loop) - handoffs (routing between agents) - guardrails (input/output validation) The key feature is **auto-schema generation** — write a Python function with type hints and the SDK converts it to a JSON tool schema automatically. `Runner.run()` handles the loop: call the model, check for tool calls, execute them, repeat. Handoffs let one agent transfer control to another by returning a special tool call. It's **deliberately thin**. OpenAI designed it as a reference implementation showing how agents should work with their API, not as a batteries-included framework.
The plain Python equivalent
The Agents SDK is **already close to plain Python**, which says something. `Agent` is a function that takes `messages` and returns a completion — the system prompt is the first message, tools are a dict. `Runner.run()` is a `while` loop: call `openai.chat.completions.create()`, check if the response has `tool_calls`, execute the matching functions from your `tools` dict, append results to `messages`, repeat until the model responds without `tool_calls`. Handoffs are an `if` statement: if the model calls a `"transfer_to_research"` tool, call the research agent function instead. Guardrails are two lists of validation functions — run the input rules before calling the LLM, run the output rules after. The **auto-schema generation** is the only piece that takes more than a few lines to replicate.
Or build your own in 60 lines
Both Agno and OpenAI Agents SDK implement the same 8 patterns. An agent is a function. Tools are a dict. The loop is a while loop. The whole thing composes in ~60 lines of Python.
No framework. No dependencies. No opinions. Just the code.
Build it from scratch →