Skip to content

How weft compares to other agent frameworks

View as Markdown

weft is a Go library that owns the agent loop: you call Generate or Stream, and weft runs the steps, the parallel tool calls, the approval boundary and the budgets, then records the run over OpenTelemetry. The frameworks below make different choices about who owns the loop, how tools run, where conversations live and how runs are traced and tested. This page sets those choices side by side, from each project’s own documentation, without ranking them.

Every claim about another framework comes from its documentation as read on 2026-10-18; the URLs are in this page’s sources. Defaults change between versions, so check the version you use.

FrameworkLanguageWho runs the loopDefault step budgetTool calls in one stepA failing tool
weftGothe library: agt.Generate / agt.Stream10 steps (MaxSteps), then the run fails with ErrMaxSteps4 at once (Parallelism), results in call order; Sequential() is a barrieran error result the model reads; an unknown tool is NO_SUCH_TOOL
Vercel AI SDKTypeScriptthe library: generateText / streamText1 step (isStepCount(1)); more only with stopWhenconcurrent by default; toolCallConcurrency caps thema tool-error part the model can respond to
Pydantic AIPythonthe library, over pydantic-graph; Agent.iter exposes the nodesUsageLimits(request_limit=…), default 50, then UsageLimitExceededconcurrent by default (asyncio); sequential=True is a barrierModelRetry asks for new arguments; ToolFailed reports a failed result
LangGraphPython, JavaScriptthe graph runtime, in Pregel-style super-stepsrecursion limit 1000 (since 1.0.6), then GraphRecursionErrornodes in one super-step run in parallel; Send fans outnot covered in the pages read
OpenAI Agents SDKPython (docs read)the Runnermax_turns, default 10, then MaxTurnsExceededconcurrent by default: every emitted local function call starts; tool_execution.max_function_tool_concurrency caps themthe default error function tells the model an error occurred; None re-raises
FrameworkHuman approvalConversations and persistenceObservabilityOffline tests
weftRequireApproval / ParkOn: the run ends with res.Pending; the next run resumes with Approve, Deny or Resolvethe caller feeds res.Messages back, or weft/thread sessions (jsonl, SQLite, memory, any thread.Storage)OTel spans and log records from the core; otel.Install sends them to a local SQLite file, Studio, Datadog, Langfuse or your exporterswefttest.Script, wefttest.Record / Replay, conformance.Run, WEFT_MODEL_REQUESTS=deny
Vercel AI SDKtoolApproval 'user-approval': the result carries tool-approval-request parts; the decision goes in a second callthe application stores messages (loadChat / saveChat in the guide)OpenTelemetry: invoke_agent, chat, execute_tool spansMockLanguageModelV4 from ai/test, simulateReadableStream
Pydantic AIrequires_approval=True; deferred calls come back as DeferredToolRequestsmessage_history; messages serialise with ModelMessagesTypeAdapter; where they live is the application’s choiceOpenTelemetry instrumentation; Logfire or any OTel backendTestModel, FunctionModel, Agent.override, ALLOW_MODEL_REQUESTS = False
LangGraphinterrupt() pauses the graph; resume with Command(resume=…) on the same thread_id, which re-runs the node from its start; needs a checkpointercheckpointers: InMemorySaver, SqliteSaver, PostgresSaver; time travelLangSmithnot covered in the pages read
OpenAI Agents SDKneeds_approval: the run pauses with interruptions; to_state(), approve / reject, run again; RunState serialises to JSONsession (SQLAlchemy, SQLite, encrypted and others), or server-side conversation_idtracing on by default, exported to OpenAI’s backend; custom trace processorsnot covered in the pages read

A cell that says “not covered” means the documentation pages consulted did not say; it is not a claim that the feature is missing.

  • Vercel AI SDK. A TypeScript toolkit for applications and agents across React, Next.js, Vue, Svelte and Node.js. Stop conditions are predicates (isStepCount, hasToolCall), and prepareStep rewrites each step’s model, tools and messages; weft’s PrepareStep rewrites messages, tools and system per step, and weft swaps the model per run (UseModel), not per step. Approval is a run boundary: the call returns approval requests and you answer in the next call.
  • Pydantic AI. A Python agent framework whose runs are graphs underneath (pydantic-graph), with an iterator over the nodes. Tool calls run concurrently, and sequential=True marks a barrier tool, the same shape as weft’s Sequential(). Its error vocabulary separates “try again” (ModelRetry) from “report a failure” (ToolFailed); weft’s ModelRetry and *ToolError draw the same line.
  • LangGraph. An orchestration framework and runtime in Python and JavaScript: every program is a graph executed in super-steps. Persistence, human-in-the-loop and time travel all come from one mechanism, the checkpointer. interrupt() pauses inside a node, and on resume the node runs again from its start, so code before the interrupt runs twice; that needs saved state; weft’s approval instead ends the run and needs none.
  • OpenAI Agents SDK. A Runner loop with agents as tools (as_tool) and handoffs between agents. Approval pauses the run into a RunState that serialises to JSON and resumes later. Tracing is on by default and goes to OpenAI’s backend unless you replace the processors.

The frameworks that answer these questions answer them the same way:

  1. A tool error is data the model sees. The AI SDK’s tool-error parts, the OpenAI SDK’s default error function, Pydantic AI’s ModelRetry and weft’s error results all let the model try again. In weft this is rule 1.
  2. One step’s tool calls run concurrently. The AI SDK, Pydantic AI, the OpenAI Agents SDK and weft run them at once by default; weft caps them at 4 and keeps results in call order (rule 3).
  3. Sequencing is declared per tool. Pydantic AI’s sequential=True and weft’s Sequential() are barriers set by the author, never inferred from the handler.
  4. Stopping is a predicate, separate from the budget. The AI SDK’s stopWhen and weft’s StopWhen say when the work is done; MaxSteps, max_turns and the recursion limit only bound it.
  5. Approval without a checkpointer is a run boundary. The AI SDK, the OpenAI SDK, Pydantic AI and weft hand the pending calls back to the caller, and the decision comes in with a later call. LangGraph, which has a checkpointer, pauses inside the node and re-runs it on resume.
  6. An agent can be a tool. as_tool in the OpenAI SDK, agenttool.New in Google ADK and weft.Subagent all wrap a child agent as a tool call.

Where they differ, weft takes one side:

QuestionWhat the others doweft
Is an exhausted budget an error?OpenAI raises MaxTurnsExceeded; LangGraph raises GraphRecursionError; the AI SDK’s isStepCount is a stop conditionAn error: *RunError wrapping ErrMaxSteps, with the partial transcript (rule 13)
How many steps by default?AI SDK 1, OpenAI 10, Pydantic AI 50 requests, LangGraph 1000 super-steps10
Where does orchestration live?LangGraph in the graph; Google ADK in workflow agents; Eino in Chain / Graph / WorkflowIn the loop: Subagent, PrepareStep, ToolSource. v0.20.2 ships no graph engine
How does behaviour attach?callbacks (Eino), hooks (Claude Agent SDK), prepareStep (AI SDK)Two seams, WrapModel and WrapTools, and one tap (rule 10); a third needs an ADR
What does approval need?LangGraph: a checkpointer and a thread id; OpenAI: the serialised RunStateThe transcript: weft.Messages(res.Messages...) plus weft.Approve(id) (rule 12)
What does a cut-off response do?not covered in the pages readA max_tokens step runs none of its tool calls; each gets an error result (rule 11)

Three more systems a Go engineer meets, at the depth of their public documentation:

FrameworkLanguageLoopDelegation and orchestrationHuman in the loopState
Google ADKGo (google.golang.org/adk/v2), Python, TypeScript, Java, Kotlinllmagent.New; workflow agents such as LoopAgent with a maximum iteration count and Escalateagenttool.New wraps an agent as a toola long-running function tool pauses the run for, for example, an approvalSession and SessionService; in-memory for development
Eino (CloudWeGo)GoChatModelAgent, a ReAct-style agentChain, Graph and Workflow orchestrationagents pause for approval or input; checkpoints resume themcheckpoint persistence
Claude Agent SDKPython, TypeScriptClaude Code’s loop, run as a library over the Claude Code binarysubagentspermissions decide which tools need approvalsessions, resumed or forked
  • Google ADK. Separates “the model decides” (llmagent) from “code decides” (sequential, parallel and loop workflow agents). Its Go tools take their JSON Schema from json and jsonschema struct tags, as weft’s do. Its dev web UI is documented as not meant for production; weft’s Studio is meant to be mounted in your app or run beside it.
  • Eino. A Go framework built on graphs: components wired by Chain, Graph or Workflow, with automatic conversion between streaming and non-streaming nodes. Callbacks carry logging, tracing and metrics. Pausing for a human is built on checkpoints.
  • Claude Agent SDK. Not a loop library but a harness exposed as one: the tools, loop, context management, hooks, permissions and sessions of Claude Code, in Python and TypeScript. Genkit’s interrupts (beta) pause the generate loop and resume with a response or a restart.

What the wider field adds to the agreement list: delegation by wrapping an agent as a tool appears in the OpenAI Agents SDK (as_tool), Google ADK (agenttool.New) and the Claude Agent SDK (subagents), and every framework read here pauses a run for a human decision in some form.

The deep dive’s survey also covers Mastra, Crush, DeerFlow and pi. They are left out of this page: its claims about them could not be checked against their own documentation for this revision. What it adds to the differences: graph-first designs (LangGraph, Eino, ADK’s workflow agents) put orchestration in the runtime, while weft and the AI SDK leave it in the loop and in your code.

A harness is the product around a loop: tools, permissions, context management, sessions and extension points that keep a loop usable over a long task. The Claude Agent SDK is one exposed as a library. A loop library is useful to a harness when the harness can be built on it without forking it. These are the harness features and where each lives in weft v0.20.2:

Harness featureWhere it lives in weft v0.20.2
Permission modelmw.Allow (tool middleware), weft.RequireApproval, weft.ParkOn, and in sessions s.Decide, grants and signed decisions (s.DecideSigned)
Context compactionthread.ContextWindow and s.Compact
Sessions, resume, forkthread.Create, thread.Open, s.Branch, s.Fork
Subagents with their own contextweft.Subagent; a bounded pool of child sessions in thread/pool
Project instructionsweft.Instructions plus each tool’s weft.PromptSnippet
Hooksthe two seams and the tap: weft.WrapModel, weft.WrapTools, weft.Tap, weft.OnRunEnd
Tools loaded on demandweft.ToolSource: the loop re-reads the tool set each step
Steering a running turnweft.Steering, and s.Steer in sessions
Verification loopweft.StopWhen on a checking tool
Spendweft.UsageLimit bounds tokens; Studio prices runs at read time but enforces nothing
Sandboxnone. The planned thread/sandbox (ADR 0023) was abandoned and does not ship
MCPmcp.Tools consumes a server’s tools; mcp.Serve exposes an agent

weft is a Go library. If you want to write the agent itself in Python or TypeScript, the frameworks above are written for that; Studio still reads OpenTelemetry from agents in any language (Use Studio with agents in other languages). If you need a hosted no-code builder, a graph or workflow engine today, or a frozen 1.0 API, weft v0.20.2 has none of these; what is planned is on the roadmap.

  • Defaults move between versions. LangGraph’s recursion limit is 1000 since 1.0.6; weft’s deep dive, written earlier, still says 25. A comparison holds only at the versions named. (Source: LangGraph Graph API docs; docs/agent-loop-deep-dive.md:2037)
  • “Paused” means different things. LangGraph’s interrupt() re-runs the node from its start on resume, from a checkpoint; weft’s approval ends the run, and the resume is a new run over the same transcript, so the storage each needs differs. (Source: AGENTS.md rule 12; LangGraph interrupts docs)
  • A budget breach in weft is an error, not a result. ErrMaxSteps and ErrUsageLimit arrive as a *RunError carrying the partial transcript. (Source: AGENTS.md rules 1 and 13)

The weft side of this page comes from the repository at v0.20.2:

  • docs/agent-loop-deep-dive.md, Part III (the frameworks side by side) and §32 (its reading list). Its framework matrix predates v0.20.2 in places: it lists DetectLoops and UsageLimit as planned and a store module that was removed; both options ship in v0.20.2.
  • The ADRs in docs/adr/, each of which records what other frameworks did before weft chose (Architecture decision records).
  • AGENTS.md, the rules that the comparison tables cite (Design principles).

The deep dive’s §32 also lists outside reading. It is named here without links because these docs link only to weft’s own sites, GitHub and the Go sites; the URLs are in the deep dive itself:

  • Anthropic’s “Building effective agents”: the workflow and agent vocabulary Agent patterns uses.
  • Anthropic’s “Effective context engineering for AI agents”: why the context window is managed per step.
  • Anthropic’s “Writing effective tools for agents”: the tool-design rules.
  • OpenAI’s “A practical guide to building agents”: the manager and decentralised patterns, and guardrails as layers.
  • HumanLayer’s “12-Factor Agents”: a checklist the patterns page maps onto weft.
  • Simon Willison’s “The lethal trifecta for AI agents”: why containment, not filtering, is the safety strategy.
  • The ReAct, Reflexion and CodeAct papers: the research lineage behind the tool loop. For the frameworks on this page, read their own documentation: the Vercel AI SDK, Pydantic AI, LangGraph, the OpenAI Agents SDK, Google ADK, Eino, Genkit and the Claude Agent SDK.

Symbols used: weft.Agent · Agent.Generate · Agent.Stream · weft.MaxSteps · weft.Parallelism · weft.Sequential · weft.StopWhen · weft.UsageLimit · weft.ModelRetry · weft.ToolError · weft.RequireApproval · weft.ParkOn · weft.Approve · weft.Deny · weft.Resolve · weft.Messages · weft.Subagent · weft.PrepareStep · weft.ToolSource · weft.WrapModel · weft.WrapTools · weft.Tap · weft.OnRunEnd · weft.Instructions · weft.PromptSnippet · weft.Steering · weft.ErrMaxSteps · weft.ErrUsageLimit · weft.RunError · mw.Allow · thread.Create · thread.Open · thread.Storage · thread.ContextWindow · Session.Compact · Session.Steer · Session.Decide · otel.Install · mcp.Tools · mcp.Serve · wefttest.Script · wefttest.Record · wefttest.Replay · conformance.Run