Executive Summary

The open-source AI agent ecosystem is easier to understand when organized by responsibility, not by a ranking:

text
business workflow and policy
        |
agent runtime and orchestration
        |
model, tool, memory, and evaluation adapters
        |
MCP / HTTP / queues / databases / sandboxes

Frameworks make different ownership choices. A low-level SDK may let the application own the loop. A graph runtime may own checkpoints and transitions. A role-based system may add delegation concepts. A provider toolkit may integrate deployment and evaluation. Those are design bets, not a quality ladder.

The correct selection process is:

  1. prove that ordinary code is insufficient;
  2. identify the state, control, and failure behavior the application must own;
  3. shortlist the smallest frameworks that match those needs;
  4. implement the same representative tasks;
  5. compare quality, recovery, governance, and exit cost;
  6. retain a migration path.

Do Not Start with a Framework

Start with the work.

Classify the control problem

Workload First implementation to test
fixed validation or transformation ordinary function
known sequence with retries and approvals workflow engine or explicit state machine
one model choosing among a few bounded tools direct agent loop or lightweight SDK
long-running, resumable, branching work graph or durable workflow runtime
genuinely distinct roles with different tools or evaluators bounded multi-agent orchestration
ready-to-use personal or coding assistant packaged application

Microsoft Agent Framework's own guidance is unusually direct: if a function can handle the task, use a function. That principle generalizes. An agent framework is justified when semantic decisions, adaptive planning, or tool selection deliver value that deterministic control cannot.

Write the acceptance contract

Before selecting a framework, define:

  • task inputs and authorized context;
  • allowed tools and side effects;
  • expected output or artifact;
  • correctness and evidence rubric;
  • maximum turns, tool calls, time, and cost;
  • approval points;
  • retryable and terminal failures;
  • cancellation and resume behavior;
  • audit and privacy requirements.

This contract becomes the framework comparison. Without it, teams compare demos and abstractions rather than production behavior.

A Layered Ecosystem Map

Layer 0: Deterministic application code

This is the baseline, not a lesser form of agent.

Use ordinary code for validation, routing with known conditions, authorization, payments, state transitions, and other invariants. A language model can recommend an action, but trusted code should enforce whether it is allowed.

Layer 1: Direct model and tool loops

The application owns the loop:

  1. assemble authorized context;
  2. call the model;
  3. validate a requested tool call;
  4. execute the tool under policy;
  5. return a bounded result;
  6. stop on a defined condition.

This design minimizes abstraction and lock-in. It also means the team owns state, retries, tracing, tool dispatch, and guardrails. It is often the right baseline for a small number of tools.

Layer 2: Lightweight agent SDKs

SDKs add reusable primitives such as agents, tools, handoffs, sessions, guardrails, and tracing.

The OpenAI Agents SDK, for example, describes a small set of primitives around agents, tools, handoffs, guardrails, sessions, human involvement, and tracing. Its own documentation distinguishes using a lower-level model API when the application wants to own the loop from using the SDK when it wants managed turns and tool execution.

The important selection question is not whether a feature exists. It is who owns its semantics:

  • Is a "session" portable application state or framework state?
  • Can a paused run survive process loss?
  • Are guardrails enforcement points or model-side hints?
  • Can traces be exported without retaining sensitive content?

Layer 3: Graph and durable workflow runtimes

Graph runtimes make nodes, transitions, state, checkpoints, interruption, and resume explicit. LangGraph positions itself as a low-level runtime for controllable, persistent, human-in-the-loop agents.

This is useful when:

  • a run must pause for approval and resume later;
  • different failure classes take different paths;
  • state must be inspected or replayed;
  • loops need explicit termination;
  • long-running work cannot depend on one process.

A graph does not make a workflow safe by itself. A loop without a sound exit condition is still a loop, and a checkpoint containing secrets is still a data leak.

Layer 4: Role-based and multi-agent orchestration

CrewAI distinguishes structured Flows from autonomous Crews, recommending the flow as the production backbone and using crews for work that benefits from agent collaboration.

Multiple agents are justified when at least one of these is true:

  • roles need different permissions or tools;
  • work can run in parallel with a clear merge contract;
  • independent evaluators reduce a measured failure mode;
  • context separation is valuable;
  • ownership boundaries map to different services or teams.

They are not justified merely because a task has multiple steps. Multi-agent designs add handoff loss, duplicated context, more model calls, harder attribution, and a larger attack surface. Compare them against one agent inside a deterministic workflow.

Layer 5: Provider and deployment toolkits

Some frameworks optimize for a broader platform.

  • Google ADK documents sequential, parallel, loop, and LLM-directed agent patterns, plus evaluation and deployment integrations across several languages.
  • Microsoft Agent Framework combines agents, a long-running harness, explicit workflows, middleware, sessions, telemetry, and provider integrations; language support can differ in maturity.
  • OpenAI Agents SDK focuses on a compact runtime around tools, handoffs, guardrails, sessions, tracing, and isolated workspaces.

These descriptions come from each project's documentation. They show intended scope, not independent proof of reliability or fit. Verify the exact language, feature, license, release, and support status required by the project.

Layer 6: Protocols and integration boundaries

MCP standardizes an integration boundary for tools, resources, prompts, and optional extensions. The 2026-07-28 specification uses stateless, self-contained requests at the protocol core.

MCP can reduce connector duplication. It does not decide:

  • which user may call a tool;
  • which record that user may access;
  • whether an effect requires approval;
  • whether a tool result is trustworthy;
  • which Agent may delegate to another;
  • whether a workflow should continue.

Those remain application and service responsibilities.

Representative Framework Positions

This table is a map of documented design intent, not a winner list.

Option Primary abstraction Application must still prove
Direct provider API model call and tool request loop correctness, state, retries, policy, observability
OpenAI Agents SDK agents, tools, handoffs, guardrails, sessions provider fit, recovery, policy enforcement, data handling
LangGraph explicit graph, state, persistence, interruption correct transitions, durable storage, termination, policy
CrewAI flows plus role-based crews whether collaboration beats one agent, handoff quality
Google ADK agents, workflow patterns, tools, evaluation, deployment model portability, runtime behavior, production controls
Microsoft Agent Framework agents, harness, workflows, middleware, integrations language feature parity, preview boundaries, compliance fit
MCP SDKs protocol clients and servers business authorization, delegation, tool safety, lifecycle

AutoGPT, MetaGPT, coding assistants, and packaged personal assistants belong to other points on the map. Evaluate them as applications or opinionated systems, not as interchangeable libraries.

A Framework Evaluation Harness

Use the same tasks

Build a small suite that represents production:

  • a normal successful task;
  • ambiguous input that should request clarification;
  • an unauthorized action;
  • a tool timeout;
  • a partial side effect with an unknown outcome;
  • prompt injection inside retrieved content;
  • cancellation during a long tool call;
  • process restart before resume;
  • a repeated-state loop;
  • a task the system should refuse or route to a human.

Keep the comparison equivalent

Pin:

  • model and parameters;
  • tool contracts and results;
  • system instructions;
  • policy and approval rules;
  • input fixtures;
  • time, turn, token, and cost budgets;
  • retry and idempotency behavior;
  • environment and dependency versions.

If one framework supplies a feature the other lacks, include the application code needed to provide equivalent behavior. Otherwise the test measures configuration completeness rather than runtime fit.

Score more than task completion

Dimension Example measures
Outcome accepted task rate, artifact correctness, evidence coverage
Tool use valid calls, unauthorized attempts, argument corrections
Recovery resume success, duplicate-effect prevention, cancellation latency
Control approval compliance, budget enforcement, loop termination
Operations p50/p95 latency, error rate, model usage, infrastructure cost
Observability reconstructable actions, correlation, redaction, trace export
Engineering code volume, testability, debugging time, upgrade effort
Portability model swap, tool reuse, state export, replacement effort

Do not log hidden model reasoning as an audit requirement. Record inputs allowed by policy, tool decisions, arguments after redaction, results by class, state transitions, approvals, and artifacts.

Governance Is Outside the Brand Name

Every serious deployment needs an application control plane:

  1. Trusted identity: derive user, tenant, workload, and delegated actor from authenticated context.
  2. Object-level authorization: enforce policy at the owning service on every read and write.
  3. Tool allowlists: expose only the capabilities required for the task.
  4. Bounded execution: cap turns, calls, time, output, files, network destinations, and spend.
  5. Effect controls: use confirmation, idempotency keys, transactions, and outcome reconciliation.
  6. Untrusted-input handling: treat web pages, tool output, resources, and other agents' messages as data.
  7. Sandboxing: remove production credentials and restrict filesystem, process, and network access.
  8. Audit: record policy decisions and observable actions without secrets or private reasoning.

A framework can provide hooks for these controls. The application still owns whether they are complete and enforced.

Evaluate Exit Cost Before Entry

Framework adoption creates durable artifacts: state snapshots, message formats, tool wrappers, deployment manifests, traces, evaluation data, and operational knowledge.

Before production, answer:

  • Can business state be exported in an application-owned schema?
  • Can tools run without the framework?
  • Are prompts and policies stored separately from runtime code?
  • Can traces move to an open observability backend?
  • Can a run be replayed from versioned inputs?
  • What happens when an SDK removes or changes a feature?
  • Can a second implementation pass the same evaluation suite?

The strongest portability mechanism is not an abstraction layer over every API. It is a stable acceptance contract, framework-independent tools and policy, portable state, and a repeatable test suite.

Selection Procedure

  1. Choose the simplest baseline. Start with a function, workflow, or direct loop.
  2. Identify missing capabilities. Persistence, interruption, role separation, deployment, or evaluation should map to a real requirement.
  3. Shortlist by responsibility. Compare frameworks that solve the same layer.
  4. Prototype one risky path. Test approval, restart recovery, or a real tool failure, not only a hello-world agent.
  5. Run the shared harness. Keep models, tools, policy, and budgets equivalent.
  6. Review governance and data flow. Inspect credentials, storage, telemetry, and third-party boundaries.
  7. Price the exit. Perform a small export or replacement exercise.
  8. Pin and monitor. Lock versions, track deprecations, and rerun the suite on upgrades.

FAQ

Which open-source agent framework is best?

First identify whether the task needs a tool loop, durable state, role collaboration, or platform integration. Then compare the smallest viable options. A ranking without task distribution, recovery behavior, and maintenance cost cannot settle production fit.

Does a multi-step task require an agent framework?

No. Known steps and transitions are often easier to verify in ordinary functions or a workflow engine. Give the model control only where semantic judgment or adaptive tool selection adds measured value.

Can MCP standardize the entire agent stack?

It standardizes part of the tool, resource, and prompt integration boundary. It does not standardize business state, tenant permissions, approval meaning, or framework recovery. Verify protocol compatibility and application portability separately.

How should two frameworks be compared fairly?

Fix task fixtures, model, tool contracts, policy, and budgets. Test completion, timeout, duplicate effects, cancellation, and process restart. Include the application code and maintenance effort needed to close feature gaps.

How can a team reduce framework lock-in?

Keep business tools, policy, fixtures, and evaluations outside the framework, and store business state in an application-owned schema. Demonstrate an export or replacement before adoption instead of relying on a promise of future portability.

Conclusion

The open-source agent ecosystem is not a race with one leader. It is a set of layers that allocate control differently.

Use deterministic code where the process is known. Use a direct loop when only a little agent behavior is needed. Use an SDK when its primitives remove real repeated work. Use a graph or durable workflow runtime when pause, resume, branching, and inspection are requirements. Add multiple agents only when specialization or parallelism beats its coordination cost. Use MCP to standardize integration, not to outsource policy.

The durable asset is the application's task contract, tools, policy, evaluation set, and operational evidence. Frameworks should serve those assets and remain replaceable by them.

Primary Sources