This week’s engineering thread was agents quietly wasting work they already did. A router sends calls to a 15x cheaper model and the bill doesn’t move. A cache exists, but the request lands on the replica that doesn’t hold it. A memory system retrieves the right rule and the model ignores it. Most of the deep dives below are about finding that leak. On the news side it was a loud week: Nvidia’s CEO resigned and came back, AI stocks nearly entered a bear market, and an Anthropic mathematician posted a Lean-checked proof of the Riemann hypothesis. As always, these are my notes from the newsletters I follow, not original research.
Deep dives
1. Why your router’s savings disappear: model affinity
Source: Daily Dose of DS
The interview question: you add a router that sends easy calls to a 15x cheaper model, the router works as intended, and the bill is unchanged. Where did the savings go?
The answer is prompt caching. An agent task is never one call. It’s planning, tool use and analysis in sequence, and each call re-sends the accumulated context, so input grows every step. Providers discount already-seen input by roughly 90%, but the cache is specific to a model. Switch models mid-task and the warm cache is thrown away, and the whole context is billed at cold rates. A cache-hot expensive model can cost less than a cache-cold cheap one.
The production fix is to decide once per task, not once per call. The newsletter lays out a four-stage routing layer:
- Guardrail filter. Safety check first; every call is logged and traced from here.
- Router model. A small model infers the domain and action of the request and matches it to candidates. It has to be tiny, since a routing decision that costs as much as the call saves nothing. The example uses Arch-Router, a 1.5B model trained on human preference data.
- Selection policy. A cost or latency policy picks the winner from a pricing catalog, and keeps the runner-up as the fallback.
- Model affinity. The winner is pinned to the session ID. Later calls in the task go to the same model, and the pin resets when the task changes.
The savings don’t vanish, they move up a level: each new task is still routed by difficulty. The open-source proxy Plano implements all four stages from one YAML config, so agent code doesn’t change.
My takeaway: if you measure routing savings per call, you’ll overestimate them. Measure per task, including cached vs. uncached input tokens, before trusting the dashboard.
2. LMCache: pull KV cache management out of the inference engine
Source: Daily Dose of DS
Stanford researchers found that about 62% of what an agent sends on each call is repeated content: system prompts, tool definitions, documents. Per-token prices fell about 80% between 2023 and 2026, but agentic workflows use 5–30x more tokens per task, so volume outran the price cuts. The newsletter cites Uber burning its 2026 AI budget in four months after a Claude Code rollout, and a Gartner forecast that 40% of agent projects get cancelled by 2027 on cost alone. The framing I liked: making tokens cheaper doesn’t help if most of them shouldn’t exist.
Prefix caching helps, but only when the cached part is an exact prefix. It breaks in three common cases:
- Multi-document RAG: each document’s KV state was computed without the other, so combining them invalidates it.
- Document order changes: every permutation is a miss.
- Growing conversation history: everything after the stable prefix changes each turn.
Alibaba Cloud’s production numbers: 10% of KV blocks serve 77% of hits.
The second problem is that cache code runs inside the engine process, competing with inference for resources. Google’s TurboQuant (3-bit KV cache compression) causes a 20%+ slowdown when run in-engine.
LMCache (open source, 10k+ stars) runs as a separate process. The engine passes block IDs over shared GPU memory, and LMCache does the heavy tensor movement across GPU, CPU RAM, SSD and remote storage. Benefits: no contention, zero-copy sharing across GPUs, and parallel loading from all tiers instead of checking them in sequence. Reported on H200s with Qwen3-235B and 50 concurrent users: 14x faster time to first token, 4x faster decoding, and startup down from 3+ minutes to about 30 seconds. It integrates with vLLM, SGLang and TensorRT-LLM, on NVIDIA and AMD.
For the multi-document case there’s CacheBlend (EuroSys 2025 best paper). Most tokens attend mainly to their own local context, so it finds the few tokens with strong cross-document links, recomputes only those, and reuses the rest.
My takeaway: the rule “stable instructions and tool definitions first, changing content last” is free and I should apply it before reaching for new infrastructure. LMCache is the thing to evaluate if my workloads are RAG-heavy with shuffled documents.
3. KV cache-aware load balancing
Source: Daily Dose of DS
A companion piece: the least busy replica isn’t always the fastest. If Replica A already holds three blocks of a shared prefix and Replica B holds none, a request with those three blocks plus one new one is far cheaper on A. A load balancer that only counts requests can’t see that.
How a KV-aware router works:
- It estimates, per worker, how much of the prompt can be reused and how much work is already queued.
- Block hashes identify matching prefixes, and each hash includes the preceding context, because a block’s KV state depends on the tokens before it. Change A to X in an A-B-C prefix and B and C no longer match, even with identical text.
- Workers report cache additions and evictions so the router’s index stays current. Some implementations use an approximate view instead; the original SGLang v0.4 router did.
- Always choosing the largest match overloads a popular replica. The router has to weigh prefill work saved against added queue time. The newsletter’s illustrative scores: Replica 1 (one block left, load cost 6) scores 7, Replica 2 (four blocks, load cost 4) scores 8, and Replica 3 (prefix cached, load cost 14) scores 15. Replica 1 wins despite carrying more load than Replica 2. These scores aren’t milliseconds; production routers use their own cost models, and NVIDIA Dynamo documents its approach.
This ties directly to the previous two: prompt layout, model pinning and replica choice are all the same question, which is whether the request lands where the cached state already is.
4. Minimal RAG matches heavy agent memory, and the real bug is presentation
Source: AlphaSignal (Sunday deep dive by Ben Dickson)
A UChicago and UC Berkeley study built BRIDGE, “RAG in a trenchcoat”: no graph database, no contradiction engine, no reflection loops. It has three parts:
- Chained observation notes: history chunked at natural boundaries or a 2,000-token cap, summarized into XML notes, with the extractor seeing the 10 prior notes.
- Hybrid search: vector search plus BM25 over notes and raw text.
- Two-tier chronological rendering: top 10 blocks, the top three as raw text, the other seven as summaries, re-sorted chronologically.
It matches complex frameworks on LongMemEval-S, BEAM and EverMemBench while using 17–154x fewer tokens than feeding in the full history.
The more useful finding is about evaluation. Standard benchmarks ask trivia about past sessions; they don’t test whether the agent changes its behavior. The authors built five adversarial probes: rule application (every public endpoint needs rate limiting), rule ban (no eval()), style induction ({code, message} errors), procedure induction (repeat the outage runbook), and dynamic multi-turn. No framework won them all. LangMem led on rules and multi-turn; BRIDGE was better at patterns.
The key result: BRIDGE failed rule application even though retrieval found the block containing the rule every time. The model just ignored it. Adding one LLM pass that pulls rules into a labeled header at the top of the prompt, with no change to storage or retrieval, took rule application from 52.6% to 94.7%, past LangMem (80.0%) and matching a full-history GPT-5 oracle (90.0%).
Their four rules for builders: start with minimal RAG as the baseline; match storage to facts vs. form; if the agent misses a rule, check whether it actually reached the context and how it was laid out; write domain-specific evals.
My takeaway: retrieval recall is the wrong place to look first. When an agent forgets an instruction, I’ll check the final prompt before touching the memory store.
5. Testing agents with agents
Source: Daily Dose of DS
Fixed inputs and exact outputs don’t work for agents, so the pattern is simulation: three agents, the one under test, a user simulator, and a judge that grades the exchange against criteria written in natural language. The demo uses CrewAI for a travel planner, LangWatch Scenario for the pipeline, and pytest as the runner (uv run pytest -s test_travel_agent.py). Your agent subclasses AgentAdapter and implements call(); scenario.run drives the conversation. In the example the judge failed the run because the agent never established the user’s location, a real gap that was fixed by prompting it to ask. It’s library-agnostic and open source.
My takeaway: the judge criteria are the test suite, so they deserve code review like any other tests.
6. MeMo RAG, and two smaller notes
Source: Daily Dose of DS
- Memory as a Model (MeMo), from MIT and NUS. Plain RAG treats chunks as isolated, so multi-document questions miss the linking fact when it doesn’t resemble the query. MeMo has an LLM generate question-answer pairs from the documents, including cross-document ones, and fine-tunes a small memory model on them without it ever seeing the documents. At query time the main LLM stays frozen, splits the question into sub-questions, asks the memory model, and answers from its short replies. It works with closed models like Gemini since they only exchange text, and beat a strong graph-RAG setup on multi-hop benchmarks. The catch: training costs compute and new data means retraining, so stable, densely linked knowledge goes in the memory model and fresh data stays in retrieval.
- Activation checkpointing. Store activations only for the first layer of each segment and recompute the rest during backprop. Memory drops to roughly the square root of the original, at about 15–25% more runtime, and the larger batch size you can then afford can offset some of that. In PyTorch it’s
checkpoint_sequential.
The week in AI news
- Riemann hypothesis, with a caveat. Levent Alpöge, a mathematician at Anthropic, posted a proof he says he built with Claude, written in Lean, and Lean’s maintainers certified it. The code runs to about 17 million lines and there is no human-readable write-up yet. Separately, Stanford’s Ravi Vakil posted a different, human-written proposed proof by Alessandro Masullo, and he later added that several people had reported problems in it. I’d treat the machine-checked part as the solid part and the explanation as still missing. (The Median)
- Nvidia whiplash. Jensen Huang resigned and was reinstated as CEO 11 days later, with the board citing input from senior US government levels. Shares rose about 31% on the Monday, adding close to $1T in a day, then lost about 10% over the next two days after S&P Global warned of a possible credit-rating cut over board independence. Nvidia also reportedly told Dell and Supermicro to stop shipping servers built with its chips to four Southeast Asian countries. (The Median, The Rundown, The AI Report, AI Secret)
- Markets. The Nasdaq fell 5.3% last Friday, about 18% below its October 6 record, then recovered part of it. Anthropic closed Tuesday at $81.91, below its $83 IPO price and about 27% under its first trade of $111.50. (The Median)
- Open models. Z.ai released GLM-5.4 to subscribers; it claims parity with models of 2–3T parameters by re-running part of itself per token, but only a small test version has published results and the API and open weights have no date. Thinking Machines published Inkling 2 Mini, which runs on a 32 GB Mac and scores 20 on the Artificial Analysis index, level with Qwen3.8 27B. (The Median)
- Qwen3.5-9B on a laptop. LM Studio packaged it for Apple Silicon at about 6 GB (4-bit), though you want 16 GB RAM to use it comfortably. It scores 81.7 on GPQA Diamond against gpt-oss-120b’s 71.5, with a 262k context, multimodal input and Apache 2.0. Run it through mlx-lm for an OpenAI-compatible local endpoint;
enable_thinking=Falsegives shorter, faster answers for classification. GGUF build for Windows and Linux. (AlphaSignal) - More efficiency. Tencent open-sourced DFly2 (4.2x on long-context inference by reusing the big model’s own memory), Harvard’s “model carving” cuts inference cost 34% during pretraining, and llm.asm runs Qwen3 35% faster than llama.cpp in pure assembly. (AlphaSignal)
- Claude artifacts become desktop apps. Anthropic added a one-click, beta route from Claude Artifacts to Mac or PC apps. (AlphaSignal, Superhuman, The AI Report)
- Claude Ship. Reviews, fixes and approves pull requests; AlphaSignal also covered Shirudo patching Linux live. (AlphaSignal, AI Inner Circle)
- Character.AI data sale. 42 state attorneys general moved to block the December 1 bankruptcy auction of chat histories from more than 21 million US accounts, including 2.1 million registered to minors. The point for anyone buying AI vendors: privacy commitments may not survive a bankruptcy, so check contracts for data-handling clauses. New York also banned AI chatbot toys for five years, after California. (The Median, The AI Report)
- Agents in production. Dell reportedly runs 100,000 agents a day, Schroders cut builds to four weeks, and Target’s agent doubled conversions. Vendor-reported numbers, so I’d read them as direction, not benchmarks. (MyClaw)
- Smaller items. SpaceX was cleared to put AI in orbit; Gemini 4 Neon got a weekend how-to; Treasury’s CIO reportedly built a game mid-hack; Karpathy’s “digital America” project made the rounds. (The AI Report, Superhuman Code, AI Secret)
Tools & reads worth a look
- LMCache. Open-source KV cache layer for vLLM, SGLang and TensorRT-LLM. Worth reading CacheBlend alongside it.
- Plano. Open-source local proxy implementing the four-stage routing layer with model affinity, configured in YAML.
- LangWatch Scenario. Library-agnostic framework for simulation-based agent tests with user-simulator and judge agents.
- NVIDIA Dynamo’s router docs. How a production KV-aware router combines reusable cache state with projected load.
- The BRIDGE paper (UChicago / UC Berkeley). Read the adversarial probe design even if you never use the system.
- LM Studio + Qwen3.5-9B. A cheap way to get a capable local model behind an OpenAI-compatible endpoint.
- Wiz’s Claude Code security cheat sheet. Covers prompt data leaks, hallucinated packages, overprivileged agents, secrets and CI/CD guardrails. Sponsored in AlphaSignal, but the risk list is a decent checklist.
Sources
These are my notes, not original work. This week’s issues came from Daily Dose of DS, AlphaSignal, The Median, The AI Report, The Rundown AI, AI Secret, MyClaw, Superhuman AI, Superhuman Code and AI Inner Circle. ByteByteGo sent only promotional issues this week, so there is no deep dive from them. Go read the originals, they are better than my summaries.