← All posts

Static task graphs cut routine LLM cost 10×

Summary

We demonstrate a core feature of PhinOS, the ability to replace expensive tool calling agent workflows with static task graphs to reduce LLM costs by 80-90%. We demonstrate this on a literature extraction workflow: same models, papers, and target schema, to demonstrate an up to 10x cost savings.

Introduction

Agentic workflows changed knowledge work by giving a model the ability to act. We call the prevailing agentic workflow, where the agent determines its execution graph at runtime, runtime discovery. The agent holds a set of tools, chooses which to call and in what order, and stops when it judges itself finished. Because the model has to discover what the appropriate next step is from a list of possible actions, it spends significant effort and cost on deciding the next step.

The alternative is static graphs: the task graph and control flow are written down in advance as an execution graph, and the model is invoked only at the points where judgment is required. Both paradigms can accomplish the same goals but they differ in how the goal is accomplished.

Besides cost, reliability differentiates runtime discovery and static graphs. A path discovered at runtime is a sample, not a specification: two executions of the same task produce different paths, which cannot be compared across runs, cannot be reviewed before execution, and never cleanly separate model judgment from mechanical operation. For routine work that can become a problem if it leads to a higher proportion of failed runs or more manual review. To date, that non-determinism has been addressed with human review and repeated attempts, both of which cost more on every run. That is a fair trade for ad-hoc work, where you describe a goal and get a result without specifying how. It is a poor one for routine work: the same task, the same shape of input and the same output contract, run over and over.

The question is which decisions can be removed from runtime discovery without losing performance.

Work moves down a ladder as judgment shrinks

This points to a core principle we have adopted in PhinOS, which is a judgement ladder as seen in Figure 1.

Four-stage ladder: human executor, ad-hoc agent, static graph, deterministic code
Figure 1: Each step down trades generality for lower cost per run and a path that can be reviewed before it runs. Literature extraction sits at the static graph today.
Figure 1: Each step down trades generality for lower cost per run and a path that can be reviewed before it runs. Literature extraction sits at the static graph today.

Humans are the most general executors. A person is able to take instructions and use their intuition and context to accomplish nearly any task. As humans create more detailed instructions and identify what capabilities are needed, the task can become specific enough for an agent to use tools to accomplish the same tasks. Run that agent on the same task enough times and the pattern it uses becomes visible. At this point it can be written down as a static graph. And a static graph whose model-invoking nodes stop needing unstructured judgment becomes traditional code.

Each rung sheds a level of judgement that it needs at the benefit of cost and determinism. In this post, we showcase the value of moving from ad-hoc agents to static graphs of narrower LLM decisions. By constraining its input and output space, we increase the performance of the model in terms of functionality and cost.

Methodology and Example Workflow

Here we demonstrate the philosophy's value with an example goal of extracting claims from scientific papers. Specifically, we are extracting quantitative and qualitative claims from a paper into a typed knowledge graph, with every claim anchored to the source block it was read from. Anchoring creates a provenance lineage for a specific citation to a region of a paper making it easy for humans and agents to verify extracted claims.

We demonstrate the workflows on papers from unrelated fields, drawing our examples here from CO₂ reduction electrocatalysis and machine learning interatomic potentials. A pipeline that extracts well from a single electrochemistry paper has told you something about that paper; one that holds across fields, on the same target schema and with no per-paper tuning, shows the generalization of the method.

We ran this as a grid — two architectures × three models (claude-haiku-4-5, claude-sonnet-5, claude-opus-5) × every paper. Every cell ran in its own sandboxed lane, including the vocabulary it proposes: a family that nothing in a run writes into does not leave that run's sandbox. Lanes share nothing.

Task Graphs

The agentic task graph is two agent nodes with tool grants, writing through graph tools, with a review loop between them. This is the ordinary shape and is now synonymous with agentic AI.

Agentic workflow: two members, Extract claims agentically and Confirm the claims landed, joined by a forward edge and a back-edge
Figure 2: The agentic graph with two members and the back-edge that carries the whole conversation every time the gate sends the extractor round again.
Figure 2: The agentic graph with two members and the back-edge that carries the whole conversation every time the gate sends the extractor round again.

The static task graph is seventeen nodes, four of which invoke a model. Extraction and review are single completions under provider-enforced output contracts. Persistence, name resolution and verdict application are deterministic functions with no model invocation at all. Branch selection is an edge condition evaluated on the review node's typed output.

The thirteen deterministic nodes represent operations that recurred from the agent tool calling: context selection, identifier resolution, persistence, branch selection, source attribution and output validation. Each one is mechanically determinable and each one had been costing a full conversation resend to decide.

Static workflow: seventeen named nodes in a single left-to-right chain, from Extract claims through Literature extract pass, Land records and Route review to Apply verdicts, with a Literature repair branch
Figure 3: The static task graph. A single forward chain, one conditional branch into repair, and four of its nodes invoking a model.
Figure 3: The static task graph. A single forward chain, one conditional branch into repair, and four of its nodes invoking a model.

Results

With both graphs defined, the comparison reduces to running them to identify cost and quality differences. Both architectures read the same papers through the same three models. The only difference between the tasks is whether the path was declared or discovered.

The three model tiers do not behave the same way, and the difference shows up before cost does. On claude-opus-5 both task graphs worked, and the difference was one of texture rather than capability — 15 claims to 12, with 11 of them nearly identical. claude-sonnet-5 showed a similar result. claude-haiku-4-5 could not build the task graph at runtime: the run proceeded, its tool calls kept failing, and it landed no claims at all. Handed the static task graph, the same model extracted valid claims.

ModelAgenticStatic
haiku-4-5failed at tool calling — no claimssucceeded
sonnet-5succeededsucceeded
opus-5succeededsucceeded

Table 1: Which combinations produced claims. Only the agentic task graph on haiku-4-5 came back empty.

Moving to cost, even though the agentic haiku run landed no claims, it still charged nearly 10× what the static task graph charged for work that succeeded. The cost roll-up, taken from metered charge records, is seen in Table 2.

ModelAgenticStaticRatio
haiku-4-5$0.948$0.09510.0×
sonnet-5$2.838$0.27410.3×
opus-5$5.920$0.9406.3×

Table 2: Cost by model and architecture. The agentic haiku run landed no claims, so its ratio sets a working extraction against a failed one.

The cost differential is wide and it holds for every model tier that worked. On sonnet-5 the same work falls from $2.838 to $0.274; on opus-5, from $5.920 to $0.940. That is not an artifact of how the two tasks were priced. It is structural to how runtime-discovery and static graphs execute.

GraphInputOutputCache readCache write
Agentic1,212238,4418,051,135769,128
Static267,09330,41900

Table 3: Token composition by architecture.

This is seen in how the cost is metered. The eight million cached-context reads against zero are the cost of tool calling. They are not paid once but on every tool call, so an extraction run that takes forty tool calls pays forty times. Declaring the path removes that term entirely.

The split in input tokens reveals a design decision in PhinOS, where the agent reads from a directory instead of having all its inputs passed in as context. This lets the agent explore efficiently rather than passing all data through context, and scale to larger documents. This is opposed to the static task graph, which is handed the entire document, which is why its input is two orders of magnitude larger.

Extraction quality

The obvious question about a 10× cost reduction is whether it costs you extraction quality. Two things matter there, and Table 4 shows both: correctness, whether what a task graph recorded matches what the paper says, and coverage, whether declaring the path in advance makes the pipeline miss what a reader would expect it to catch. On claude-opus-5 the static task graph landed 15 claims to the agent's 12, 11 of them the same across execution style, and nothing either landed was unsupported by the paper it came from. Across model tiers the static task graph's claims were as good as the agent's.

A paper's abstract is the authors' own list of what matters in it, which we used to verify the validity of the claims. Table 4 takes each claim in the abstracts and shows what each task graph recorded against it.

PaperClaim in the abstractAgentic task graphStatic task graph
CO₂"a Faradaic efficiency (FE) of 93.2% for CO is achieved at pH 7.2"93.2 % FE for CO in neutral KHCO₃93.2 % FE for CO in neutral KHCO₃
CO₂"84.3% FE for CO at pH 2.5"84.3 % FE at pH 2.584.3 % FE at pH 2.5
CO₂"The inhibited proton diffusion within the Nernst layer of a nanoreactor is responsible for suppression of competing hydrogen evolution in acid"the cavity limits proton supply, so water reduction and local alkalinity take overthe current plateau evidences a confined proton-transport limit
CO₂"CO2RR in an acidic flow electrolysis system offers enhanced current density"102 mA cm⁻² CO partial current, 60 % above the neutral system102 mA cm⁻² CO partial current
CO₂"and sustainable operation, in comparison with the conventional neutral pH system"15 h at 3.4 V with no current decaynot recorded
MLIP"doubling training and inference speed"2× training, 2× inference on water2× training, 2× inference on water
MLIP"tripling memory efficiency"3× the atoms one GPU can hold3× memory capacity
MLIP"increasing simulation stability"100 % of water simulations stable against 89 %water stability rises from 89 % to 100 %
MLIP"while not impacting accuracy or data efficiency for the most common 6Å cutoff"training accuracy essentially unchangednegligible accuracy loss
MLIP"eliminating non-conservative energy dynamics"triplet conserves energy, KNN drifts by roughly 67 meV per atom on waterradial and triplet conserve energy, KNN does not
MLIP"create a pathway to larger cutoff radii"implicit, as edge-count ratios at 8 Å400 % training speed-up at 8 Å

Table 4: Every claim in the abstracts, and what each task graph recorded against it on claude-opus-5.

Both task graphs recover nearly the whole of both abstracts, with a small gap identified for each example. The static task graph did not emit the sustained-operation result, which the agent caught as 15 hours at 3.4 V without current decay, while the agent recorded the larger-cutoff pathway only implicitly, as edge-count ratios, where the static graph landed it as a 400 % training speed-up at 8 Å. Beyond the abstract the static graph went further, recording 69.2 % retention at pH 1.0, the 17.1 mA cm⁻² CO partial current, and the control catalyst Ni5/NCS at 73.5 % — a sentence the agent read as being about the headline catalyst alone.

Every claim is anchored to the text it was extracted from, which is what makes this analysis possible and creates a provenance lineage. This allows for verifying extracted insights against the paper without rereading the whole paper and it makes the output worth more than the extraction itself. A reader (or agent) takes the summary of a paper from its claims, sees which of them bear on the question in front of them, and opens the source at the exact passage when a decision needs more detail. The graph is an index into the literature rather than a replacement for reading it.

That a cheap model can execute a declared path it could not have discovered is the practical form of the ladder: a capable model settles the task flow once, and a cheaper one runs it. Haiku on the static task graph costs $0.095 against $5.920 for opus discovering the path at runtime, 98% less for work that lands the same claims.

Discussion

The literature claim extraction is a case study of using static task graphs to reduce the cost of repetitive work. This case study result is not limited to document extraction and points toward the general principle for resolving constrained tasks in the same way. Where it does not apply is for tasks whose operation sequence depends on intermediate content in a way you cannot express as a finite set of typed branches.

PhinOS's design philosophy allows composing these by nesting agentic tasks with tool calling inside static graphs, so judgment stays where judgment is needed and the mechanical parts stop costing a conversation each. The harness allows for incorporating determinism when it can, and the model is invoked at the points where judgment is genuinely required. This principle is actually seen in Figure 2, where a second agentic task reviews and provides feedback to the agentic task.

Static task graphs work in concert with five core design elements of PhinOS.

  • Components compose. A validated experiment is itself retrievable as a primitive, so a seventeen-node graph can easily be reused or represented as fewer nodes.
  • Contracts are typed and checked at planning time. A mismatch surfaces before anything runs, not as a retry loop after it.
  • Provenance is built in. Every claim carries the block it was read from, so any result can be traced back to the passage that produced it.
  • Runs are isolated. Every lane is sandboxed, including the vocabulary it proposes, which allows for seamless testing of new ideas.
  • Human oversight. Experiments are marked agent-generated or human-reviewed, and a declared path is what makes review possible: you can read it before it runs.