AI Agent Engineering
Overview
Building production AI agents is still mostly unsolved engineering. The core architecture is deceptively simple - a tool-calling loop in ~200 lines - but production reality requires context management, agent coordination, and infrastructure thatâs still being figured out. This note collects sources and patterns relevant to the Agency of Agents essay.
The Core Architecture
An HN discussion (citing Thorsten Ballâs âHow to Build an Agentâ) revealed that the fundamental agent loop is just: send prompt + tools to LLM, execute tool calls, loop with updated context. The hard part isnât the loop - itâs everything around it. Dynamic TODO lists prevent premature termination (disabling them drops performance â1-2 grade jumpsâ). Context management is routinely underestimated - one commenter noted that DIY builders often âlose the rest of the yearâ on that step alone.
Production Lessons
Armin Ronacherâs practical lessons from building agents are worth reading in full. The highlights: skip high-level SDK abstractions and target provider SDKs directly (Anthropic, OpenAI) because model differences are too significant. Manage caching explicitly rather than relying on platform magic. Use reinforcement (injecting reminders after each tool call) as the dynamic guidance mechanism. Isolate failures in subagents to avoid polluting the main context. Use a shared filesystem as the coordination layer between tools.
Parallel Agent Teams at Scale
Nicholas Carlini at Anthropic demonstrated 16 Claude instances working in parallel to build a 100,000-line C compiler that boots Linux - nearly 2,000 sessions, $20K in costs, 2 weeks of runtime. Key patterns: infinite loop harness in containers, git-based synchronization with task locks via text files, fresh container per session, specialized agent roles (code quality, performance, documentation), and no orchestration agent - emergent coordination via shared state. The most important insight: the test harness design matters more than the model. Source: github.com/anthropics/claudes-c-compiler.
Agent Orchestration
In May 2025, before agent orchestration became widely discussed, I predicted the category:
Agents of agents - with Nimble Claude, I put Claude Code in a docker container and wrote an API around it that lets you send in commands from Slack or anywhere. Because heâs in a docker container, he has a sandbox to create files and execute programs. I gave him his own access to GitHub and Heroku as well. The thought is: what if Nimble Claude had a tool that let him spin up/down other Claudes and then send them instructions? That would be a coding and infrastructure challenge, but I donât think itâs terribly difficult. Iâm not sure yet how I would position this as a product. It could just be selling access to a tool that does this or it could enable a particular workflow in a specific domain. Iâd call this an âahead of the curveâ idea. I think people are probably already working on it and weâll see hype/a big product category in the next year or so - whenever agents become trustworthy enough to let loose on entire projects and coordinate with each other. Thereâs a big safety and cyber security question in the middle of this that would be interesting to pontificate about.
â William Huster, May 2025
The Nimble Claude setup itself (March 2025) - a containerized agent with sandbox, GitHub/Heroku access, and Slack as the interface - predated and predicted the core pattern that Rampâs Inspect, Stripeâs Minions, OpenClaw, and the background-agents framework all independently converged on months later. By February 2026, the orchestration prediction has also materialized in frameworks with sessions_spawn, subagent management, and isolated sessions. The key open questions I identified - safety, cybersecurity implications, and product positioning - remain very relevant.
The Trust Gap
Orchestration tools like Conductor and claude-squad let you run parallel coding agents in isolated workspaces. But launching agents in parallel is the easy part - the hard part is trusting them. And thereâs a structural limit to parallelism:
The design â code â test loop is still fundamentally serial per feature. You can only use 100s of agents when your problem is embarrassingly parallel.
â @whusterj, February 2026
The Factory Model
The enterprises solving the trust gap are building proprietary agent infrastructure - what background-agents.com calls âthe self-driving codebase.â The pattern: isolated sandboxes, event-driven triggers, deterministic governance layers, and human review gates. Background agents âreceive a trigger, reason about the problem, write code, run tests, and open a pull requestâ autonomously, excelling at repetitive, well-defined tasks with bounded blast radius.
Rampâs Inspect (builders.ramp.com) writes ~30% of all PRs merged to their frontend and backend repos. Key insight: âOwning the tooling lets you build something significantly more powerful than an off-the-shelf tool will ever be.â Agents access the same tools engineers use (Sentry, Datadog, LaunchDarkly, GitHub, Slack), run in Modal sandboxes with 30-minute repo rebuilds, and can spawn nested child sessions for parallel research. Multiplayer-first design lets teams collaborate in a live session.
Stripeâs Minions (stripe.dev) merges 1,300+ PRs per week with zero human-written code. The âone-shotâ model goes from Slack message to CI-passing PR with no human interaction in between. Architecture: devbox sandboxes (10-second spin-up), âblueprintâ orchestration that interleaves deterministic nodes (git, linting, testing) with free-flowing agent nodes, and a âToolshedâ of ~500 MCP tools for internal context. Agents get an intentionally small subset of tools - deliberate constraint, not unlimited capability. Part 2 details the blueprint pattern and scaling lessons.
The common thread: these companies didnât adopt off-the-shelf orchestration tools. They built proprietary process definitions around their codebases - exactly the âsmaller LLMs + proprietary process definitionsâ model predicted in the Trust Gap discussion above.
Agent Threads as Literate Programming
Gustav van Rooyen argues that agent conversation threads are the modern embodiment of Knuthâs literate programming. Where Knuthâs 1984 WEB system âwoveâ documentation and âtangledâ code from the same source, agent threads capture both intent (user prompts) and implementation (agent reasoning + code) in a persistent, shareable format. Best practice emerging: one thread, one git commit - every line of code annotated with its reasoning.
Beyond LLMs: The Alberta Plan
Rich Sutton, Michael Bowling, and Patrick Pilarskiâs âThe Alberta Plan for AI Researchâ argues for an agent-centric approach to AI grounded in reinforcement learning rather than language modeling. The core premise: intelligence emerges from agents that continuously interact with a complex world, learning to predict and control their sensory input over time. The agent architecture decomposes into perception (situational state), policy (state â action), value function (state â expected reward), and transition model (enabling planning). The plan extends this with feature-based subtasks and temporally extended options - a fundamentally different path from scaling transformer architectures. If LLMs hit the complexity walls described in Verification Complexity, Suttonâs agent-first framework may point toward the architectural shift needed to break through.
Supporting Infrastructure
Telos (Daniel Miessler) provides structured templates for âDeep Contextâ - mission, goals, strategies, KPIs - that agents need to make aligned decisions. As AI becomes more capable, the bottleneck shifts from âwhat can AI do?â to âwhat should AI do in this specific context?â
Walkie enables zero-infrastructure P2P encrypted communication between agents using Hyperswarm DHT. No servers, no IP addresses - just a shared channel name and secret. Interesting primitive for multi-agent coordination, though production readiness (persistence, reliability) remains unclear.
The Inflection Point
SemiAnalysis argues Claude Code marks the âWeb 2.0 momentâ for AI: the shift from selling tokens (call-and-response) to orchestrating tokens into outcomes (agentic workflows). Claude Code accounts for 4% of GitHub public commits, projected to hit 20%+ by end of 2026. METR data shows autonomous task horizons doubling every 4-7 months. The pattern extends beyond coding: any READ-THINK-WRITE-VERIFY workflow is automatable, touching ~33% of the global workforce. Current adoption: 84% of developers use AI but only 31% use agents - the gap is where the next wave hits.