PromptisePromptise
PlatformSoonEnterprise
DocsGitHub
Talk to usGet started
Promptise - AI Framework LogoPromptise

The full-stack framework for agentic systems. Build with the framework. Run it on the platform. Launch it with our engineers.

pip install promptise

[01] Product

  • Framework
  • Platform (coming soon)
  • Enterprise
  • How it works
  • Contact

[02] Framework

  • The Agent
  • The Interface
  • The Harness

[03] Resources

  • Documentation
  • GitHub
  • Why Promptise
  • Use cases
  • Roadmap
  • Guides
  • Learning Paths
  • Questions

[04] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

hello@promptise.com
← Learning paths> Agentic Engineering with Promptise Foundry
Lesson 47 / 100
47%

Best AI Agent Frameworks (2026): Python Options Compared

The best AI agent frameworks in 2026 by use case: LangGraph, Pydantic AI, OpenAI Agents SDK, CrewAI, Google ADK and more, with the same agent in nine.

Intermediate24 minAI Agent FrameworksMulti-Agent SystemsModel Context Protocol (MCP)Human-in-the-Loop
All 100 lessons↓
  1. ✓What Is an AI Agent? Definition, How It Works, Examples
  2. ✓How to Build an AI Agent in Python (2026 Guide)
  3. ✓Build a Personal AI Agent: Memory, Reminders, Chat
  4. ✓What Is an Agent Harness? Parts and How to Build One
  5. ✓System Prompt Best Practices for AI Agents in Python
  6. ✓Best LLM for AI Agents (2026): Picks, Prices, How to Test
  7. ✓AI Agent YAML: Define and Run an Agent From a Config File
  8. ✓Streaming LLM Responses with FastAPI: Tokens and Tool Calls
  9. ✓Best Local LLM for AI Agents: Ollama Models by GPU (2026)
  10. ✓Claude AI Agent with MCP: Use Anthropic Models in Promptise
  11. ✓Gemini AI Agent with MCP: Use Google Models in Promptise
  12. ✓Azure OpenAI Agent with MCP: Use Deployments in Promptise
  13. ✓OpenRouter AI Agent with MCP: Many Models in Promptise
  14. ✓Ollama AI Agent with MCP: Run Local Models in Promptise
  15. ✓LLM Semantic Cache and Model Fallback in Python
  16. ✓What Is MCP (Model Context Protocol)? A Developer's Guide
  17. ✓What Is Tool Calling? LLM Function Calling Explained
  18. ✓MCP Tools vs Resources vs Prompts (With Python Examples)
  19. ✓How to Connect MCP Servers to Your AI Agent in Python
  20. ✓Build a Production MCP Server in Python (Step by Step)
  21. ✓MCP Transports: stdio vs Streamable HTTP vs SSE (Python)
  22. ✓MCP 2026-07-28 Migration: Make Your MCP Server Stateless
  23. ✓OpenAPI to MCP: Turn Any REST API into an MCP Server
  24. ✓MCP Authentication in Python: API Keys, JWT and OAuth
  25. ✓Build an Authenticated MCP Server for Your AI Agent (Python)
  26. ✓MCP Security Best Practices: A Checklist for MCP Servers
  27. ✓Testing MCP Servers in Python: pytest Without a Live Server
  28. ✓Too Many MCP Tools? How to Fix LLM Tool Selection in Python
  29. ✓Idempotent Tool Calls: Make AI Agent Retries Safe
  30. ✓AI Agent Tool Failures: Stop Unsafe Workarounds
  31. ✓MCP Server Caching, Timeouts and Circuit Breakers in Python
  32. ✓MCP Middleware for Servers: Auth, Logging, Rate Limits
  33. ✓MCP vs CLI for AI Agents: Tokens, Security, When to Use Each
  34. ✓LangChain vs MCP: Differences and How They Work Together
  35. ✓FastMCP Alternatives for Production MCP Servers (2026)
  36. ✓AI Agent Audit Logging: Tamper-Evident Logs in Python
  37. ✓AI Agent Human in the Loop: Approve Tool Calls in Python
  38. ✓AI Agent Prompt Injection: How to Defend Against It
  39. ✓Hidden Text Prompt Injection: Sanitize Pages for AI Agents
  40. ✓Build a Multi-Agent System in Python (and When Not To)
  41. ✓Context Engineering for AI Agents: Context Window Management
  42. ✓Context Compaction for AI Agents: Trim vs Summarize
  43. ✓How to Deploy an AI Agent with Docker (2026 Guide)
  44. ✓LLM Tool Rate Limiting: Per-Client Limits for MCP Servers
  45. ✓MCP Long-Running Tasks: Background Jobs in Python
  46. ✓MCP Server Monitoring: Prometheus, OpenTelemetry and Logs
  47. 47Best AI Agent Frameworks (2026): Python Options Compared
  48. 48Self-Improving AI Agent: Learn From Tool Failures in Python
  49. 49AI Agent Identity: Authenticate Agents to MCP Servers
  50. 50Code-Action Agents in Python: One Program vs 37 Tool Calls
  51. 51Multi-Tenant AI Agents: Keep Each Customer's Data Apart
  52. 52What Is Agentic RAG? How It Differs from Classic RAG
  53. 53AI Agent Memory in Python: Short-Term and Long-Term
  54. 54Per-User Agent Memory Isolation: Stop Leaks Between Users
  55. 55Agentic RAG in Python: Give Your AI Agent a Search Tool
  56. 56AI Agent Reasoning Patterns in Python: From ReAct to Debate
  57. 57Plan-and-Execute Agents in Python: Beyond the ReAct Loop
  58. 58Self-Modifying AI Agent in Python: Open Mode & Limits
  59. 59CrewAI Alternatives: 7 Options and How to Migrate (2026)
  60. 60Migrate from AutoGen: Agent Framework, AG2 and More
  61. 61What Is an LLM Guardrail? Types, Examples and Limits
  62. 62Best LLM Guardrails Tools (2026): 9 Platforms Compared
  63. 63AI Agent Guardrails in Python: Block Injection, Redact PII
  64. 64NeMo Guardrails vs Guardrails AI: Which to Choose (2026)
  65. 65AI-Based PII Detection and Redaction Tools for LLM Apps
  66. 66Stop Secrets Leaking Into LLM Logs and Traces
  67. 67AI Agent Code Execution Sandbox: Run LLM Code Safely
  68. 68AI Agent Network Egress: Limit Where Agents Can Connect
  69. 69AutoGen Docker Task Isolation: Secure the Code Executor
  70. 70SPIFFE for AI Agents: Workload Identity Without API Keys
  71. 71On-Behalf-Of Auth for AI Agents: Act as Each User
  72. 72AI Agent Production Checklist: What to Check Before Launch
  73. 73Approval Fatigue: Auto-Approve Safe AI Agent Actions
  74. 74What Is Human in the Loop AI? Approvals for AI Agents
  75. 75AI Agent Notifications: Webhook and Slack Alerts in Python
  76. 76AI Agent Observability: Trace Tool Calls, Tokens and Cost
  77. 77Best AI Agent Observability Tools (2026), Compared
  78. 78AI Agent Stuck in a Loop? How to Detect and Stop It
  79. 79How to Run, Debug and Deploy an AI Agent in Python
  80. 80AI Agent Cost Tracking: Tokens and Cost per Run and User
  81. 81How to Evaluate AI Agents: Evals, LLM Judges and pass^k
  82. 82AI Agent Cost Control: Budgets That Stop Runaway Spend
  83. 83How to Test LLM Prompts and AI Agents in Python
  84. 84AI Agent Evals in CI: Run Them on Every Pull Request
  85. 85What Is an Agentic Runtime? AI Agent Runtimes Explained
  86. 86Autonomous AI Agent Runtime: Budgets, Crash Recovery, API
  87. 87Event-Driven AI Agents: Webhook, Cron and File Triggers
  88. 88AI Agent Cron Jobs: Run an Agent on a Schedule
  89. 89AI Agent Webhook Trigger: Run an Agent on HTTP Events
  90. 90AI Agent File Watcher: Process New Files Automatically
  91. 91Custom AI Agent Triggers: Wake an Agent From Any Source
  92. 92AI Agent Event Filters: Skip Runs Before the LLM
  93. 93AI Agent Retries and a Dead Letter Queue for Failed Runs
  94. 94Run Multiple AI Agents: One Runtime, Many Processes
  95. 95AI Agent Manifest: Declare a Long-Running Agent in YAML
  96. 96AI Agent CLI: Start, Stop and Inspect Running Agents
  97. 97AI Agent Monitoring Dashboard in the Terminal
  98. 98Multi-Agent Event Bus: Chain Agents With Events
  99. 99Distributed AI Agents: Run Agents Across Many Machines
  100. 100Pause and Resume an AI Agent: Lifecycle States Explained

Lessons in this path

  1. ✓What Is an AI Agent? Definition, How It Works, Examples
  2. ✓How to Build an AI Agent in Python (2026 Guide)
  3. ✓Build a Personal AI Agent: Memory, Reminders, Chat
  4. ✓What Is an Agent Harness? Parts and How to Build One
  5. ✓System Prompt Best Practices for AI Agents in Python
  6. ✓Best LLM for AI Agents (2026): Picks, Prices, How to Test
  7. ✓AI Agent YAML: Define and Run an Agent From a Config File
  8. ✓Streaming LLM Responses with FastAPI: Tokens and Tool Calls
  9. ✓Best Local LLM for AI Agents: Ollama Models by GPU (2026)
  10. ✓Claude AI Agent with MCP: Use Anthropic Models in Promptise
  11. ✓Gemini AI Agent with MCP: Use Google Models in Promptise
  12. ✓Azure OpenAI Agent with MCP: Use Deployments in Promptise
  13. ✓OpenRouter AI Agent with MCP: Many Models in Promptise
  14. ✓Ollama AI Agent with MCP: Run Local Models in Promptise
  15. ✓LLM Semantic Cache and Model Fallback in Python
  16. ✓What Is MCP (Model Context Protocol)? A Developer's Guide
  17. ✓What Is Tool Calling? LLM Function Calling Explained
  18. ✓MCP Tools vs Resources vs Prompts (With Python Examples)
  19. ✓How to Connect MCP Servers to Your AI Agent in Python
  20. ✓Build a Production MCP Server in Python (Step by Step)
  21. ✓MCP Transports: stdio vs Streamable HTTP vs SSE (Python)
  22. ✓MCP 2026-07-28 Migration: Make Your MCP Server Stateless
  23. ✓OpenAPI to MCP: Turn Any REST API into an MCP Server
  24. ✓MCP Authentication in Python: API Keys, JWT and OAuth
  25. ✓Build an Authenticated MCP Server for Your AI Agent (Python)
  26. ✓MCP Security Best Practices: A Checklist for MCP Servers
  27. ✓Testing MCP Servers in Python: pytest Without a Live Server
  28. ✓Too Many MCP Tools? How to Fix LLM Tool Selection in Python
  29. ✓Idempotent Tool Calls: Make AI Agent Retries Safe
  30. ✓AI Agent Tool Failures: Stop Unsafe Workarounds
  31. ✓MCP Server Caching, Timeouts and Circuit Breakers in Python
  32. ✓MCP Middleware for Servers: Auth, Logging, Rate Limits
  33. ✓MCP vs CLI for AI Agents: Tokens, Security, When to Use Each
  34. ✓LangChain vs MCP: Differences and How They Work Together
  35. ✓FastMCP Alternatives for Production MCP Servers (2026)
  36. ✓AI Agent Audit Logging: Tamper-Evident Logs in Python
  37. ✓AI Agent Human in the Loop: Approve Tool Calls in Python
  38. ✓AI Agent Prompt Injection: How to Defend Against It
  39. ✓Hidden Text Prompt Injection: Sanitize Pages for AI Agents
  40. ✓Build a Multi-Agent System in Python (and When Not To)
  41. ✓Context Engineering for AI Agents: Context Window Management
  42. ✓Context Compaction for AI Agents: Trim vs Summarize
  43. ✓How to Deploy an AI Agent with Docker (2026 Guide)
  44. ✓LLM Tool Rate Limiting: Per-Client Limits for MCP Servers
  45. ✓MCP Long-Running Tasks: Background Jobs in Python
  46. ✓MCP Server Monitoring: Prometheus, OpenTelemetry and Logs
  47. 47Best AI Agent Frameworks (2026): Python Options Compared
  48. 48Self-Improving AI Agent: Learn From Tool Failures in Python
  49. 49AI Agent Identity: Authenticate Agents to MCP Servers
  50. 50Code-Action Agents in Python: One Program vs 37 Tool Calls
  51. 51Multi-Tenant AI Agents: Keep Each Customer's Data Apart
  52. 52What Is Agentic RAG? How It Differs from Classic RAG
  53. 53AI Agent Memory in Python: Short-Term and Long-Term
  54. 54Per-User Agent Memory Isolation: Stop Leaks Between Users
  55. 55Agentic RAG in Python: Give Your AI Agent a Search Tool
  56. 56AI Agent Reasoning Patterns in Python: From ReAct to Debate
  57. 57Plan-and-Execute Agents in Python: Beyond the ReAct Loop
  58. 58Self-Modifying AI Agent in Python: Open Mode & Limits
  59. 59CrewAI Alternatives: 7 Options and How to Migrate (2026)
  60. 60Migrate from AutoGen: Agent Framework, AG2 and More
  61. 61What Is an LLM Guardrail? Types, Examples and Limits
  62. 62Best LLM Guardrails Tools (2026): 9 Platforms Compared
  63. 63AI Agent Guardrails in Python: Block Injection, Redact PII
  64. 64NeMo Guardrails vs Guardrails AI: Which to Choose (2026)
  65. 65AI-Based PII Detection and Redaction Tools for LLM Apps
  66. 66Stop Secrets Leaking Into LLM Logs and Traces
  67. 67AI Agent Code Execution Sandbox: Run LLM Code Safely
  68. 68AI Agent Network Egress: Limit Where Agents Can Connect
  69. 69AutoGen Docker Task Isolation: Secure the Code Executor
  70. 70SPIFFE for AI Agents: Workload Identity Without API Keys
  71. 71On-Behalf-Of Auth for AI Agents: Act as Each User
  72. 72AI Agent Production Checklist: What to Check Before Launch
  73. 73Approval Fatigue: Auto-Approve Safe AI Agent Actions
  74. 74What Is Human in the Loop AI? Approvals for AI Agents
  75. 75AI Agent Notifications: Webhook and Slack Alerts in Python
  76. 76AI Agent Observability: Trace Tool Calls, Tokens and Cost
  77. 77Best AI Agent Observability Tools (2026), Compared
  78. 78AI Agent Stuck in a Loop? How to Detect and Stop It
  79. 79How to Run, Debug and Deploy an AI Agent in Python
  80. 80AI Agent Cost Tracking: Tokens and Cost per Run and User
  81. 81How to Evaluate AI Agents: Evals, LLM Judges and pass^k
  82. 82AI Agent Cost Control: Budgets That Stop Runaway Spend
  83. 83How to Test LLM Prompts and AI Agents in Python
  84. 84AI Agent Evals in CI: Run Them on Every Pull Request
  85. 85What Is an Agentic Runtime? AI Agent Runtimes Explained
  86. 86Autonomous AI Agent Runtime: Budgets, Crash Recovery, API
  87. 87Event-Driven AI Agents: Webhook, Cron and File Triggers
  88. 88AI Agent Cron Jobs: Run an Agent on a Schedule
  89. 89AI Agent Webhook Trigger: Run an Agent on HTTP Events
  90. 90AI Agent File Watcher: Process New Files Automatically
  91. 91Custom AI Agent Triggers: Wake an Agent From Any Source
  92. 92AI Agent Event Filters: Skip Runs Before the LLM
  93. 93AI Agent Retries and a Dead Letter Queue for Failed Runs
  94. 94Run Multiple AI Agents: One Runtime, Many Processes
  95. 95AI Agent Manifest: Declare a Long-Running Agent in YAML
  96. 96AI Agent CLI: Start, Stop and Inspect Running Agents
  97. 97AI Agent Monitoring Dashboard in the Terminal
  98. 98Multi-Agent Event Bus: Chain Agents With Events
  99. 99Distributed AI Agents: Run Agents Across Many Machines
  100. 100Pause and Resume an AI Agent: Lifecycle States Explained
← Path overview

The best AI agent framework in 2026 depends on what you are building: a durable production workflow, a team of agents, a typed app, a tool-heavy agent on MCP, or an agent inside a Microsoft or Google stack. This guide sorts the main Python options by use case, explains how to choose, and compares nine frameworks feature by feature. Every framework then runs the same small agent with an approval rule, with its real output.

[01]

What is the best AI agent framework in 2026?

There is no single best one. The top agentic AI frameworks of 2026 split by use case, and each kind of project has one to three that fit it well, so start from the row that matches your hardest requirement:

If you need

Strong fit

Also consider

Why

Production workflows that pause and resume

LangGraph

Pydantic AI

Checkpoints and interrupts that survive a restart

Multi-agent teams

CrewAI

Microsoft Agent Framework

Crews of role-based agents; MAF adds graph workflows

Typed, structured apps

Pydantic AI

OpenAI Agents SDK

Validated inputs and outputs, token and tool-call limits

MCP-heavy tools

OpenAI Agents SDK, Promptise Foundry

Pydantic AI

Built-in MCP clients with per-tool approval; Promptise also builds MCP servers

Beginners

OpenAI Agents SDK

smolagents

Few concepts to learn

Microsoft, Azure and .NET

Microsoft Agent Framework

Semantic Kernel (existing apps)

The successor to AutoGen and Semantic Kernel, for Python and .NET

Google Cloud and Gemini

Google ADK

LangGraph

Workflow agents, graph workflows and deployment to Google Cloud

Agents over your documents

LlamaIndex

Haystack

Retrieval and agents in one ecosystem

Agents that write code

smolagents

Promptise Foundry

CodeAgent writes Python as its action; Promptise has a code-action pattern

Promptise Foundry is made by the team behind this site. Every claim about the other tools was checked against their own docs and repositories on October 21, 2026. The Promptise rows are our judgment, and the sections below say where the others are stronger.

Key takeaways:

  • Pick by your hardest requirement, not the shortest demo. With the same model and tools, all nine frameworks here made the same decision. They differ in approvals, limits, durability and scope.

  • Durable approvals are the biggest split. LangGraph, Pydantic AI, the OpenAI Agents SDK and Microsoft Agent Framework return a paused run you can store, and CrewAI Flows can save a pending human review and resume it. CrewAI's tool hooks and Promptise decide inside the running process.

  • AutoGen is no longer maintained. Its README says the project is archived and points new users to Microsoft Agent Framework.

  • Serve tools over MCP to stay portable. Every framework here can call MCP tools, so a later switch doesn't touch them.


[02]

What is an AI agent framework, and do you need one?

A Python AI agent framework is a library that runs the agent loop for you. It sends the conversation and the tool definitions to a model, runs the tools the model asks for, feeds the results back, and stops when the model answers. What is an agent framework explains each part in depth.

The loop itself is about 20 lines of Python. A framework earns its place with what it builds around the loop:

Layer diagram of what an agent framework adds: your application on top, then orchestration, guard rails, state and tools around the agent loop, with models below it and tracing and deployment at the bottom.
FigureWhat an agent framework builds around the agent loop, layer by layer

You need a framework when the agent runs without a person watching, when its tools change data, when several agents work together, or when runs must pause and resume. You don't need one for a single model call or a script with one or two read-only tools. There, the provider's SDK and a short loop are easier to read and debug. How to build an AI agent in Python writes that loop by hand.


[03]

How do you choose an AI agent framework?

Score each candidate against the questions that cost the most to get wrong later.

  • Approvals. Can a person approve a risky tool call hours later, and does the pending request survive a restart?

  • Limits. Can you cap model calls, tokens or tool calls per run, and does the cap raise an error or quietly return an answer?

  • Durability. If the process crashes mid-run, can the run resume, or does it start over and repeat side effects?

  • Tools. Does it have a built-in MCP client, and can you build MCP servers with it?

  • Multi-agent model. Handoffs, crews, graphs or supervisor calls: which matches how your work splits?

  • Observability. Where do traces go by default, and can you export OpenTelemetry to your own backend?

  • Models and lock-in. Does it support your providers, and how much code is framework-specific?

  • Project health. Release pace, license, and whether it is still maintained.

Then build one small agent with your real tools in your top two candidates, as the nine versions below do.


[04]

AI agent framework comparison (2026)

Versions were checked on PyPI on 20 October 2026, Promptise on 24 October 2026. Each cell comes from the framework's documentation; defaults in brackets come from its source code.

Framework

Core idea

Multi-agent

MCP client

Approval and resume

Step limit (default)

Tracing default

License

LangGraph 1.2.16

Graph of nodes with shared state

Subgraphs, supervisor, handoffs

langchain.mcp (beta) or the archived langchain-mcp-adapters

Interrupt plus checkpointer; survives a restart with a database checkpointer

recursion_limit (very high); call-limit middleware

LangSmith, opt-in

MIT

Pydantic AI 2.58.0

Typed agent

Delegation, hand-off, graphs

Built in

Deferred tools; resume from stored message history

request_limit (50); token and tool-call limits

Logfire or OpenTelemetry, opt-in

MIT

OpenAI Agents SDK 0.24.0

Agents, handoffs, guardrails

Handoffs, agents as tools

Built in (stdio, HTTP, hosted)

RunState serializes to JSON

max_turns (10)

On, sent to OpenAI

MIT

CrewAI 1.15.28

Crews of role-based agents; Flows

Sequential or hierarchical crews

Built in (mcps=)

Tool-call hooks that block or ask a person, in process; Flows' @human_feedback saves a pending review and resumes

max_iter (25), then a forced answer

Anonymous telemetry on

MIT

Google ADK 2.12.0

LLM agents plus workflow agents and graphs

Sub-agents; sequential, parallel, loop

Built in (McpToolset)

Tool confirmation (experimental); before_tool_callback

max_llm_calls (500)

Logs, metrics, traces (configure)

Apache-2.0

Microsoft Agent Framework 1.22.0

Agents plus graph workflows

Sequential, concurrent, handoff, group chat, Magentic

Built in (MCPStdioTool, HTTP)

Approval request; resume with the same session, which serializes

max_iterations (40)

OpenTelemetry built in, no exporter by default

MIT

LlamaIndex 0.14.25

Event-driven workflows

AgentWorkflow handoffs

llama-index-tools-mcp

Wait for a human event; Context serializes

max_iterations (20)

Instrumentation, opt-in

MIT

smolagents 1.26.0

Agents that write Python

Managed agents

MCPClient (needs mcp<2)

None built in

max_steps (20)

OpenTelemetry, opt-in

Apache-2.0

Promptise Foundry 1.10.0

MCP-first agent

Cross-agent calls, supervisor

Built in, plus an MCP server framework

ApprovalPolicy handler in process; lost on restart

max_agent_iterations (25); budgets

Opt-in, HTML report or OTLP

Apache-2.0

Watch the limit column: CrewAI's max_iter returns whatever the model said last instead of raising, and LangChain's create_agent, which runs on LangGraph, sets a very high recursion_limit, so add ModelCallLimitMiddleware for a real cap.


[05]

What you need to run the examples

  • Python 3.11 or later (Pydantic AI and Google ADK require it) and an OpenAI API key in OPENAI_API_KEY. Every example uses gpt-5-mini.

  • One virtual environment per framework, because their MCP dependencies conflict: smolagents 1.26, CrewAI 1.15 and Microsoft Agent Framework 1.22 need mcp<2, while LangChain's MCPAdapter, Pydantic AI, the OpenAI Agents SDK and llama-index-tools-mcp 0.6 install mcp 2.x. Promptise 1.10 works with either.

  • Promptise in the environment that runs the shared MCP server, because each example starts it with python orders_server.py.

>_Terminal
pip install "promptise==1.10.0"                                         # the server and the Promptise agent
pip install "langchain[mcp]==1.4.6" "langgraph==1.2.16" langchain-openai # LangGraph
pip install "pydantic-ai-slim[openai,mcp]==2.58.0"                       # Pydantic AI
pip install "openai-agents==0.24.0"                                      # OpenAI Agents SDK
pip install "crewai[mcp]==1.15.28"                                       # CrewAI
pip install "google-adk[mcp]==2.12.0" litellm                            # Google ADK, OpenAI via LiteLLM
pip install "agent-framework-core==1.22.0" "agent-framework-openai==1.17.0"  # Microsoft Agent Framework
pip install "llama-index-core==0.14.25" llama-index-llms-openai "llama-index-tools-mcp==0.6.0"  # LlamaIndex
pip install "smolagents[mcp,openai]==1.26.0" "mcp<2"                     # smolagents

The agent answers order questions and can refund an order. The rule is the same everywhere: refunds up to $100 are approved, larger ones are refused before the tool runs, and a run makes at most six model calls. Both tools live on one MCP server:

Pythonorders_server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""The MCP server every version connects to: two tools over stdio."""
from promptise.mcp.server import MCPServer

ORDERS = {
    "O-1001": {"order_id": "O-1001", "item": "Desk lamp", "amount": 49.00, "status": "delivered"},
    "O-1002": {"order_id": "O-1002", "item": "Office chair", "amount": 219.00, "status": "delivered"},
}
server = MCPServer(name="orders")


@server.tool(read_only_hint=True)
async def get_order(order_id: str) -> dict:
    """Look up an order by ID: item, amount in USD and status."""
    return ORDERS.get(order_id.strip().upper(), {"error": f"No order {order_id}"})


@server.tool(destructive_hint=True)
async def refund_order(order_id: str, amount: float) -> dict:
    """Refund an order. Moves money, so it needs approval."""
    return {"refunded": True, "order_id": order_id, "amount": amount}


if __name__ == "__main__":
    server.run()

Each version asks the same question: "Order O-1002 arrived broken. Please refund it in full." The order costs $219, so the refund must be refused.


[06]

The best Python agent frameworks, one by one

Each profile says where the framework is strongest and weaker, then runs the same agent.

LangGraph: best for durable production workflows

LangGraph 1.2 is LangChain's low-level runtime: you define state, nodes and edges, and compile the graph with a checkpointer. LangChain 1.x's create_agent builds on it. It is the strongest choice when a run must pause for a person and resume after a restart, or when you need branches and parallel steps you control. The cost is more wiring for simple agents. Tracing goes to LangSmith only if you turn it on.

Pythonagent_langgraph.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import asyncio
import uuid

from fastmcp.client.transports import StdioTransport
from langchain.agents import create_agent
from langchain.agents.middleware import HumanInTheLoopMiddleware, ModelCallLimitMiddleware
from langchain.mcp import MCPAdapter  # beta in langchain 1.4
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.types import Command

PROMPT = "You are an order-support agent. Use the tools. If a refund is refused, say why. Answer in one sentence."
QUESTION = "Order O-1002 arrived broken. Please refund it in full."


async def main():
    async with MCPAdapter(StdioTransport(command="python", args=["orders_server.py"])) as orders:
        agent = create_agent(
            model="openai:gpt-5-mini",
            tools=await orders.list_tools(),
            system_prompt=PROMPT,
            middleware=[
                HumanInTheLoopMiddleware(interrupt_on={"refund_order": {"allowed_decisions": ["approve", "reject"]}}),
                ModelCallLimitMiddleware(run_limit=6, exit_behavior="error"),
            ],
            checkpointer=InMemorySaver(),  # an interrupt needs a checkpointer
        )
        config = {"configurable": {"thread_id": str(uuid.uuid4())}}
        result = await agent.ainvoke({"messages": [{"role": "user", "content": QUESTION}]}, config, version="v2")
        while result.interrupts:  # the run paused for approval
            decisions = []
            for interrupt in result.interrupts:
                for action in interrupt.value["action_requests"]:
                    if action["args"]["amount"] <= 100:
                        decisions.append({"type": "approve"})
                    else:
                        decisions.append({"type": "reject", "message": "Refunds over $100 need a manager."})
            result = await agent.ainvoke(Command(resume={"decisions": decisions}), config, version="v2")
        print(result.value["messages"][-1].content)


asyncio.run(main())
Output
I can't issue the full $219.00 refund for Order O-1002 because refunds over $100 require manager approval.

Approval and the call limit are middleware. The run stops with interrupts, and a Command with your decisions resumes it. That needs a checkpointer even for one run; with a database checkpointer the paused run survives a restart.

Pydantic AI: best for typed, structured apps

Pydantic AI 2.58 treats an agent as a typed function: validated dependencies in, validated output out. Version 2.0 shipped in June 2026. It limits requests, tokens and tool calls per run, which few frameworks do, and integrates with Temporal, DBOS and Prefect, among others, for durable runs. Pick it if your team likes Pydantic and wants type errors before runtime.

Pythonagent_pydantic_ai.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import asyncio

from fastmcp.client.transports import StdioTransport
from pydantic_ai import Agent, DeferredToolRequests, DeferredToolResults, ToolDenied
from pydantic_ai.mcp import MCPToolset
from pydantic_ai.usage import UsageLimits

PROMPT = "You are an order-support agent. Use the tools. If a refund is refused, say why. Answer in one sentence."
QUESTION = "Order O-1002 arrived broken. Please refund it in full."

orders = MCPToolset(StdioTransport(command="python", args=["orders_server.py"]))
agent = Agent(
    "openai:gpt-5-mini",
    instructions=PROMPT,
    toolsets=[orders.approval_required(lambda ctx, tool, args: tool.name == "refund_order")],
    output_type=[str, DeferredToolRequests],
)
LIMITS = UsageLimits(request_limit=6)  # at most 6 model requests


async def main():
    async with agent:
        result = await agent.run(QUESTION, usage_limits=LIMITS)
        while isinstance(result.output, DeferredToolRequests):  # the run paused for approval
            approvals = {}
            for call in result.output.approvals:
                ok = call.args_as_dict()["amount"] <= 100
                approvals[call.tool_call_id] = True if ok else ToolDenied("Refunds over $100 need a manager.")
            result = await agent.run(
                message_history=result.all_messages(),
                deferred_tool_results=DeferredToolResults(approvals=approvals),
                usage_limits=LIMITS, usage=result.usage,
            )
        print(result.output)


asyncio.run(main())
Output
I couldn't issue a full refund for order O-1002 ($219) because refunds over $100 require manager approval.

The toolset is marked approval_required. The run ends with DeferredToolRequests, and a new run continues from the message history with your decisions. usage=result.usage keeps the limit counting across the pause. Use an explicit StdioTransport: a bare script path starts the server with the agent's own interpreter.

OpenAI Agents SDK: best for beginners and OpenAI-first teams

The OpenAI Agents SDK 0.24 has few concepts: agents, tools, handoffs, guardrails and sessions. MCP servers are built in, including OpenAI's hosted MCP tool. It works with other providers through any OpenAI-compatible endpoint or an adapter, but it is designed around OpenAI, and it is still 0.x, so minor versions can change the API. Tracing is on by default and goes to OpenAI.

Pythonagent_openai_agents.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import asyncio
import json

from agents import Agent, Runner
from agents.mcp import MCPServerStdio

PROMPT = "You are an order-support agent. Use the tools. If a refund is refused, say why. Answer in one sentence."
QUESTION = "Order O-1002 arrived broken. Please refund it in full."


async def main():
    async with MCPServerStdio(
        params={"command": "python", "args": ["orders_server.py"]},
        require_approval={"always": {"tool_names": ["refund_order"]}},
    ) as orders:
        agent = Agent(name="support", instructions=PROMPT, model="gpt-5-mini", mcp_servers=[orders])
        result = await Runner.run(agent, QUESTION, max_turns=6)
        while result.interruptions:  # the run paused for approval
            state = result.to_state()
            for item in result.interruptions:
                if json.loads(item.arguments)["amount"] <= 100:
                    state.approve(item)
                else:
                    state.reject(item, rejection_message="Refunds over $100 need a manager.")
            result = await Runner.run(agent, state, max_turns=6)
        print(result.final_output)


asyncio.run(main())
Output
Refund for O-1002 was refused because refunds over $100 require manager approval.

Approval is declared on the MCP server connection. The run returns interruptions, you approve or reject each one on a RunState, and run again. RunState serializes to JSON, so a paused run can wait in a database you trust. Set OPENAI_AGENTS_DISABLE_TRACING=1 if traces must stay in your systems.

CrewAI: best for multi-agent teams

CrewAI 1.15 describes agents by role, goal and backstory and groups them into crews that work through tasks, in sequence or under a manager agent. Flows add event-driven steps with persisted state. It is the most direct way to express "a researcher and a writer working together". It is weaker as a single strict agent: approval is a hook you write rather than a per-tool setting, and max_iter forces a final answer instead of raising. It sends anonymous telemetry unless you set CREWAI_DISABLE_TELEMETRY=true.

Pythonagent_crewai.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from crewai import LLM, Agent, Crew, Task
from crewai.hooks import before_tool_call
from crewai.mcp import MCPServerStdio

PROMPT = "You are an order-support agent. Use the tools. If a refund is refused, say why. Answer in one sentence."
QUESTION = "Order O-1002 arrived broken. Please refund it in full."


@before_tool_call
def review(context):
    # MCP tool names get a prefix, so match the end of the name.
    if context.tool.name.endswith("refund_order") and context.tool_input["amount"] > 100:
        return False  # blocks the call
    return None


agent = Agent(
    role="Order support agent",
    goal="Answer order questions and process refunds correctly",
    backstory=PROMPT,
    llm=LLM(model="gpt-5-mini"),
    mcps=[MCPServerStdio(command="python", args=["orders_server.py"])],
    max_iter=5,  # CrewAI makes one more call after max_iter to force an answer
)
task = Task(description=QUESTION, expected_output="A one-sentence answer.", agent=agent)
print(Crew(agents=[agent], tasks=[task]).kickoff().raw)
Output
I couldn't refund the full $219.00 for order O-1002 because the refund tool was blocked by a security hook—refunds require additional approval, so please contact finance or provide authorization to proceed.

The global before_tool_call hook returns False to block the call. MCP tools from mcps= get a server prefix, so the hook matches the end of the name; a hook that compares the exact name never fires. A call blocked with False carries no reason, so the model guesses at one. CrewAI's newer execution hooks can filter by tool name, ask a person with ctx.request_human_input() and raise HookAborted with a reason.

Google ADK: best for Gemini and Google Cloud

Google ADK 2.12 combines LLM agents with workflow agents that run sub-agents in sequence, in parallel or in a loop, and 2.0 (May 2026) added graph workflows. It runs in Python, TypeScript, Go, Java and Kotlin, has a dev UI, and deploys to Google Cloud. Other models work through LiteLLM, as here. Tool confirmation, ADK's pause-for-a-person feature, is marked experimental and doesn't work with the database or Vertex AI session services yet, so this version uses a callback.

Pythonagent_google_adk.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import asyncio

from google.adk.agents import LlmAgent
from google.adk.agents.run_config import RunConfig
from google.adk.models.lite_llm import LiteLlm
from google.adk.runners import InMemoryRunner
from google.adk.tools.mcp_tool import McpToolset, StdioConnectionParams
from google.genai import types
from mcp import StdioServerParameters

PROMPT = "You are an order-support agent. Use the tools. If a refund is refused, say why. Answer in one sentence."
QUESTION = "Order O-1002 arrived broken. Please refund it in full."


def review(tool, args, tool_context):
    # Returning a dict skips the tool and hands the dict to the model as the result.
    if tool.name == "refund_order" and args["amount"] > 100:
        return {"error": "Refund not approved: refunds over $100 need a manager."}
    return None


orders = McpToolset(connection_params=StdioConnectionParams(
    server_params=StdioServerParameters(command="python", args=["orders_server.py"])))
agent = LlmAgent(name="support", model=LiteLlm(model="openai/gpt-5-mini"), instruction=PROMPT,
                 tools=[orders], before_tool_callback=review)


async def main():
    runner = InMemoryRunner(agent=agent, app_name="orders")
    session = await runner.session_service.create_session(app_name="orders", user_id="u1")
    message = types.Content(role="user", parts=[types.Part(text=QUESTION)])
    async for event in runner.run_async(user_id="u1", session_id=session.id, new_message=message,
                                        run_config=RunConfig(max_llm_calls=6)):
        if event.is_final_response() and event.content and event.content.parts:
            print(event.content.parts[0].text)
    await orders.close()


asyncio.run(main())
Output
I attempted a full $219 refund for order O-1002 but it was refused because refunds over $100 require manager approval.

before_tool_callback runs before every tool. Returning a dict skips the tool and hands the dict to the model as its result. RunConfig(max_llm_calls=6) sets the cap; the default is 500. Expect "experimental feature" warnings on stderr in 2.12.

Microsoft Agent Framework: best for Microsoft, Azure and .NET teams

Microsoft Agent Framework 1.22 is the successor to AutoGen and Semantic Kernel, built by the same teams; 1.0 shipped in April 2026. It pairs agents with graph workflows (sequential, concurrent, handoff, group chat and Magentic orchestration), has middleware, MCP tools and OpenTelemetry built in, and runs in Python and .NET, with Go in preview. It releases often: from 1.0 to 1.22 in about six months.

Pythonagent_microsoft.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import asyncio
import json

from agent_framework import Agent, MCPStdioTool, Message
from agent_framework.openai import OpenAIChatCompletionClient

PROMPT = "You are an order-support agent. Use the tools. If a refund is refused, say why. Answer in one sentence."
QUESTION = "Order O-1002 arrived broken. Please refund it in full."


async def main():
    client = OpenAIChatCompletionClient(model="gpt-5-mini")
    client.function_invocation_configuration["max_iterations"] = 6  # at most 6 model round trips
    orders = MCPStdioTool(name="orders", command="python", args=["orders_server.py"],
                          approval_mode={"always_require_approval": ["refund_order"]})
    async with Agent(client=client, name="support", instructions=PROMPT, tools=orders) as agent:
        session = agent.create_session()  # resuming an approval needs the same session
        result = await agent.run(QUESTION, session=session)
        while result.user_input_requests:  # the run paused for approval
            replies = []
            for request in result.user_input_requests:
                args = request.function_call.arguments
                args = json.loads(args) if isinstance(args, str) else args
                replies.append(Message("user", [request.to_function_approval_response(args["amount"] <= 100)]))
            result = await agent.run(replies, session=session)
        print(result.text)


asyncio.run(main())
Output
I couldn't issue the full $219.00 refund for order O-1002 because the refund tool call was rejected by the system, indicating the refund requires additional approval or permission.

approval_mode on the MCP tool turns a refund_order call into an approval request. You answer with to_function_approval_response() and resume with the same AgentSession; an approval that doesn't match a request recorded in that session is ignored. The response carries no reason, which shows in the vaguer answer.

LlamaIndex: best for agents over your documents

LlamaIndex 0.14 started as a data framework, and its agents run as event-driven workflows next to its indexing and retrieval tools. AgentWorkflow hands work between agents, and MCP tools come from llama-index-tools-mcp. Its README says the company's focus has shifted to LlamaParse while the open-source framework stays available.

Pythonagent_llamaindex.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import asyncio

from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

PROMPT = "You are an order-support agent. Use the tools. If a refund is refused, say why. Answer in one sentence."
QUESTION = "Order O-1002 arrived broken. Please refund it in full."

client = BasicMCPClient("python", args=["orders_server.py"])


async def refund_order(order_id: str, amount: float) -> str:
    """Refund an order. Moves money, so it needs approval."""
    # No approval setting for a tool: check in a wrapper, then call the MCP tool.
    if amount > 100:
        return "Refund not approved: refunds over $100 need a manager."
    return str(await client.call_tool("refund_order", {"order_id": order_id, "amount": amount}))


async def main():
    tools = await McpToolSpec(client=client, allowed_tools=["get_order"]).to_tool_list_async()
    agent = FunctionAgent(tools=[*tools, refund_order], llm=OpenAI(model="gpt-5-mini"),
                          system_prompt=PROMPT)
    print(await agent.run(QUESTION, max_iterations=6))


asyncio.run(main())
Output
Refund for order O-1002 cannot be processed because refunds over $100 require manager approval.

allowed_tools leaves refund_order out, and a plain function with the check replaces it. For a human decision, LlamaIndex's documented pattern is a tool that waits for a HumanResponseEvent, with a serializable Context while it waits.

smolagents: best for agents that write code

smolagents 1.26, from Hugging Face, is a small library whose main agent, CodeAgent, writes Python code as its action instead of JSON tool calls. Its docs recommend running that code in a sandbox such as E2B or Docker. It has no approval setting, its MCP client needs mcp<2 (which it doesn't pin, so pin it yourself), and its latest release is from May 2026.

Pythonagent_smolagents.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from mcp import StdioServerParameters
from smolagents import MCPClient, OpenAIModel, Tool, ToolCallingAgent

PROMPT = "You are an order-support agent. Use the tools. If a refund is refused, say why. Answer in one sentence."
QUESTION = "Order O-1002 arrived broken. Please refund it in full."


class ReviewedRefund(Tool):
    """smolagents has no approval setting, so wrap the tool and check first."""
    skip_forward_signature_validation = True

    def __init__(self, inner):
        self.name, self.description = inner.name, inner.description
        self.inputs, self.output_type, self.inner = inner.inputs, inner.output_type, inner
        super().__init__()

    def forward(self, **kwargs):
        if kwargs["amount"] > 100:
            return "Refund not approved: refunds over $100 need a manager."
        return self.inner(**kwargs)


params = StdioServerParameters(command="python", args=["orders_server.py"])
with MCPClient(params, structured_output=False) as tools:
    tools = [ReviewedRefund(t) if t.name == "refund_order" else t for t in tools]
    agent = ToolCallingAgent(tools=tools, model=OpenAIModel(model_id="gpt-5-mini"),
                             instructions=PROMPT, max_steps=6, verbosity_level=0)
    print(agent.run(QUESTION))
Output
I can't process the full $219 refund for order O-1002 because refunds over $100 require manager approval; I'll escalate this to a manager for approval.

ToolCallingAgent makes JSON tool calls like the others, and a wrapper class checks the amount before the MCP tool runs. The answer promises an escalation that no tool performs. That is the model, not the framework: give the agent a real escalation tool or say in the prompt that it can't.


[07]

Where does Promptise Foundry fit?

Promptise Foundry 1.10.0, which we make, builds an agent from MCP servers with one call, build_agent(), and puts the production parts next to it: approvals, budgets, guardrails, sandboxed code execution, observability, an MCP server framework (the orders_server.py above is one), and promptise run for deployment. It runs on LangChain's packages and accepts LangChain models and tools.

Pythonagent_promptise.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import asyncio

from promptise import build_agent
from promptise.approval import ApprovalDecision, ApprovalPolicy
from promptise.config import StdioServerSpec

PROMPT = "You are an order-support agent. Use the tools. If a refund is refused, say why. Answer in one sentence."
QUESTION = "Order O-1002 arrived broken. Please refund it in full."


async def review(request):  # the approval rule: refunds up to $100
    ok = request.arguments["amount"] <= 100
    return ApprovalDecision(approved=ok, reason=None if ok else "Refunds over $100 need a manager.")


async def main():
    agent = await build_agent(
        model="openai:gpt-5-mini",
        servers={"orders": StdioServerSpec(command="python", args=["orders_server.py"])},
        instructions=PROMPT,
        approval=ApprovalPolicy(tools=["refund_order"], handler=review),
        max_agent_iterations=6,  # at most 6 model calls
    )
    try:
        result = await agent.ainvoke({"messages": [{"role": "user", "content": QUESTION}]})
        print(result["messages"][-1].content)
    finally:
        await agent.shutdown()


asyncio.run(main())
Output
I attempted to refund order O-1002 for $219, but it was denied because refunds over $100 require manager approval.

The approval rule is a policy on the agent. The handler runs when the model calls refund_order, and a refusal reaches the model with its reason. There is no resume loop to write, which also means the run waits in the process while the handler decides.

Choose it when you build the tools as well as the agent, or want approvals, budgets and guardrails as settings. Choose another framework when:

  • A person approves tomorrow. A pending Promptise approval doesn't survive a restart. LangGraph, Pydantic AI, the OpenAI Agents SDK and Microsoft Agent Framework store the paused run, and so do CrewAI Flows.

  • You need typed output from the agent. build_agent() has no built-in typed output. Pydantic AI does this best.

  • You want role-based teams. CrewAI's crews are a closer model.

  • You want a large community or a language other than Python. Promptise is a young project with a small community, and it is Python only. LangGraph, CrewAI and the OpenAI Agents SDK have far more users, examples and answers, and Google ADK and Microsoft Agent Framework also run outside Python.


[08]

What are the best multi-agent frameworks?

The useful question is which coordination model fits your work:

Coordination model

Frameworks

Fits when

Role-based crew

CrewAI

Work splits into roles that hand results to each other

Graph or workflow

LangGraph, Microsoft Agent Framework, Google ADK

The order of steps is known and must be enforced

Handoffs

OpenAI Agents SDK, LlamaIndex AgentWorkflow

One agent passes the conversation to a specialist

Supervisor calls other agents as tools

OpenAI Agents SDK, Pydantic AI, ADK, Promptise

A coordinator delegates and combines answers

Managed sub-agents

smolagents

A code-writing agent delegates subtasks

Add a second agent only when one prompt and tool set can't do the job. Multi-agent systems in Python covers the patterns.


[09]

Other agent frameworks you will see in 2026 lists

These appear in many top-ranking lists and are real options, without a runnable section here:

  • Claude Agent SDK (0.2.170) packages Claude Code as a library, with subagents and MCP. Pick it for Claude agents that work with files and shells.

  • Agno (3.1.8), formerly Phidata, offers agents, teams and workflows plus AgentOS, a runtime for serving them.

  • Strands Agents (1.61.1), from AWS, is a model-driven SDK with agents as tools, swarms and graphs, and MCP built in. Pick it on AWS and Bedrock.

  • Haystack (3.4.0), by deepset, builds search-heavy pipelines with an Agent component.

  • DSPy (3.4.1) optimizes prompts against a metric. Use it with an agent framework, not instead of one.

  • Mastra and the Vercel AI SDK are TypeScript frameworks; this guide covers Python only.

What happened to AutoGen, Semantic Kernel and AG2?

AutoGen's README now says the project is archived and no longer maintained, and points new users to Microsoft Agent Framework. Its last release, autogen-agentchat 0.7.5, is from September 2025. Semantic Kernel still ships releases, but its README calls Microsoft Agent Framework its successor. AG2, the community fork of AutoGen, released 1.0 in July 2026 with a new API that is not a drop-in upgrade. Migrate from AutoGen shows how to port an AutoGen team.

If you are leaving LangChain rather than choosing from scratch, LangChain alternatives covers that move, including tools, prompts and memory.


[10]

Running it in production

Whichever framework you pick, check these before the first unattended run:

  • The limit raises. Give the agent a task that needs more steps than the limit and confirm your code sees an error, not a normal answer.

  • The approval can't be skipped. Test a call that must be refused and check that the tool never ran. Name matching is the usual failure.

  • Refusals carry a reason the model can pass on, not a bare "rejected".

  • Traces go where you expect. Turn default exporters off or point them at your backend. AI agent observability lists what to record.

  • Dependencies are pinned, framework and mcp together, with evals after every upgrade.


[11]

Common problems and fixes

Symptom

Cause

Fix

uv pip install agent-framework fails on a pre-release dependency

The meta-package pulls subpackages that only exist as betas

Install agent-framework-core and the provider package you need, or pass --prerelease=allow

ImportError: cannot import name 'streamablehttp_client' in smolagents

smolagents 1.26's MCP client needs mcp<2 but doesn't pin it

Install "mcp<2" in its own environment

ImportError: cannot import name 'RequestContext' from 'mcp.shared.context' when importing langchain_mcp_adapters

An adapter version older than 0.3.2 next to mcp 2.x

Use langchain.mcp.MCPAdapter, or pin mcp<2 for the adapters package

CrewAI runs a refund the hook should block

MCP tool names get a server prefix

Match context.tool.name.endswith("refund_order")

Google ADK has no MCP toolset

mcp is an optional extra in ADK 2.x

>_Terminal
pip install "google-adk[mcp]"

A Microsoft Agent Framework approval is ignored

The approval was sent without the session that recorded the request

Pass the same AgentSession to every run()

Traces appear in an OpenAI dashboard you didn't expect

The Agents SDK exports traces by default

OPENAI_AGENTS_DISABLE_TRACING=1

The agent says it "escalated" something

The model invents an action no tool performs

Add a real escalation tool, or say in the prompt what the agent can't do


[12]

Limitations

  • This is a feature comparison, not a benchmark. It doesn't rank accuracy, speed or cost. With the same model and tools, answers depend mostly on the model.

  • The ecosystem moves fast. Most frameworks here shipped a release in the week before this guide.

  • We make Promptise. Every claim about other frameworks comes from their own documentation or source, and the profiles say where they are stronger.


[13]

Frequently asked questions

What is the best AI agent framework in 2026?

There is no single best one; it depends on the project. For production workflows that pause and resume, LangGraph. For multi-agent teams, CrewAI. For typed apps, Pydantic AI. For beginners and OpenAI-first projects, the OpenAI Agents SDK. For Azure and .NET, Microsoft Agent Framework. For Gemini and Google Cloud, Google ADK. For MCP-heavy tools, the OpenAI Agents SDK or Promptise Foundry, which also builds MCP servers.

What is the best Python agent framework for beginners?

The OpenAI Agents SDK has the fewest concepts and short examples, and it runs other providers through OpenAI-compatible endpoints or adapters. smolagents is also small and readable. Both let you learn the agent loop before you need graphs or crews.

What are the best multi-agent frameworks in 2026?

CrewAI for role-based teams, LangGraph and Microsoft Agent Framework for graph workflows with explicit control, the OpenAI Agents SDK for handoffs between specialists, and Google ADK for sequential, parallel and loop workflow agents. Promptise and Pydantic AI support a supervisor agent that calls other agents as tools.

Is AutoGen still maintained?

No. AutoGen's GitHub README says the project is archived and no longer maintained, and it points new users to Microsoft Agent Framework, its successor from the same teams. AG2, a community fork, continues separately with a new API since its 1.0 release in July 2026.

Which AI agent frameworks support MCP?

All nine in this guide can use MCP servers. Pydantic AI, the OpenAI Agents SDK, CrewAI, Google ADK, Microsoft Agent Framework, smolagents and Promptise have a client built in. LangChain's client is in beta in langchain.mcp, and LlamaIndex uses llama-index-tools-mcp. Promptise also includes a framework for building MCP servers.

How does Promptise Foundry compare to LangGraph and CrewAI?

Promptise builds an agent from MCP servers with one call and adds approvals, budgets, guardrails and an MCP server framework. LangGraph gives finer control and approvals that survive a restart, which Promptise doesn't. CrewAI's crews are a better model for teams of agents, and both have much larger communities than Promptise, which is young and Python only. Promptise fits teams that build their own tools.

Can I switch agent frameworks later?

Yes, if you serve tools over MCP and keep prompts and approval rules outside framework classes. A switch then means rewriting the agent setup and the approval resume logic. State stored by one framework, such as LangGraph checkpoints, doesn't move to another.


[14]

Next steps

  • Leaving LangChain instead: LangChain alternatives.

  • Build the tools once for every framework: build a production MCP server in Python.

  • Compare graph frameworks: LangGraph alternatives and CrewAI alternatives.

  • Reference: the Promptise docs for building agents and approval.

← PreviousMCP Server Monitoring: Prometheus, OpenTelemetry and LogsNext lesson →Self-Improving AI Agent: Learn From Tool Failures in Python