The model reasons. The harness is everything around it. One paper gives an agent a memory of what worked, and lifts WebArena success from 23.5% to 35.5%. The other rebuilds the harness around one event log, and cuts system failures from 78 to 30 per 1,000 conversations.
Pick a memory and a harness, then press Play. Forty tasks of four types run through the agent, and 1,000 conversations run through the harness. Then we build, piece by piece, the workflow, its induction, the online loop, the event log and the safety gates.
You need a little Python and the idea of a tool call: the model writes a JSON request, and code runs it. We build the rest from zero.
Session 7 of Georgia Tech CS 8803, LLM seminar. It rests on two papers: Wang, Mao, Fried and Neubig, Agent Workflow Memory (2024), and Wang, Rosenberg, Michelini and 8 co-authors, The OpenHands Software Agent SDK (MLSys 2026). Every idea is re-taught here in our own words and devices.
Top half is a toy: four task types, a base success rate of 23.5% and 8 steps, and each stored workflow adds 10 points and saves one step. The papers' numbers: WebArena success 23.5% (BrowserGym) and 35.5% (AWM), 7.9 and 5.9 steps (Table 1 of AWM). Bottom half uses the paper's rates: 78.0 and 30.0 system failures per 1,000 conversations (Table 2 of OpenHands); the cell positions are random.
Chapter 0
See why the same model can stay slow and fragile on day thirty
You ship a web agent. On day one it books a flight, files an expense and answers a ticket. On day thirty it still books flights, but it explores the booking site from scratch every time. It has answered "what is in my cart" two hundred times, and it explores the page again on try two hundred and one.
The code around the model has its own trouble. A crash loses the task. Nobody can pause a risky command. A model swap touches six files. The model is the same on day thirty as on day one. What is missing is the harness: the code that builds the model's context, runs what it decides, stores what worked and stops what is unsafe.
| Failure 1: the goldfish | Failure 2: the fragile skeleton | |
|---|---|---|
| Symptom | re-explores tasks it already solved | crashes lose work; no pause; one provider |
| Cause | nothing carries a good route to the next run | state spread over processes and objects |
| Paper | Agent Workflow Memory (AWM) | OpenHands Software Agent SDK |
| Chapters | 1 to 5 | 6 to 8 |
One task type recurs. Exploring costs 12 steps; following a known route costs 6. Drag the count and toggle memory.
Toy numbers we chose: 12 steps to explore, 6 to follow. The paper's measured steps come in Chapter 5.
With made-up numbers: 40 runs at 12 steps cost 40 × 12 = 480 steps. With memory, the first run explores and 39 follow: 12 + 39 × 6 = 246 steps. Memory saves 234 steps, and each step is one model call.
Failure. Success rate stays flat across weeks of the same traffic. Measure: steps per solved task, grouped by task type and by date. Fix: give the agent a place to write down routes (Chapters 1 to 5), inside a harness that keeps them safe (Chapters 6 to 8).
Chapter 1
Turn several successful runs into one short recipe with named slots
A raw transcript of a good run is a poor memory. It holds "dry cat food" and "Berkeley", so it fits only that one task. AWM stores a recipe instead.
Name the parts first. A workflow has a short text description, call it d, of what it does. It also has a list of steps, call it P. Each step pi holds three things: a plain description of the page, the agent's reasoning, and one action, such as a click.
w equals the pair d and P, where P is the list p-one, p-two, up to p-n.
Write one sentence d that says what the recipe is for. Under it, list the steps p-1 to p-n in order. That pair is the workflow w.
The paper's Maps workflow below: d is "Calculate Travel Time and Distance", and P has n = 5 steps: two fills, one select, one click and one message.
Look at what stays and what varies. The element ids 158, 163, 166, 171 stay literal: they belong to the page. The capital names are slots: the agent fills them for each task. The reasoning lines (not shown) tell the inducing model which steps are general and which were one-off choices.
Three successful toy runs on a shop. Press Next to line them up, drop the one-off step, and turn the typed text into a slot.
Toy runs we wrote. The paper's own prompt asks the model to find "the repetitive subset of actions across multiple tasks" and to name the non-fixed elements with variables (Appendix A.1).
With made-up numbers: runs A and B have 5 steps, run C has 6. Four steps appear in all three, in order. C's extra click on the reviews tab appears once, so it goes. The typed text differs every time, so it becomes {PRODUCT_NAME}. Result: 5 steps, 1 slot.
Failure. The site moves its search box, and the workflow points at a dead id. Measure: the success rate of each workflow each time it is used. Fix: drop or re-induce workflows whose success falls. The paper does not prescribe this check; it is our suggestion.
Chapter 2
Add workflows to the prompt as text, and pay for every token
AWM has one learning step, induction: a function I reads past runs and writes workflows. The default version prompts a language model with several runs at once. A cheaper rule-based version groups runs by their action sequence and drops steps that cannot run.
Where do the workflows go? Not into the weights. Call the model L, the task instruction q, the agent's base memory M (the list of actions it can take), the workflows W, and the page it sees now o.
L of q, M plus W, and o gives a.
Paste the workflows W after the base memory M. Give the model L that prompt, the task q and the page o. It writes the next action a. The plus sign means "append text".
The paper's Table 10 reports about 7.4 workflows in memory on WebArena. So one call carries M, about 7 recipes, q and o, and returns one action.
pythonprompt = (base_memory # M: the action docs + "\n# Workflows that worked before:\n" + "\n\n".join(w.text for w in site_workflows)) # W, scoped to this site action = llm(prompt, task, observation) # L(q, M + W, o) -> a
Text has a price: every workflow rides along on every call. Call the base prompt B tokens, the number of workflows n, and the tokens per workflow c.
T equals B plus n times c.
Start from the base prompt B. Add c tokens for each of the n workflows. The total T is gone from the window before the task even starts.
With made-up numbers: B = 600, c = 55. One site's 7 workflows: T = 600 + 7 × 55 = 985 tokens, 24% of a 4,096 window. Pool five sites, 37 workflows: T = 2,635, 64% of the window.
Each block is one workflow. Scope memory to the task's website, or pool every site's workflows, and watch the room left for the task.
B = 600, the 4,096 window and the token sizes are made up. The paper runs AWM per website, "grouping examples by their associated websites" (Section 3), and reports 7.4 workflows on WebArena (Table 10).
Failure. Answers get worse as the library grows. Measure: prompt tokens per call, and success with and without each block. Fix: scope by website, or retrieve the few nearest workflows. The paper's own ablation agrees: adding filtered HTML on top of plain-text page states dropped step success from 34.6% to 32.9% (Table 8).
Chapter 3
Grow memory one judged success at a time, while the tests run
WebArena has no training set. So the paper runs AWM online: the agent answers test queries in order and learns from its own runs as it goes. No human labels are needed.
Name the parts. The memory before query t is Mt. The run on query t is the experience et. A judge Leval says 1 if the run solved the task and 0 if not. I is the induction step from Chapter 2.
M sub t plus one equals M-t plus I of e-t if L-eval of e-t equals one; otherwise it stays M-t.
Run query t with memory M-t. Ask the judge L-eval about run e-t. If it says success, induce workflows from e-t and append them; if not, keep M-t. Move to the next query.
With made-up numbers: queries 1 and 2 are "find a place"; memory starts empty. Query 1 explores and the judge says 1, so M-2 holds one workflow. Query 2 uses it. Query 1 itself got no help.
Thirty queries of three task types. Each judged success adds a workflow for its type. Raise the judge's error rate: a failed run that it accepts adds a bad workflow (red), which lowers later success.
Toy stream: base success 25%, each good workflow adds 15 points (cap 75%), each bad one takes 10 away. Same random draws at every error rate. The paper's real curve (Figure 5, WebArena Maps) rises fast over the first 40 queries; Figure 1 shows the gap over a plain agent reaching 22.5 points.
The paper's measured shape: on WebArena's Maps split, success climbs fast over about the first 40 queries, then levels off. Workflows also stack. An early "find a place by its name" becomes the first steps of a later "get the zip code of a place" (Figure 6).
Failure. The judge accepts a lucky or wrong run, and memory stores bad advice. Measure: hand-check a sample of accepted runs, and track each workflow's later success. Fix: a stricter judge, or promote a workflow only after it works twice. The second fix is ours, not the paper's.
Chapter 4
Compare a fixed library with a growing one as the test drifts from training
Mind2Web does have a training set. So AWM can also run offline: induce workflows once from the training runs, then use the same fixed library for every test query.
| Offline | Online | |
|---|---|---|
| Learns from | training runs, before testing | its own test runs, judged by a model |
| Memory during testing | fixed | grows after each judged success |
| Strength | clean, human-checked examples | matches the test distribution |
| Weakness | blind to task types it never saw | can store wrong runs; no help on first sight |
Mind2Web tests three levels of drift. Cross-task: new tasks on websites the training set covers. Cross-website: new websites in a known domain. Cross-domain: websites from domains the training set never touched.
Pick a split. Bars are step success rate with gpt-4. Toggle the mix of both libraries to see what happens when you combine them.
The paper's numbers: Table 4 (MindAct, offline, online) and Table 11 (offline + online), Mind2Web, gpt-4, step success rate in %.
Read the online minus offline column. Cross-task: 43.6 − 45.1 = −1.5. Cross-website: 33.9 − 33.7 = +0.2. Cross-domain: 35.5 − 32.6 = +2.9. The wider the drift, the more online gains. Both still beat MindAct everywhere, by 14.0 to 16.9 points at cross-domain.
Failure. You feed the agent both libraries and expect the best of each. The paper tried it: offline plus online scored between the two on every split, for example 44.5 at cross-task (Table 11). The authors write that the offline workflows seem to hurt the online ones. Measure: run each library alone on a held-out slice. Fix: pick one per deployment, by how far the traffic drifts from your training data.
Chapter 5
Recompute the headline numbers and find out which baseline they use
The abstract says AWM improves WebArena success by "51.1% relative". Relative to what? A relative gain needs two numbers. Call the new method's score a and the baseline's score b.
The gain equals a minus b, divided by b.
Subtract the baseline b from the new score a. Divide that difference by b. A small b makes the same difference look large.
From Table 1: AWM a = 35.5, BrowserGym b = 23.5. Gain = (35.5 − 23.5) / 23.5 = 12.0 / 23.5 = 0.511, the abstract's 51.1%. Against SteP, b = 33.0: gain = 2.5 / 33.0 = 7.6%.
Same AWM score every time: 35.5%. Choose which row it is compared with.
AWM Table 1, WebArena, gpt-4, total success rate in %. SteP uses 14 workflows written by human experts for WebArena. The paper's introduction says 7.9% over SteP; its results section and the table give 7.6%.
SteP is the telling row. It uses the same idea, workflow-shaped guidance, but experts wrote its 14 recipes for WebArena. AWM writes its own and still edges ahead. On a subset with one task per template, AWM scores 33.2 against SteP's 32.1 (Table 2), so it is not only memorizing templates.
Mind2Web reports two success rates for the same run. Step success scores each step alone. Task success needs every step right. If each step succeeds with chance s on its own, a task of k steps succeeds with chance s to the power k.
Task S-R is about s to the k.
Treat each step as a coin with chance s. A task needs k heads in a row, so multiply s by itself k times. The result falls fast as k grows.
AWM with gpt-4 on Mind2Web: s = 0.451, task SR = 0.048 (Table 3). Solve 0.451 to the k = 0.048: k = ln 0.048 / ln 0.451 = 3.8. About four independent steps explain the whole gap.
Steps are not truly independent, so 3.8 is a scale, not a count. The small task rate still moved: 0.8% to 2.8% with gpt-3.5 (3.5 times) and 2.0% to 4.8% with gpt-4 (2.4 times). One metric went the other way: AWM's action F1 is 57.3 against MindAct's 60.6. The authors suggest workflows sometimes pull the agent along a step the page does not need.
Failure. You cite "51% better" against a weak or unnamed baseline. Measure: find the two cells and divide yourself. Fix: always state a, b and which row b is.
Chapter 6
Freeze every piece of configuration and keep exactly one mutable record
AWM assumed a well-behaved loop to paste memory into. OpenHands V0, a popular open-source coding agent, did not have one. Every tool call ran in a mandatory Docker sandbox, a second process whose state could drift from the agent's. Configuration grew to 140+ fields, 15 classes and 2.8K lines of code, patched in place by each entry point.
V1, the Software Agent SDK, rests on one rule: stateless by default, one source of truth for state. The agent, its tools and its model settings are immutable objects, checked once when built. The only thing that changes is the ConversationState: some metadata plus an append-only log of events.
| Package | Job |
|---|---|
| openhands.sdk | Agent, Conversation, LLM, Tool, MCP, the event system |
| openhands.tools | concrete tools: bash, file edit, browser |
| openhands.workspace | where code runs: local, Docker, remote API |
| openhands.agent_server | REST and WebSocket server for remote runs |
pythonfrom openhands.sdk import LLM, Conversation from openhands.tools.preset.default import get_default_agent llm = LLM(model="openhands/claude-sonnet-4-5-20250929", api_key="...") # frozen config agent = get_default_agent(llm=llm) # frozen spec: model, tools, policy conversation = Conversation(agent=agent, workspace="/path/to/project") # new state, empty log conversation.send_message("Write 3 facts about this project into FACTS.txt.") # appends 1 event conversation.run() # the loop runs here
That is the paper's own minimal example (Figure 2). Because the agent holds no state, one agent can serve many conversations at once. There is nothing shared for them to fight over.
The agent spec sits on the left. Spawn conversations, pick one, and add events to its log. Watch which boxes change.
Illustrative. The design is the paper's (Sections 3.2, 4.2 and 4.5); the event counts are yours.
Did it work? V0 and V1 served users side by side for 15 days. The paper counted only system-attributable errors, those caused by the harness itself, not by the model provider.
| Errors per 1,000 conversations | V0 | V1 |
|---|---|---|
| Infrastructure | 69.8 | 0.0 |
| SDK internal | none existed | 29.7 |
| Total system-attributable | 78.0 | 30.0 |
Use Chapter 5's formula with a = 30.0 and b = 78.0: (30.0 − 78.0) / 78.0 = −0.615, a 61% cut. V0's errors were mostly cross-process: authentication failures (43.0), a runtime not yet ready (18.8) and network timeouts (3.1). V1 runs the agent and tools in one process by default, so those paths are gone. Most of V1's 29.7 came from one condensation bug, since fixed.
Failure. Two conversations share one agent object that also holds history, and one corrupts the other. Measure: run two conversations at once and diff their logs. Fix: keep configuration frozen and history in a per-conversation state.
Chapter 7
Record a decision and its result as two events, so a crash leaves a clear gap
Every tool follows one contract. The Action is the tool call's input, checked against a typed schema before any code runs. The Execution is the code that does the work. The Observation is the structured result the model reads next. MCP tools enter the same contract: their JSON schemas become Action types.
Each step lands on the log as typed events. Some can become chat messages; the paper calls them LLM-convertible. Others are bookkeeping the model never sees.
| Visible to the model | Internal only |
|---|---|
| SystemPromptEvent, MessageEvent | ConversationStateUpdateEvent |
| ActionEvent (a tool call) | CondensationRequest, Condensation |
| ObservationEvent, UserRejectObservation, AgentErrorEvent | PauseEvent |
| CondensationSummaryEvent |
Step the agent through running pytest. Press Crash between the Action and the Observation, then Resume. The log only ever grows.
The event names are the paper's (Table 1); the command and its output are made up. Recovery follows Section 4.2: load base_state.json, replay events, find an action with no observation.
Why two events, not one? The ActionEvent records a decision. The ObservationEvent records what happened. If the process dies between them, the log shows an action with no result. On resume the SDK finds that unmatched action and continues from it. A plain chat list would show one ambiguous line.
Persistence follows the same split. Metadata goes to one small file, base_state.json. Each event is its own JSON file, so a step writes only new files. Is that overhead worth worrying about? Call the time to save one step's events tsave and the time of one model call tLLM.
The overhead equals t-save divided by t-L-L-M.
Measure how long saving one step takes. Divide by how long the model call in that step takes. A tiny fraction means the log costs nothing you would notice.
From Table 3: t-save = 0.40 ms (median). With a fast 1-second call, overhead = 0.40 / 1,000 = 0.04%. With the P95 save, 0.56 ms, and a 30-second call: 0.0019%.
| Measured on 433 SWE-bench Verified conversations (39,870 events) | Median | P95 | Longest (358 events) |
|---|---|---|---|
| Save one Action + Observation | 0.40 ms | 0.56 ms | |
| Crash recovery (replay + scan) | 7.4 ms | 14.9 ms | 32.1 ms |
| Storage per conversation | 380 KB | 1.4 MB | 3.4 MB |
One honest wrinkle: the paper's text says crash recovery takes "under 20 ms even for the longest" conversation, but its Table 3 gives 32.1 ms for that conversation. Full replay alone is 18.9 ms there. Either way it is tiny next to one model call.
Failure. A crash leaves you unsure whether a command ran. Measure: scan the log for an action with no observation. Fix: append-only typed events, with decision and result kept apart.
Chapter 8
Build sub-agents, long contexts and safety from the same small parts
Delegation is just a tool. Its Action says "run this sub-task". Its Execution runs an independent sub-conversation with the parent's model and workspace. Its Observation is the sub-agent's final answer. The core needed no change. Today it is blocking and parallel: the parent waits until every sub-agent finishes.
Delegation also protects the parent's context. With made-up numbers: three modules, each 40 events of 300 tokens, cost 3 × 40 × 300 = 36,000 tokens in one conversation. Sent to three sub-agents that each return a 500-token summary, the parent grows by 1,500 tokens, 24 times less.
A long conversation still fills its window. The condenser drops a batch of old events and appends a CondensationEvent that holds a summary. The full events stay on disk. The paper reports up to a 2× cost cut with no loss, from the team's own blog post.
Where does code run? A Workspace is a constructor argument. A local one runs on your machine. A Docker or remote one runs in a container behind the agent server. The paper's Figure 5 moves an agent from local to Docker by adding one import and one with block.
What stops a bad command? Two parts, kept apart. A SecurityAnalyzer rates each action LOW, MEDIUM, HIGH or UNKNOWN. A ConfirmationPolicy decides, from that rating, whether a human must approve. The built-in ConfirmRisky policy blocks actions above its threshold, HIGH by default. A blocked action sets the state to WAITING_FOR_CONFIRMATION.
Pick a command the agent proposes, then set the policy threshold. The analyzer rates; the policy decides.
The ratings shown are our guesses at what an analyzer might say. The four levels, the split and the HIGH default are the paper's (Section 4.9).
Secrets get the same care. The SecretRegistry gives a credential to a tool only when it runs, and replaces any copy in the output with <secret-hidden>. A secret can be a function, so a short-lived token refreshes without a restart.
Failure. The analyzer is itself a language model. The paper says it "cannot guarantee complete safety": adversarial prompts and inconsistent ratings get through. Measure: replay risky commands and count how many are rated HIGH. Fix: add a sandboxed Workspace, so a miss has a small blast radius.
Chapter 9
Run a coding agent with workflow memory and a security gate, and see what each one buys
Picture a coding agent on the OpenHands SDK with AWM-style memory pasted into its instructions. A stream of tasks arrives in four types: fix a test, add an endpoint, refactor, update docs. Some steps are risky. Two switches, two separate claims.
Toggle memory and security, then press Play. When a step is flagged, press Approve.
Toy model, not either paper: success = 35% + 12 points per stored workflow (at most 80%); steps = 6 minus one per workflow (at least 3); one step in four is risky. Same random draws for every switch setting.
Try four runs. Memory off, gate off: the goldfish, flat success. Memory on: each type's later tasks take fewer steps and succeed more. Gate on: pauses, no change in success. Both on: an agent that improves at what it repeats, and still asks before a risky step.
With the toy numbers: a type with 3 stored workflows succeeds with 35 + 3 × 12 = 71% in 6 − 3 = 3 steps. A new type: 35% in 6 steps. Twice the success in half the steps.
Failure. A running rate after 4 tasks swings hard: one, then a half, then two thirds, then three quarters. Measure: report how many tasks a rate rests on. Fix: wait for more tasks, or show an interval.
Chapter 10
Keep the numbers, the checklist and the code that joins the two papers
Both papers make one move at two layers. AWM leaves the model frozen and writes what it learns into a small, growing text memory. OpenHands leaves every configuration frozen and writes what happens into one growing event log. Freeze what defines the system; keep one owned record of what it learned or did.
| Term | Meaning | Number to remember |
|---|---|---|
| Workflow | description d plus steps P, with slots | about 7.4 per website on WebArena |
| Utility rate | share of test tasks that use a workflow | 0.94 WebArena, 0.91 Mind2Web |
| WebArena success | tasks fully done, gpt-4 | 35.5% vs 23.5% (BrowserGym), 33.0% (SteP) |
| Steps | average steps per task | 5.9 vs 7.9 and 46.7 |
| Mind2Web step success | steps right, gpt-4, cross-task | 45.1% vs 36.2% (+24.6%) |
| Online vs offline | step success difference | −1.5, +0.2, +2.9 as drift grows |
| Rule vs LM induction | step success on Mind2Web | 43.4% vs 45.1% |
| System failures | per 1,000 conversations, 15 days | 78.0 (V0) to 30.0 (V1), −61% |
| Event log cost | save one step / recover a crash | 0.40 ms / 7.4 ms median |
| Same model, new harness | SWE-bench Verified, V0 to V1 | Sonnet 4: 68.0 to 68.0; Sonnet 4.5: 64.6 to 72.8 |
python# the seam between the two papers: a finished conversation in, a workflow out def on_conversation_end(state, judge, library): if judge(state.events) == 1: # L_eval, Chapter 3 steps = [e for e in state.events if isinstance(e, (ActionEvent, ObservationEvent))] # typed log = trajectory library.append(induce([steps])) # I(e), Chapter 2 def make_agent(llm, site, library): recipes = [w for w in library if w.site == site] # scope, Chapter 2 return Agent(llm=llm, tools=TOOLS, agent_context=AgentContext(system_message_suffix=render(recipes))) # frozen spec
Sketch only: it shows the seam, not the SDK's exact argument names. AWM needs a successful trajectory; OpenHands' log already is one, in typed events.
AWM's workflow actions are rigid: a pre-set booking sequence cannot see the airport pop-up that appears midway (Figure 7), and agents called workflow actions in only 18.5% of tasks. OpenHands focuses on single-agent conversations, cannot guarantee safety with a model-based analyzer, and leaves a full multi-tenant security audit to future work.
Credit: Session 7 of Georgia Tech CS 8803, LLM seminar. Papers: Agent Workflow Memory (Wang, Mao, Fried and Neubig, arXiv 2409.07429) and The OpenHands Software Agent SDK (Wang, Rosenberg, Michelini, Smith, Tran, Nyst, Malhotra, Zhou, Chen, Brennan and Neubig, MLSys 2026, arXiv 2511.03690 v2). The toy streams and all made-up numbers are ours.
Teach it back: open Present or Teach and explain induction, the online loop and the unmatched action to a friend. Then go back to the hero, switch on memory and V1, and predict both read-outs before you press Play.