Reactive Decision Kernels for Agents

How speculative decoding, early Spotify latency craft, six months of failed DiffusionGemma and local D1 prototypes, and one research session with Gemini 4 Neon led to a $0 local Reactive Decision Kernel (RDK) that outran its own benchmarks overnight.

Back in May or June, I was spending money I did not really have on RunPod, trying to post-train DiffusionGemma into a fast steering layer for agents.

Looking back, I looked like a chimpanzee trying to start a fire.

A chimpanzee holding a stick in a forest, standing in for early RunPod post-training attempts
[Placeholder: swap with a chimp-using-tools GIF/meme] Me post-training DiffusionGemma on RunPod in June, hoping something would catch.

Where the Idea Came From

The idea did not start with benchmarks. It came from two things colliding while I was trying to get better at AI.

First, I had been studying speculative decoding: let a small, fast draft model run ahead so a slower, heavier model does not have to pay full cost on every step.

Second, I kept thinking about one of my favorite product stories: early Spotify. Daniel Ek and Andreas Ehn obsessed over making streaming feel as instant as songs already sitting on your hard drive. They chased human perception timing (around 200 milliseconds) and even played with UI animation so the screen started moving before the audio finished buffering, buying extra milliseconds so playback always felt immediate. It is the same craft instinct Pontus Abrahamsson from Midday talks about today with predictive loading and prefetching in user interfaces.

I wanted to bring that obsession to agent interactions.

The goal was simple to state and hard to build: get the latency feel of a full-duplex model, with the intelligence and quality of a frontier LLM, at a fraction of the serving cost, while keeping customer data portable and model-agnostic.

So in May or June, my first bet was to use DiffusionGemma for speculative retrieval and tool selection through context engineering. Let a fast diffusion model anticipate what the agent needed before the heavy model had to answer.

It was faster than chaining a smaller transformer model.

But it was not fast enough, and it was nowhere near accurate enough to actually improve the agent downstream. Worse, I had no clue how to design clean evals for it yet. I slopmaxxed benchmarks like ProactiveVideoQA with poor labeling, burned rented GPU hours chasing noisy scores, and kept failing at both memory and live interaction.

Nothing caught.

The Shape I Had Been Trying to Brute-Force

So when TypeSafe launched Jev, I got genuinely excited. It handed me the exact shape of the primitive I had been failing to hammer out of DiffusionGemma.

System-1 decision models do one narrow thing that feels foundational for capable agents: split-second inference over messy, opaque inputs with clean, structured outputs. Instead of asking a generative model to talk its way into a routing call, you ask calibrated questions and get probabilities back fast enough to sit inside an active loop.

That was the piece I had been missing.

But Jev had two constraints for what I wanted to build: no multimodal support, and closed weights. If the whole point is keeping latency near perception speed and keeping personal context portable and model-agnostic, I needed something that could run locally on my own hardware without an API meter ticking on every frame.

So I went back to the bench and iterated locally. I wired Embedding Gemma together with open System-1 models like GLiNER Decider and D1.

That was the first time I actually saw what a local steering layer could do.

My agent recognized me on the webcam. It recognized other people I showed it to. It was even passable at picking my voice out from other people speaking in the room, or from YouTube videos of Nancy Kanwisher and Blaise Agüera y Arcas playing next to my desk while I tested it.

Charlie Day standing frantically in front of a mailroom conspiracy wall covered in red string and paper
[Placeholder: swap with your preferred duct-tape prototype meme] Explaining how the local Embedding Gemma + GLiNER Decider + D1 webcam-and-voice stack is totally not fragile.

It worked, sort of.

But it was fragile and hand-rolled. Every threshold lived in ad hoc glue code. Change the room lighting, open a second task, or let a session run for an hour, and the whole thing quietly drifted apart.

Moving Into the Garage Computer

A toy demo lies to you because you forgive it. You only learn how an agent steering layer actually fails when you depend on it for real work.

So I stopped building standalone demos and wired the idea straight into my daily driver: Zeph, my bb fork and garage computer. I use it every day for product work and as a learning tool, and I wanted it to solve the friction that actually slows me down when steering coding agents and collaborating in real time.

Living inside it every day surfaced four concrete failure modes fast:

  • Drift and inconsistent trajectories. Leave an agent running across a few turns and it forgets a constraint you gave it ten minutes ago, or wanders off the plan you thought you agreed on.
  • Walls of text across too many sessions. Running parallel agent sessions turned me into a clerk, skimming pages of inconsequential output just to find the two lines that actually needed my attention.
  • A split between prompting and live interaction. Text-based prompting and real-time voice or desktop collaboration felt like two fractured products stitched together, with output formats that never fit the moment.
  • Context rot in long-running loops. As traces piled up, the UX degraded, steering got dull, and the agent communicated worse right when the task got hardest.
The classic 'This is fine' dog sitting calmly with a coffee mug inside a burning room
[Placeholder: swap with a multi-session chaos / walls-of-text meme] Reading four parallel coding-agent logs after context rot sets in.

I knew the problems cold now. I had written up the architecture sketches (Your Agent Needs a Thalamus) and named the steering layer Myelin.

Still, when you spend months mostly alone tinkering on an idea that keeps breaking, there are stretches where you genuinely wonder if you just have AI psychosis.

Then a funny thing happened. One day I replied to Francois Chaubard, who hosts the YC Paper Club, to tell him how much I loved an episode, and for the very first time in public I mentioned that I had been testing speculative tool use.

The very next day, Alex Zhang (one of the researchers I follow the most, from the RLM paper) published Speculative Programmatic Tool Calling.

It was a great read, and honestly a huge validation. His mechanism was different from my local steering loop, yet it pointed straight at the same intuition: stop making the user sit around while every step happens serially, and overlap speculative work with generation.

Okay. Maybe not completely crazy.

But validation is not a working system, and knowing why something hurts is still different from designing a clean architecture and proving it works without fooling yourself.

Two Hours With Gemini 4 Neon

Yesterday I tried Gemini 4 Neon because of what I kept reading about how good it is at research.

I did not ask it to invent a project from scratch. I brought it the whole messy six-month backpack: the Spotify-style latency goal, the failed DiffusionGemma runs, the RunPod slop-evals, the fragile local D1 prototypes, and the four daily friction points inside Zeph.

We spent a couple of hours going back and forth on the design and the real priors behind it. In my earlier post I had used the thalamus as a metaphor for the gating role, and Yohei Nakajima had used the hippocampus for the event-sourced memory substrate behind ActiveGraph. Both are useful biological analogies for asking product questions, yet neither is literally what runs in software.

In code, what Myelin turned into is a Reactive Decision Kernel (RDK): a tiny, embeddable SQLite state graph (borrowing ActiveGraph's append-only event log, bi-temporal facts, and zero-call counterfactual replay) wired directly to calibrated System-1 decision guards (borrowing from TypeSafe's Jev and Raymond Weitekamp's Recursive Decision Models). Where Alex Zhang's RLM puts context outside a generative model in a REPL, and RDM runs recursive decision-only calls over external state, an RDK runs that reactive decision loop continuously between turns and across harnesses (Zeph, Claude Code, Codex, Hermes, Pi) so the memory stays local and portable and the downstream LLM only sees the small slice it actually needs.

More importantly, we planned the autoresearch loop so I would not repeat my ProactiveVideoQA mistakes:

  • Run strictly on $0 local models (BGE-small on Apple Silicon MPS, MiniLM-L6, and local d1-Omni-2B) plus existing CLI evals instead of burning another GPU bill.
  • Split every benchmark cleanly into dev and an untouched sealed-test split.
  • Freeze the harness rules, tune only on dev, log every discarded hypothesis honestly, and touch sealed-test exactly once at the end.

I started the loop.

Then I went to sleep.

7:45 AM

I woke up this morning, opened the laptop, and scrolled down to the sealed-test rows of the overnight report.

Six months of starting wet fires had trained me to expect one of two outcomes: either a quiet flatline, or a shiny dev number that collapses the second it touches held-out data.

That is not what was in the log.

Across 145 logged runs and 13 commits at $0.00 in paid API spend (full tables, ablations, and architecture in Myelin: Externalized Attention and Trajectory Steering for Small Agents), every champion generalized cleanly to the untouched sealed test splits:

  • Long-horizon memory retrieval (all 238 untouched LongMemEval-S test questions): 97.0% Recall@5, 93.3% All-Evidence@5 (up 31.5 percentage points from my v1 truncated baseline), and 0.962 MRR, actually edging above dev. Even the fast no-reranker tier hit 92.4% All@5 in 16 ms p95, well inside the instant-feel latency window.
  • Role-aware context packing on sealed rubric-graded Haiku QA (60 test questions): keeping all compact user turns and only the top assistant turns matched full raw top-5 sessions identically (86.7% vs 86.7%) at 5x fewer tokens (3,168 vs 15,756), and beat full raw sessions on dev (91.7% vs 88.3%).
  • Live local d1-Omni-2B adversarial steering (16 untouched test cases): 15/16 (93.8%, +62.5 points over unsteered) with 0 false triggers.
  • Executable coding steerability (12 tasks + 6 live multi-turn traps): 12/12 (100%) at roughly 15x to 18x fewer context tokens than prompt stuffing, and 6/6 on live traps with fewer turns and zero false blocks.
  • Calibrated SideQuestions linear combiners on local 2B d1: cut Brier error by 40% to 80% across three separate domains, including subtle test-cheating code diffs where a single scalar question could not separate benign refactors from silent assertion weakening.
Drew Scanlon blinking slowly in disbelief
[Placeholder: swap with your preferred 'wait it actually worked?' reaction GIF] Reading the untouched sealed-test log at 7:45 AM.

I sat there for a few seconds staring at the terminal.

It is still not magic, and it is still not finished. One untouched sealed steering case misfired (a local TypeScript edit mentioning Stripe charges got blocked as an external side effect), and multi-session temporal recall still sits at 87%. Those bugs stay right where I can see them until the next sprint.

Still, something quietly flipped in those few seconds at the keyboard.

For six months, my whole problem was trying to build a local steering layer that could clear any benchmark I threw at it without cheating or burning money. When I closed the morning report today, my first real task was the opposite one: going back out to find harder, unsaturated benchmarks to put in front of it.

Six months of sloppy GPU runs taught me how not to trust my own numbers. One disciplined research session and a sealed split finally gave me something worth trying to break.

Source Notes