When Cursor’s engineering team had a swarm of AI agents write a working Rust database engine from nothing but the 835-page SQLite manual, they uncovered a counterintuitive fact, validated not by speculation but by hard spending: how you orchestrate agents matters more than which model you choose.
One Experiment, Four Configs, an 8× Cost Spread
The rules were austere: the swarm could read the SQLite manual and nothing else — no source, no test runs, no internet. Implementation in Rust from zero; correctness judged by SQLite’s official sqllogictest suite (millions of queries), which was held out — the agents never knew what they would be tested on. Four configurations ran:
-
All-premium: GPT-5.5 as both planner and executor → $10,565.
-
All-value: Grok 4.5 in both roles → the baseline.
-
Hybrid A: Opus 4.8 plans, Composer 2.5 executes → $1,339.
-
Hybrid B: Fable 5 plans, Composer 2.5 executes → slightly higher.
The key finding: every configuration that passed produced roughly equivalent quality — at a nearly 8× cost spread. Workers burned 69% to over 90% of all tokens, but at far lower unit prices: in the Opus-plus-Composer mix, Opus generated a small share of tokens yet about two-thirds of the cost, while Composer carried the token volume for a third. The insight underneath is plain: large tasks contain only a few stages that genuinely need frontier intelligence — decomposition, design decisions, certain trade-offs. Once a planner compresses uncertainty into detailed instructions, cheap models just follow.
From “One Smart Model Writes Everything” to a Control System
The SQLite run is the finale of a series, and the evolution reads beautifully in hindsight:
Generation one: flat self-coordination (failed)
All agents equal, claiming tasks through shared coordination files. Result: heavy lock contention, and agents dodged hard tasks in favor of easy repetitive ones — a team with no project manager, everyone busy, nobody eating the hard bread.
Generation two: planning-execution split (workable)
Planner agents explored the codebase and recursively created tasks; workers focused on execution; referees judged whether to iterate. But the long-running executors overloaded — planning, researching, coding, merging, reviewing, and completion-judging all at once.
Generation three: root planner architecture (stable and efficient)
A root planner holds the complete goal, delegates narrowly-scoped work units recursively, and never implements anything. Workers report back to their parent exactly once per task. Context isolation is the core: planners aren’t stuffed with details, workers aren’t distracted by the global goal.
Generation four: the SQLite swarm (a high-throughput production line)
On top of the root planner, a full suite of industrial mechanisms:
-
A custom VCS: from Git’s 1,000 commits per hour to 1,000 per second.
-
Neutral conflict resolution: dedicated third-party agents for merges — 70,000 conflicts in the old swarm cut to under 1,000.
-
Design docs with compile-verified references: decisions written to shared documents, dependent code carrying traceable references.
-
Multi-perspective review: stacked, low-correlation review angles, reliable the way autonomous-driving redundancy is.
-
Field Guide: a shared knowledge base the agents maintain themselves, inherited by successors.
-
Bloat-file splitting: workers flag giant files; external agents carve them up.
-
Deliberate breaking changes: allowed, with the compiler propagating impact system-wide.
The results were stark: the old swarm (Fable 5 mix) needed 64,305 lines of engine code to pass; the new swarm passed with 9,908. The Opus 4.8 mix was starker still — 19,013 lines at 97% under the old framework versus 4,645 lines at 100% under the new one.
Why Swarms Work: Context Efficiency Beats Parallelism
This is Cursor’s own insight, and the most valuable one here. A solo agent walking the full task tree must keep ancestor nodes, its current position, and the macro goal in context simultaneously. Over time, context crowding and attention imbalance become inevitable — hyperfocus on the present at the expense of the whole, or a global view with weak local execution. Swarms fix this through role decomposition: planners never implement, so their context stays conceptual; workers never plan, so their context concentrates entirely on one concrete piece. Cursor’s conjecture: the swarm’s scalability flows mostly from this context efficiency, not from parallelism — which is why even mid-size tasks improve when sensibly split.
Software Engineering Is Becoming the Study of Stating Goals
The experiment exposes a deeper paradigm shift. Autocomplete worked line by line; early models raised the unit to code blocks; agents lifted it to files and features. Swarms make the specification the basic unit of work. Cursor’s judgment: what becomes scarce is the ability to describe intent accurately. When the developer’s job is to set the goal, attach the spec, and define the evaluator — and orchestration handles decomposition and execution — engineering pivots from “how do I implement this” to “how do I state the goal, constraints, and acceptance criteria precisely.”
The sharpest framing: orchestration systems are starting to resemble compilers. A compiler translates source to machine code, preserving semantics at every step; a swarm does the same to intent — the planner parses the goal into a task tree, then refines it into executable work. The difference is that a compiler is deterministic at every step and a swarm is probabilistic at every step. Narrowing that intent-to-execution gap has been Cursor’s core problem for the past year.
Five Takeaways for Developers and Teams
-
Stop worshipping the strongest model. Under sensible orchestration, a hybrid mix matched quality at an 8× discount. The leverage is in designing the boundary between planning and execution.
-
Context isolation is the key to agent scale. Split roles → isolate contexts → focus locally. It works for human teams; it works for swarms.
-
Review is cheaper than work. Stacked multi-perspective review pays for itself; small errors get caught before they compound.
-
Specification quality sets the ceiling. An 835-page, well-structured manual is the ideal input. Real codebases are full of ambiguity, undocumented behavior, and tribal knowledge — converting fuzzy requirements into precise specs is becoming the engineer’s core competency.
-
The “one agent writes it all” era is over. Cursor’s new agent UI already runs multiple agents in parallel in one view — the SQLite experiment is the research footing under that product direction.
References: Cursor: Agent Swarm Model Economics · Cursor: Towards Self-driving Codebases · Cursor: Scaling Long-running Autonomous Coding · InfoQ coverage