If you run a LangChain or LangGraph agent for hours, the first thing that changes around hour 6 is probably the size of its prompt. I wanted to see what that does to the bill and to the answers, so I ran one simulated 12-hour shift through five stacks and logged every model call.
I build Argentic, an engine that keeps AI agents right for hours while prompt size is bounded. It is one of the five stacks, and it did not win on score. The numbers are below, with versions and dates.
The shift is a bakery's operations desk. Over 12 simulated hours it has about 1,400 events: orders, price changes, stock counts, owner messages, standing instructions that get amended or revoked, and updates that contradict earlier ones. A fixed program with no model in the loop grades 663 questions about it. Every stack got the same seed, the same questions, the same grader and Claude Haiku 5.5, and each run had a spend cap.
I ran the JavaScript packages, on 25 November 2026. Nothing was tuned. I haven't measured the Python versions.
Haiku 5.5 bills a request at roughly five times the normal rate once its prompt passes 100K tokens. A loop that re-sends its history gets there eventually, and every call after that costs more.
Deep Agents shows it cleanly. It finished all 12 hours, and over hours 1 to 5 it spent $0.29 in total, because prompt caching is on by default and the prompt stayed under 100K. From hour 6 on it spent between $1.10 and $1.60 an hour. Its prompt grew from 5.7K tokens to 279K, and 925 of its 1,450 calls went over 100K. The whole run cost $9.46.
It never summarised anything. Deep Agents triggers summarisation at 85% of the model's context window, and the profile LangChain gives Haiku 5.5 says that window is 1M tokens, so the trigger sits at 850K. This run never reached it. If your model has a window that large, that default means your agent keeps its whole history for a very long time, and you pay for that in the tier.
The plain LangChain loop hit its $5 cap in hour 6, at $5.09. It has no score over hours 1 to 8 because it was stopped.
| Stack | Spend | Where it stopped | Score, hours 1 to 8 |
|---|---|---|---|
| Argentic 0.104.1 | $0.75 | finished 12 hours | 0.87 (four runs: 0.86 to 0.89) |
| LangChain Deep Agents 1.17.1 | $9.46 | finished 12 hours | 0.92 |
| Claude Agent SDK | $8.02 | $8 cap, hour 9 | 0.92 |
| Letta | $8.02 | $8 cap, hour 10 | 0.89 |
| LangChain 1.6.7, plain loop | $5.09 | $5 cap, hour 6 | none, stopped early |
Spend is token usage at list prices, not an invoice. Over hours 1 to 8, which is 403 questions, the Agent SDK and Deep Agents scored higher than Argentic's whole range, by about 4.6 points over its mean. Letta sits at the top edge of that range, so I can't separate it from Argentic on these hours. The rivals ran once each, so their scores carry noise I haven't measured.
So on this shift, Deep Agents kept its answers right by keeping everything in the prompt, and it cost about 12.6 times what Argentic did. Argentic cost less and scored lower. Which of those matters more depends on your agent and your budget.
Argentic was also worse on one kind of question: running counts, 0.86 against 0.96 for the Agent SDK. The misses I traced came down to one question about open support tickets. The agent only keeps a tally for counts that the task prompt names, and mine named stock levels but not tickets. When I resent those requests, one sentence in the task prompt fixed it: "Keep a running count of open tickets with tally: +1 when one opens, -1 when it is resolved and closed." That was a resend test, not a full run, and I didn't archive its outputs, so treat it as something to repeat.
You need the prompt size of every call. LangChain puts it on the response message as usage_metadata. This callback writes it to a file, one line per call:
import json
from langchain_core.callbacks import BaseCallbackHandler
class UsageLog(BaseCallbackHandler):
def __init__(self, path="usage.jsonl"):
self.path = path
def on_llm_end(self, response, **kwargs):
for generations in response.generations:
for g in generations:
u = getattr(getattr(g, "message", None), "usage_metadata", None)
if u:
with open(self.path, "a") as f:
f.write(json.dumps({"input_tokens": u["input_tokens"]}) + "\n")
Pass it with config={"callbacks": [UsageLog()]} on your agent's invoke call. Check one call by hand to confirm that input_tokens includes cached tokens for your provider. Then summarise the file with jq:
jq -s '
[.[] | .input_tokens] as $p
| { calls: ($p | length),
over_100k: ($p | map(select(. > 100000)) | length),
first_over: ((($p | map(. > 100000) | index(true)) // -1) + 1),
largest: ($p | max) }
' usage.jsonl
first_over is the call number where you first crossed 100K, and 0 means you never did. Other models price long prompts differently, so check your model's price page for a step like this before you trust any estimate.
There are three common ways to do it. You can cap how much history you send, which is simple but forgets whatever you cut. You can add a summarising step, which keeps the gist but rewrites history, and details can degrade each time it runs. I didn't measure that loss here, because Deep Agents never reached its trigger. Or you can move long-lived facts out of the transcript and look them up when the agent needs them.
Argentic takes the third route. It builds each prompt from a record of the run, under a size cap, so the prompt stays small without throwing the record away. Its largest prompt in this shift was 55K tokens, its median 37K, and none of its 1,487 calls passed 100K.
It's one seed, and the benchmark's guide asks for at least three. Only Argentic has a range, from four runs. The rivals ran once each, and three of them were stopped by spend caps before the shift ended. The rivals ran on the Anthropic API and Argentic on a local copy of the hosted engine with Haiku 5.5 through AWS Bedrock. The rivals were a few patch releases behind the newest npm versions that day.
The raw files for every run are on the page with a SHA-256 for each: the settings, the summary, every graded question, the log of every action the agent took, and every model call. https://getargentic.com/research/head-to-head/
Argentic's own engine files, meaning its prompts and internal logs, aren't published. The benchmark publishes what the shift looked like from the outside.
The benchmark, the scorer, a validator that reproduces each grade from its log, and the commands to rerun every arm are at https://github.com/open-haul/open-haul-bench (start with REPRODUCE.md). If you run it with your own setup and get different numbers, open an issue there. I'd like to see them.