How weft compares to other agent frameworks
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.
Frameworks side by side
Section titled “Frameworks side by side”The loop and its tools
Section titled “The loop and its tools”| Framework | Language | Who runs the loop | Default step budget | Tool calls in one step | A failing tool |
|---|---|---|---|---|---|
| weft | Go | the library: agt.Generate / agt.Stream | 10 steps (MaxSteps), then the run fails with ErrMaxSteps | 4 at once (Parallelism), results in call order; Sequential() is a barrier | an error result the model reads; an unknown tool is NO_SUCH_TOOL |
| Vercel AI SDK | TypeScript | the library: generateText / streamText | 1 step (isStepCount(1)); more only with stopWhen | concurrent by default; toolCallConcurrency caps them | a tool-error part the model can respond to |
| Pydantic AI | Python | the library, over pydantic-graph; Agent.iter exposes the nodes | UsageLimits(request_limit=…), default 50, then UsageLimitExceeded | concurrent by default (asyncio); sequential=True is a barrier | ModelRetry asks for new arguments; ToolFailed reports a failed result |
| LangGraph | Python, JavaScript | the graph runtime, in Pregel-style super-steps | recursion limit 1000 (since 1.0.6), then GraphRecursionError | nodes in one super-step run in parallel; Send fans out | not covered in the pages read |
| OpenAI Agents SDK | Python (docs read) | the Runner | max_turns, default 10, then MaxTurnsExceeded | concurrent by default: every emitted local function call starts; tool_execution.max_function_tool_concurrency caps them | the default error function tells the model an error occurred; None re-raises |
Around the loop
Section titled “Around the loop”| Framework | Human approval | Conversations and persistence | Observability | Offline tests |
|---|---|---|---|---|
| weft | RequireApproval / ParkOn: the run ends with res.Pending; the next run resumes with Approve, Deny or Resolve | the 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 exporters | wefttest.Script, wefttest.Record / Replay, conformance.Run, WEFT_MODEL_REQUESTS=deny |
| Vercel AI SDK | toolApproval 'user-approval': the result carries tool-approval-request parts; the decision goes in a second call | the application stores messages (loadChat / saveChat in the guide) | OpenTelemetry: invoke_agent, chat, execute_tool spans | MockLanguageModelV4 from ai/test, simulateReadableStream |
| Pydantic AI | requires_approval=True; deferred calls come back as DeferredToolRequests | message_history; messages serialise with ModelMessagesTypeAdapter; where they live is the application’s choice | OpenTelemetry instrumentation; Logfire or any OTel backend | TestModel, FunctionModel, Agent.override, ALLOW_MODEL_REQUESTS = False |
| LangGraph | interrupt() pauses the graph; resume with Command(resume=…) on the same thread_id, which re-runs the node from its start; needs a checkpointer | checkpointers: InMemorySaver, SqliteSaver, PostgresSaver; time travel | LangSmith | not covered in the pages read |
| OpenAI Agents SDK | needs_approval: the run pauses with interruptions; to_state(), approve / reject, run again; RunState serialises to JSON | session (SQLAlchemy, SQLite, encrypted and others), or server-side conversation_id | tracing on by default, exported to OpenAI’s backend; custom trace processors | not 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.
Each framework in three lines
Section titled “Each framework in three lines”- 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), andprepareSteprewrites each step’s model, tools and messages; weft’sPrepareSteprewrites 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, andsequential=Truemarks a barrier tool, the same shape as weft’sSequential(). Its error vocabulary separates “try again” (ModelRetry) from “report a failure” (ToolFailed); weft’sModelRetryand*ToolErrordraw 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
Runnerloop with agents as tools (as_tool) and handoffs between agents. Approval pauses the run into aRunStatethat serialises to JSON and resumes later. Tracing is on by default and goes to OpenAI’s backend unless you replace the processors.
Where they agree, and where weft sits
Section titled “Where they agree, and where weft sits”The frameworks that answer these questions answer them the same way:
- A tool error is data the model sees. The AI SDK’s
tool-errorparts, the OpenAI SDK’s default error function, Pydantic AI’sModelRetryand weft’s error results all let the model try again. In weft this is rule 1. - 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).
- Sequencing is declared per tool. Pydantic AI’s
sequential=Trueand weft’sSequential()are barriers set by the author, never inferred from the handler. - Stopping is a predicate, separate from the budget. The AI SDK’s
stopWhenand weft’sStopWhensay when the work is done;MaxSteps,max_turnsand the recursion limit only bound it. - 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.
- An agent can be a tool.
as_toolin the OpenAI SDK,agenttool.Newin Google ADK andweft.Subagentall wrap a child agent as a tool call.
Where they differ, weft takes one side:
| Question | What the others do | weft |
|---|---|---|
| Is an exhausted budget an error? | OpenAI raises MaxTurnsExceeded; LangGraph raises GraphRecursionError; the AI SDK’s isStepCount is a stop condition | An 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-steps | 10 |
| Where does orchestration live? | LangGraph in the graph; Google ADK in workflow agents; Eino in Chain / Graph / Workflow | In 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 RunState | The transcript: weft.Messages(res.Messages...) plus weft.Approve(id) (rule 12) |
| What does a cut-off response do? | not covered in the pages read | A max_tokens step runs none of its tool calls; each gets an error result (rule 11) |
The wider field
Section titled “The wider field”Three more systems a Go engineer meets, at the depth of their public documentation:
| Framework | Language | Loop | Delegation and orchestration | Human in the loop | State |
|---|---|---|---|---|---|
| Google ADK | Go (google.golang.org/adk/v2), Python, TypeScript, Java, Kotlin | llmagent.New; workflow agents such as LoopAgent with a maximum iteration count and Escalate | agenttool.New wraps an agent as a tool | a long-running function tool pauses the run for, for example, an approval | Session and SessionService; in-memory for development |
| Eino (CloudWeGo) | Go | ChatModelAgent, a ReAct-style agent | Chain, Graph and Workflow orchestration | agents pause for approval or input; checkpoints resume them | checkpoint persistence |
| Claude Agent SDK | Python, TypeScript | Claude Code’s loop, run as a library over the Claude Code binary | subagents | permissions decide which tools need approval | sessions, 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 fromjsonandjsonschemastruct 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.
Harnesses: what sits around the loop
Section titled “Harnesses: what sits around the loop”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 feature | Where it lives in weft v0.20.2 |
|---|---|
| Permission model | mw.Allow (tool middleware), weft.RequireApproval, weft.ParkOn, and in sessions s.Decide, grants and signed decisions (s.DecideSigned) |
| Context compaction | thread.ContextWindow and s.Compact |
| Sessions, resume, fork | thread.Create, thread.Open, s.Branch, s.Fork |
| Subagents with their own context | weft.Subagent; a bounded pool of child sessions in thread/pool |
| Project instructions | weft.Instructions plus each tool’s weft.PromptSnippet |
| Hooks | the two seams and the tap: weft.WrapModel, weft.WrapTools, weft.Tap, weft.OnRunEnd |
| Tools loaded on demand | weft.ToolSource: the loop re-reads the tool set each step |
| Steering a running turn | weft.Steering, and s.Steer in sessions |
| Verification loop | weft.StopWhen on a checking tool |
| Spend | weft.UsageLimit bounds tokens; Studio prices runs at read time but enforces nothing |
| Sandbox | none. The planned thread/sandbox (ADR 0023) was abandoned and does not ship |
| MCP | mcp.Tools consumes a server’s tools; mcp.Serve exposes an agent |
When weft is not the fit
Section titled “When weft is not the fit”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.
What the differences mean in practice
Section titled “What the differences mean in practice”- 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.
ErrMaxStepsandErrUsageLimitarrive as a*RunErrorcarrying the partial transcript. (Source: AGENTS.md rules 1 and 13)
Further reading
Section titled “Further reading”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 listsDetectLoopsandUsageLimitas planned and astoremodule 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.
See also
Section titled “See also”- The agent loop, from first principles
- Agent patterns and where they attach in weft
- Design principles: the rules weft keeps
- What is weft?
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