Choose an AI agent framework when you need to control an application’s execution in code: what state it saves, which tools it can call, when it stops for approval, and how it recovers. LangGraph emphasizes explicit state and routing; CrewAI organizes work around agents, tasks, and Flows; Pydantic AI makes typed Python inputs and outputs central; Microsoft Agent Framework brings agent and workflow building blocks to Python and .NET. The useful comparison is how each fits your application, not which produces the most impressive demo.

This guide compares the four on one customer inquiry workflow. It is a documentation-based design comparison, not a performance benchmark or a report of hands-on testing.

  • Begin with a read-only inquiry flow and test missing evidence, malformed proposals, rejected approval, and a restart while waiting for review.
  • Keep approval tied to the exact proposed action and protect writes against duplicates; a checkpoint alone does not prevent a repeated payment.
  • Choose storage, recovery, and data destinations explicitly. A typed response does not make execution durable, and running a framework locally does not keep a cloud model local.

When code becomes worth the maintenance

Start with the job you already have. If it is “receive a form, retrieve an order, draft a reply, and notify a teammate,” a visual workflow may be sufficient. Our n8n vs Dify comparison covers that starting point.

Consider a framework when the difficult part is custom application behavior: preserving an exact case state across interruptions, applying the same authorization rules throughout an existing backend, validating a domain-specific result, or reviewing changes through your normal code and test process. A framework also makes you responsible for deployment, storage, monitoring, and upgrades. Adding several agents does not remove that responsibility.

Keep the layers separate. A role instruction describes how an agent should behave. A skill can package instructions, resources, and executable helpers for a compatible host. A framework supplies runtime building blocks for an application. Naming an agent “refund manager” does not itself create a database connection, approval gate, or refund permission. If your existing tool only needs clearer instructions, see how to choose one Agency Agents role and give it a specific deliverable.

One inquiry, the same boundaries

Illustrative scenario: a customer asks, “My delivery is late. Can you refund the shipping charge?” No real customer data or execution results are used here.

  1. Read the inquiry and retrieve the order and shipping policy through narrowly scoped lookup tools.
  2. Produce a structured proposal containing the case ID, relevant policy reference, proposed action, and reply draft.
  3. If evidence is missing or conflicting, route the case to a person.
  4. Save the proposal and wait for approval before any refund or outgoing message.
  5. After approval, execute the authorized action once and record the result.

The first pilot can stop after step three. It can suggest a response while a person handles all writes. This still exercises retrieval, output validation, and escalation without granting refund or sending permissions.

Swipe or scroll horizontally to view all columns.

Where to start for this inquiry workflow — editorial fit, not a ranking
Framework Useful starting point Main design question
LangGraph Explicit case state and branching Which state transitions must your code control?
CrewAI Distinct research and drafting responsibilities Do separate agents add useful specialization?
Pydantic AI A typed Python proposal returned to an application Which fields and business rules must be validated?
Microsoft Agent Framework An existing Python or .NET service Which client, session, and workflow components fit that service?

LangGraph: make the case state and routes explicit

LangGraph represents a workflow using shared state, nodes, and edges. For this case, nodes could retrieve the order, assess the policy, draft a proposal, and request approval. Some nodes can be ordinary application code; others can call a model. LangGraph does not require LangChain, although its examples often use LangChain for model and tool integrations. See the official LangGraph overview.

That separation is useful when the route matters as much as the generated text. Define the case state explicitly, then put schema validation on the model’s proposal. A typed state container alone does not establish that the model’s refund reasoning is correct.

For approval, an interrupt pauses execution using a checkpointer that saves workflow state and a thread ID that identifies the case. Use persistent storage for a wait that must survive a restart. Resuming re-enters the interrupted node, so earlier side effects can repeat; even writes after approval need duplicate protection if a later failure causes a retry. The interrupt documentation explains both requirements. Choose this approach when you want to inspect and control those transitions yourself.

CrewAI: separate responsibilities, then control the flow

For the same inquiry, a CrewAI design could give one agent a policy-research task and another a reply-drafting task. Tasks can expose tools and request Pydantic or JSON outputs. Check the actual returned result: the current documentation says that a failed conversion can leave only raw text, with the structured fields empty. Treat that as a validation failure, not permission to continue. See CrewAI Tasks.

Put the case lifecycle around those tasks in a Flow: gather evidence, generate a proposal, request review, and branch on the decision. CrewAI’s human-feedback decorator supports pausing and routing from feedback; its nonblocking approach persists pending state and supports resumption. SQLite is the default persistence backend for that mechanism. The human-feedback guide describes the host-side handling you must supply. In routing mode, an LLM can map free-form feedback to outcomes. For a refund, require an explicit approval decision in the application before enabling the write; a classified feedback label is not a substitute.

This fits a workflow with distinct responsibilities. If the policy lookup is a deterministic query and drafting needs one model call, start there. Extra agent conversations create more work to inspect and potentially more model usage; their role names are not evidence of better decisions.

Pydantic AI: make the proposal an application contract

Pydantic AI is a natural candidate when your Python application needs a dependable result shape. Define a proposal model, pass order-service dependencies, and expose lookup functions as tools. Its validation checks structured outputs and tool arguments against their declared types. That helps distinguish a missing case ID from a usable proposal; it cannot prove a policy interpretation true. The Pydantic AI overview demonstrates these building blocks and human-approval support.

For our case, keep the refund tool behind an approval boundary and retain the pending request and conversation data needed to continue. Decide separately how execution survives failures. Current documentation distinguishes step storage through Pydantic AI Harness from durable engines such as Temporal or DBOS that journal and recover work in flight. These are different operational choices, described in the durable-execution guide.

Choose it when a validated Python result is a clear boundary between the model and your existing software. Select the storage and recovery mechanism deliberately instead of assuming a typed response makes a run durable.

Microsoft Agent Framework: fit agents into Python and .NET

Microsoft Agent Framework is the specific SDK compared here. For the inquiry handler, combine order-lookup functions, an agent, and workflow steps around the approval decision. Its structured-output support can return typed results, but support depends on the agent and model client. Check that combination against the structured-output documentation.

Function tools can require approval before execution. The application must collect the decision and return the corresponding response using the appropriate session. That makes the host’s approval handling part of your application design; see function-tool approvals.

Workflow checkpointing is configured separately. In-memory storage is suitable for a demonstration, while a persistent backend is needed across process restarts. The checkpoint guide distinguishes these choices. This framework deserves consideration when Python or .NET integration is a primary requirement. Verify the selected language’s APIs and provider capabilities rather than assuming every integration behaves identically.

Approval and failure handling belong in the application

For any of the four, show a reviewer the exact recipient, proposed reply, refund amount, and supporting policy. Bind approval to that proposal; if it changes, request a fresh decision. Missing evidence, invalid structured output, exhausted retries, or an expired approval should leave the case queued for a person.

A checkpoint records workflow progress; it does not by itself prevent a payment service from processing a repeated request. Give each authorized write an operation ID and use the destination service’s duplicate-prevention mechanism. Keep the read-only pilot’s credentials separate from write-enabled credentials. If you connect tools through MCP, our MCP servers guide explains that integration layer; the application still owns its permission decisions.

Open-source licensing is only one part of cost

The reviewed core repositories use MIT licenses: LangGraph, CrewAI, Pydantic AI, and Microsoft Agent Framework. This does not make provider APIs, hosting, databases, or optional commercial platforms free. Include tracing, retries, storage retention, and maintenance in the operating budget.

Running the framework on localhost also does not mean inference stays local. A configured cloud model receives the inputs sent to it; storage, tools, and tracing can have separate destinations. Map those paths before using customer records. Our local models vs cloud APIs guide covers that deployment decision.

Release snapshot and a practical first choice

Reviewed November 6, 2026: the core releases checked were LangGraph 1.2.20 for Python, CrewAI 1.15.35 for Python, Pydantic AI 2.66.0 for Python, and Microsoft Agent Framework Python 1.24.0 / .NET 1.27.0. These are non-prerelease core versions; add-ons have their own release status. LangGraph also has a separately versioned JavaScript/TypeScript implementation.

Shortlist by the constraint that already matters: explicit routing, distinct task responsibilities, a typed Python contract, or integration with your Python/.NET service. Try a read-only inquiry flow. Leave out the order data, supply a malformed proposal, reject a proposed response, and restart the service while a case is waiting for approval. Record what happens to the case in each test.

← Back to Comparisons
Tech Guides
Turn a PDF Into Editable Markdown With Docling ↗