Writing
Notes from the middle layer.
Essays on AI agents, the engineering around them, and the design choices that make software feel calm.
Binding every tool on every turn wasted a third of our input budget. Here is the index-based design we replaced it with, why we rejected the search-based version, and what an index entry has to contain.
EngineeringProgressive disclosure cut our input tokens by a third. It also quietly stopped the model from reaching a tool it needed — and the failure looked like a good answer, not an error.
EngineeringPersona prompts govern what the model generates. But most of what a user reads never passes through the model — and nothing owned it. Six layers, what each one buys, and the failure direction that decides where each belongs.
EngineeringFive models, one persona, one script. The prompt made every model competent on the easy turns. What separated them was three edge moments — and one of the gaps turned out to be the gateway, not the model.
EngineeringLoop engineering was coined in June, graph engineering in July, and the obituary landed six weeks after the birth. Both labels name real work — the funeral is a category error.
EngineeringA build order for a general-purpose agent in 2026: the one layer worth writing yourself, the layers to standardize on, and the sequence that keeps you from building your harness twice.
EngineeringTencent's desktop agent workbench, reconstructed from engineering retrospectives: full autonomy on the path, zero trust at the verdict, and a gate on every side effect.
EngineeringThe first digital employee is a project. The second is a pricing decision — extract the harness into a platform, or pay the 0-to-1 cost on every agent forever.
EngineeringA sequel to the day my agent lied — you can't prompt a model into honesty, but you can bolt an evidence check onto the loop and make the lie impossible to ship.
EngineeringI cloned a shipping coding agent and read it the way I read a paper — to see which design decisions survive contact with production. Here are the ones worth stealing.
EngineeringWhen an agent misses a case, the reflex is to teach it that case in the system prompt. That's whack-a-mole. The fix is structural.
EngineeringLoop engineering took off in coding because coding ships with a free oracle. Everywhere else, you have to build one.
EngineeringA daily digest agent reported "all sources fetched" — while quietly dropping one. The bug wasn't the fetch. It was the missing guardrail.
EngineeringThe thing worth getting right keeps moving up a level — prompt, context, harness, loop. The hard part was never the while-loop.
EngineeringStop adding a tool for every request. Autonomy is a stack of composition types with two layers of glue, not a single trick.
EngineeringI migrated a production agent onto a server runtime, ran the whole playbook, then rolled it all back. Sometimes the senior move is not adopting the thing.
EngineeringStandard tool-calling can't express composition. So stop picking tools — let the model write the code that calls them.
EngineeringReliable agent UX isn't about preventing errors — it's about making the wrong answer cheap to notice and undo.
DesignEveryone treats agent memory as one framework, and compares the options as if they're rivals. They answer different questions — here's the map.
EngineeringVector RAG, RAGFlow, GraphRAG, PageIndex, an LLM wiki, Obsidian — they get lumped together as rivals. They aren't even at the same layer. A field guide to which one fits which job.
EngineeringI scored two agent frameworks across eleven dimensions. Strip the weights and they tie. The gap was never about quality — it was about who I am.
EngineeringEveryone is racing to build a smarter index. The labs that build the models quietly went the other way — toward plain text the agent reads and tidies itself.
EssayA bigger context window buys you a better goldfish. Persistence is a different problem — and most of the work happens between the prompts.
EssayEvery retry feels free in isolation. Stacked across a session, they are where latency, cost, and confusion quietly accumulate.
Engineering