Build1 distinct publisher3 min readPublished
A retail support agent was resending 55,000 tokens of raw transcript on every turn inside a 128k window. Nothing crashed, and that was the problem.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
Start with the arithmetic the dashboard did not show. At roughly $0.50 per million input tokens, 55,000 redundant tokens is about 2.75 cents of pure re-reading per turn [9]. Across a queue handling 1,200 conversations a day, that is roughly $33 a day if each conversation is a single turn [10] - and the conversation in the logs ran to 40 turns [3]. The author's reported figure of $0.27 per turn against an expected few cents [2] is consistent with that: the waste is not a line item you can find, because it is distributed evenly across every call your application makes.
The mechanism is boring, which is why it survives code review. The model is stateless between requests; whatever looks like memory is a storage-and-injection strategy the application performs [6]. So the default that requires no design work is to append. Append the user turn, append the assistant turn, send the lot. Nothing in the response tells you it was wasteful, because every token in the window is processed on every forward pass, and cost and latency rise with the window at minimum linearly [5]. A full window is the most expensive state the system can occupy [5]. There is no error code for expensive.
The tutorials' framing that a big window means you can just send everything [4] is a claim about capacity that gets read as a claim about correctness. The author's distinction is the useful one: the window is a container, and memory is what you decide to put in it [1]. That decision has a price attached, which makes it a billing decision that gets filed under architecture.
There is a second cost that does not appear on any invoice. Benchmarks show the lost-in-the-middle behaviour: models handle a needed fact well at the start or end of a long input and much worse when it is buried in the middle, and larger windows reduce but do not remove the effect [7]. So the appended transcript is not neutral padding. It is padding that pushes the relevant turn into the least reliable region of the sequence while you pay for it. The author's framing of working memory as the place where cost and forgetting collide [8] is the honest description: more history means more spend and a weaker thread, less history means lost context.
The fix in the source is not clever, and that is a point in its favour. Keep the full record of past turns in a database, Postgres or Redis, and project only a curated slice into the window when it is needed [11]. The failure mode in the retail agent was shipping that record straight into working memory uncurated [12]. Nothing about that requires a vector store, an embedding pipeline, or a memory product. It requires someone to own the question of what earns a seat in the container, and to answer it in code rather than by default.
One caveat on the numbers: this is a single engineer's account of one client system [2], with a per-token price and a daily volume that belong to that deployment [9][10]. The ratio is what travels. If your agent appends, your marginal cost per turn grows with conversation length while the answer quality does not, and the only reason you have not noticed is that the window was large enough to hide it.
Ranked by verification strength, evidence, and original report placement.
The context window is a container; memory is what you decide to put in it.
Every token in the window is processed on every forward pass; doubling context roughly doubles input cost per turn and adds latency, and a full window is the most expensive state the system can be in.
The model is stateless across calls and remembers nothing between requests; anything that appears to be memory is a storage-and-injection strategy built by the application.
Working memory is where cost and forgetting collide: including more raises cost and loses the thread, including less loses context.
The recommended approach is to keep the record of past conversations in a database such as PostgreSQL or Redis and project only a curated slice into the window when needed.
At roughly $0.50 per million input tokens on the model used, 55,000 redundant tokens per turn costs about 2.75 cents per turn.
Follow any of these and your For You feed starts watching them — no settings page required.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
One unattributed practitioner account
The general mechanics claims - statelessness across calls, linear per-token cost, the cost-versus-forgetting trade-off - are internally consistent and uncontroversial. Everything specific is single-sourced and unverifiable: the client, model, and vendor are unnamed, the $0.27 per turn and $0.50 per million token figures come only from the author's recollection of a dashboard, and the lost-in-the-middle assertion cites 'benchmarks' without naming one. No logs, code, or before/after measurements accompany the account.
Single anonymised deployment anecdote
The only real-world datapoint is one unnamed retail client's support agent described after the fact. None of the recommended patterns - Postgres/Redis episodic storage, tiered summary memory, vector-store semantic retrieval - is shown deployed, measured, or adopted by any named team, and no release, benchmark, or usage figure beyond the single queue volume is supplied.
Framing outruns the supplied numbers
The rhetoric ('does not bankrupt you', 'costing ten times what it should', burning money) is louder than the arithmetic the source itself enables: at the stated price and volume the redundant tokens amount to roughly 2.75 cents per turn, on the order of $33 a day for a single-turn queue. The underlying mechanics are sound and undramatic, which keeps the gap moderate rather than severe, but the cost narrative is presented without the scale check.
Practitioner credibility building, no disclosed vendor stake
The piece is a first-person consulting war story on a developer publishing platform, which rewards authority-signalling ('the working taxonomy I use', 'the concrete mental model I now build against') and anonymised client anecdotes that cannot be checked. No product, sponsor, or vendor is promoted in the supplied text, and the only named tools are generic infrastructure, so commercial distortion pressure appears limited.
Sound mechanics, unverifiable specifics
Confidence is moderate: the structural argument about statelessness, per-token cost, and curation is reliable enough to act on, but every quantitative particular is single-sourced and anonymised, the cluster has one publisher, and there is no corroborating benchmark or post-fix measurement to test the prescription against.
build
Three services you can delete: queue, cache and search in one Postgres1 distinct publisher
build
Four control planes, one Postgres: a team's case against polyglot persistence1 distinct publisher
build
A RAG stack lived seven hours before a hosted embedding endpoint returned 4041 distinct publisher
build
One Mutable vat_id Column Is An Audit Failure With A Delay Fuse1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 24, 2026