Between "an agent that runs" and "a robust, fully-featured agent" sits an entire stack. This report takes that stack apart: six primary layers plus three frequently-overlooked auxiliary ones, each answering three questions — what problem does this layer solve, which frameworks dominate it, and how do they differ. All comparisons reflect the public state as of September 2026.
How to read it: start with the stack map, then jump to the layers you are missing. Each layer ends with a marked verdict block — conclusions you can take straight to a decision. The reference answers at the end give two minimal robust stacks, TS and Python.
This report answers one concrete question: what layers does it take to build a robust, fully-featured agent, and how do the frameworks within each layer compare. Six primary layers plus three auxiliary ones that are frequently overlooked — each with its responsibility, a comparison table of the main players, and a selection verdict.
One reading path: start with the stack map below, then jump to whichever layer you are missing. All comparisons reflect the public state as of September 2026.
Layer 01
Models — set the ceiling, not the floor
The frontier three (GPT / Claude / Gemini) cover most agent tasks; open source (DeepSeek, Qwen, Llama) fills the cost-sensitive, self-hosted and privacy-sensitive gaps. Models set the ceiling of agent capability — robustness comes from the layers below. Models must be swappable at any time: that is the first requirement of stack design.
Layer 02
Harness / Orchestration — the skeleton of the agent
This layer decides how control flow is written: loops, branches, handoffs between agents, state management. "Write an agent" means different things in different frameworks — choosing a framework is choosing a control-flow model.
Main frameworks compared
| Framework | Language | Orchestration primitive | Strengths | Best for |
|---|---|---|---|---|
| OpenAI Agents SDK | Python / TS | Handoffs + a minimal four-primitive core | Tiny core, fastest to start; tied to the Responses API and built-in tools (search / computer use) | Fast delivery inside the OpenAI ecosystem |
| Claude Agent SDK | TS / Python | Agent loop (the Claude Code kernel) | Batteries included: file tools, subagents, permission system, hooks, Skills, context compaction | Those who want a proven robust kernel, not a DIY kit |
| Google ADK | Python / Java | Hierarchical multi-agent (built-in sequential / parallel / loop workflows) | Gemini-native, one-stop hosting on Vertex AI Agent Engine, built-in evals | GCP enterprise stacks |
| Vercel AI SDK | TypeScript | Unified model interface + a light Agent abstraction | Streaming UI (useChat), multi-model routing, best-in-class TS full-stack experience | TS full-stack, conversational products |
| Mastra | TypeScript | All-in-one: durable workflows + RAG + memory + evals | The most complete standalone framework in TS, ships a local playground | TS teams wanting one vendor |
| PydanticAI | Python | Type safety: structured output + dependency injection | Seamless with Pydantic / FastAPI, engineered yet light | Teams already on FastAPI |
| LangGraph | Python / JS | Graph / state machine: nodes, edges, shared state, checkpoints | The strongest control flow: loops, branches, human-in-the-loop, resume, time-travel debugging | Complex long-running flows with approvals; the enterprise production mainstay |
| CrewAI | Python | Role-based multi-agent (Crew + Task) | Lowest expression cost for multi-agent collaboration | Role-divided multi-agent demos and light production |
On the JVM
| Framework | Origin | Positioning |
|---|---|---|
| Spring AI | Spring official (1.0 GA May 2025) | The de facto Java standard: unified ChatClient, @Tool, MCP client+server, OTel observability; building blocks, orchestration is on you |
| LangChain4j | Community | More "complete": AI Services, RAG, ChatMemory; official Quarkus binding; graph orchestration via LangGraph4j |
| Google ADK Java | Google official | GA at parity with Python: hierarchical agents, built-in evals, Vertex hosting |
| Spring AI Alibaba | Alibaba | Deep Qwen / DashScope integration, graph orchestration, JManus (open general agent); the most active Chinese ecosystem |
| Semantic Kernel | Microsoft | Has a Java SDK but in maintenance mode — the successor Agent Framework prioritizes .NET / Python only |
From demo to production
Every framework above demos in under 50 lines. Production adds durable state, retries, approvals, budgets and evals. Demos never show any of it. So ask which escape hatches you need first: every harness lets you bring your own state, queue and observability, at very different prices; once that is answered, "which framework is best" usually answers itself.
| Framework | State & durability | Streaming | Observability & testing | Known production pitfalls |
|---|---|---|---|---|
| OpenAI Agents SDK | Session memory only; durability is DIY (pair with Temporal / Inngest) | Native events | Platform traces for OpenAI calls; DIY elsewhere | Thin middleware: retries, budgets, approvals are yours; the deepest value sits in OpenAI-hosted tools |
| Claude Agent SDK | Sessions with built-in compaction; workflow durability still yours | Structured event stream | Hooks + OTel export | Opinionated runtime (bash / file tools, sandbox assumptions); cost profile tied to Claude; heavier than the word "SDK" suggests |
| Google ADK | Session service; hosting on Vertex Agent Engine | Partial | Built-in evals + GCP tracing | GCP gravity; multi-agent abstractions still early |
| Vercel AI SDK | None built in — Vercel Workflow adds it | Best-in-class TS streaming | AI SDK telemetry (OTel) | The agent loop is thin; long tasks require Workflow; notable API churn across major versions |
| Mastra | Durable workflows + memory built in | Yes | Local playground + evals built in | Young ecosystem, API churn, small hiring pool |
| PydanticAI | DIY (bring your own stores) | Yes | Logfire + OTel; dependency injection keeps unit tests clean | Few batteries: memory, RAG and workflow are all DIY; smaller community |
| LangGraph | Checkpoints (Postgres / SQLite) + time travel | Yes | Deepest LangSmith integration | Boilerplate; checkpoint storage becomes an ops component; platform upsell; 0.x-era churn history |
| CrewAI | Built-in memory | Limited | Basic | Control flow past the demo stage is hard; debugging multi-crew runs is painful |
Layer 03
Context Engineering — what you feed the model decides what comes out
Since 2025 "context engineering" has replaced prompt engineering as the name of this layer. It covers four things: system prompts and conventions, capability packaging, memory, retrieval.
| Component | Representative | Notes |
|---|---|---|
| Convention files | AGENTS.md | The "README for agents", a cross-tool convention; a convention, not a component |
| Capability packaging | Anthropic Skills | Procedures, scripts and docs packaged into discoverable capabilities with progressive disclosure — becoming the de facto distribution standard |
| Memory | Mem0 / Letta / Zep | Extract-store-recall pipelines that persist state across sessions; pick by hosting model and recall strategy |
| Retrieval | Vector stores / RAG pipelines | Moving from prefetch-style RAG to on-demand retrieval: tool-based just-in-time context often beats stuffing up front |
Layer 04
Protocols — three families, not one
This layer defines how components talk. Split by the parties communicating; lumping them together is a common mistake.
| Family | Protocol | Parties | Status |
|---|---|---|---|
| Tool interop | MCP | agent ↔ tools / data sources | De facto standard: all three major vendors have adopted it |
| Agent interop | A2A | agent ↔ agent | Donated to the Linux Foundation; standardization ran ahead of demand, modest adoption |
| Interface interop | AG-UI / A2UI / UCP | agent ↔ frontend / commerce | Streaming UI state sync and agentic commerce, evolving fast through 2026 |
Layer 05
Execution — where model output becomes action
Two sub-kinds: code-execution sandboxes and browser / computer control. The robustness concerns are entirely different.
| Sub-kind | Representative | Notes |
|---|---|---|
| Code sandbox | E2B / Daytona / Modal | Firecracker-grade isolation, snapshot restore, per-second billing — the only safe way to run model-generated code |
| Browser / computer control | Browserbase / Playwright MCP / computer-use | Where production incidents concentrate: selector drift, login state, anti-bot; hosted browsers plus explicit approvals beat raw computer-use |
Layer 06
Durable Execution — the line between robust and toy
Long tasks always hit the same wall: a process dies, a model call times out, a step needs retry, a run pauses for human approval. Durable execution engines persist state so tasks can resume, retry and replay.
| Engine | Form | Notes |
|---|---|---|
| Temporal | Self-hosted / cloud | The most mature; code-as-workflow (replay model); heavy — the enterprise default |
| Inngest | Hosted / self-hosted | Event-driven, function-level step retry; smooth in TS |
| DBOS | Library (TS / Py) | Durable execution inside Postgres — light, no separate component |
| Restate | Self-hosted / cloud | Lightweight runtime with clean durable primitives |
| Cloudflare Workflows | Inside Workers | Step-level durability inside the CF ecosystem, native with D1 / R2 |
| Vercel Workflow | Inside Vercel | The natural durability layer for the Vercel AI SDK |
| LangGraph Platform | Hosted | LangGraph checkpoints are already durable; Platform adds hosting and deployment |
Layer 07 · Aux
Gateway & Routing — the infrastructure floor for multi-model
Model swappability is a design requirement; this is where it lands: one API, routing by cost / latency / availability, budgets and rate limits.
Layer 08 · Aux
Observability & Evals — wire it in from day one
Agent failures are chained: attributing one detour requires a complete trace. This layer must ship with version one — observability bolted on later never has the context.
| Tool | Form | Notes |
|---|---|---|
| Langfuse | Open source, self-hostable | Tracing + prompt management + evals + datasets; framework-agnostic |
| LangSmith | LangChain commercial | Deepest integration with LangGraph |
| Braintrust | Commercial | Eval-first: datasets, online scoring, experiment comparison |
| OTel GenAI conventions | Standard | Vendor-neutral tracing spec; avoids lock-in |
Layer 09 · Aux
Guardrails & Security — the last line of robust
Three kinds: permission models (tool allowlists, path whitelists, human approval points), output validation (schema checks + fact checks), and data safety (PII filtering, audit logs). Claude Agent SDK's permission system and LangGraph's human-in-the-loop are primitives at this layer.
Trend
Consolidation — who is eating whom
The stack map is static; the ecosystem is actively merging layers:
Implication: when choosing a framework, read its "absorption roadmap" — the layers you will use in two years are probably already built into today's harness.
Reference answers — two minimal robust stacks
TS stack: Claude Agent SDK (or Vercel AI SDK + Mastra) + MCP tools + Inngest / Vercel Workflow (durability) + E2B (sandbox) + LiteLLM (gateway) + Langfuse (observability).
Python stack: OpenAI Agents SDK or LangGraph + MCP tools + Temporal (durability) + E2B (sandbox) + LiteLLM (gateway) + Langfuse (observability).
Both run in production. They differ only in language and hosting preference. The test for robustness never changes: every layer has to answer "what happens when it breaks."