What we can learn from Cursor's SQLite Rust experiment
Key Takeaway
Scaling multi-agent swarms to complex software engineering tasks requires pairing top-tier planning models with cheap execution models, fresh context windows, and a dedicated coordination layer to resolve conflicts and concurrency bottlenecks.
Highlights
Combining Opus 4.8 for task planning with Composer 2.5 for execution cut the cost of rebuilding SQLite in Rust from $10,000 down to $1,300 while maintaining identical pass rates.
The agent swarm generated up to 1,000 commits per second, requiring a custom-built version control system to handle concurrency beyond Git limits.
Planners prevented duplicate code implementations by maintaining signed decision documents linked via compiled check references, reconciled by an intermediary agent when contradictions arose.
When agents generated oversized mega files, the system blocked new commits and deployed dedicated agents to decompose the overgrown code into smaller modules.
A stacked combination of specialized reviewer agents focusing on distinct aspects like idiomatic code or performance yielded better code quality than single, comprehensive reviews.
Timeline
The SQLite Rust Rebuild Experiment and Model Cost Savings
The mini SQLite project evaluated how multi-agent architectures tackle large-scale software engineering tasks rather than attempting to deliver a production-ready database. The system relied on SQLite's extensive 835-page documentation as a specification and checked query correctness against the SQLogic test suite. Distributing high-level planning to Opus 4.8 and code generation to the cheaper, faster Composer 2.5 achieved the same benchmark pass rate at a fraction of the cost.
- The Cursor team attempted to rebuild SQLite in Rust using an agent swarm guided by an 835-page documentation spec and tested against the SQLogic suite.
- Using frontier models like GPT 5.5 for both planning and execution cost $10,000 to achieve passing test results.
- Offloading execution tasks to lower-cost models reduced total experiment costs to $1,300 without dropping code quality.
Custom Version Control for Agentic Swarms
Worker agents excel at implementing isolated subtasks when provided with clear specifications, enabling the use of cheaper execution models. An earlier web browser reconstruction experiment peaked at 1,000 commits per hour, whereas the SQLite setup hit 1,000 commits per second. Because Git lock files cannot accommodate thousands of simultaneous edits, the team built a custom version control system to manage high concurrency and surface merge collisions directly.
- Frontier reasoning models are unnecessary for basic code emission when tasks contain well-defined context and scope.
- The new agent system reached peak commit throughputs of 1,000 commits per second.
- Traditional tools like Git rely on coarse locks that fail under high-frequency concurrent edits from hundreds of agents.
Resolving Planning and Code Merging Bottlenecks
Parallel planners frequently create duplicate implementations or overwrite each other's architectural decisions. The team mitigated split-brain design problems by forcing planners to sign design decisions and track them in shared documentation. When file-level merge collisions occurred, standard worker agents typically overwrote changes or abandoned their work, prompting the introduction of impartial reconciler agents operating in isolated context windows to mediate conflict resolution.
- Prompting constraints forced planners to make signed architectural decisions, preventing split-brain code duplications across subtrees.
- Shared design documents and a reconciler agent resolved direct conflicts between opposing planner specifications.
- Neutral third-party agents stepped in to resolve file-level merge conflicts without context bias.
Managing Mega Files and Overcoming Agent Code Refusal
Agent activity naturally concentrates around core files, expanding their size and increasing merge collisions. To preserve clean architecture, workers flagged oversized files, suspending commits until a separate agent restructured the file into smaller modules. Additionally, fine-tuned safety boundaries often prevent agents from deleting legacy code or refactoring core structures, requiring explicit prompting rules that encourage breaking changes for code cleanup.
- Unchecked multi-agent contributions caused popular files to bloat into mega files that slowed down diffing and transport.
- Flagging overgrown files paused incoming commits and triggered dedicated decomposition agents to modularize the codebase.
- Explicitly licensing intentional breaking changes overcame model fine-tuning biases against modifying existing core code.
Stacking Specialized Review Lenses and Shared Agent Memory
Evaluating code quality required combining lightweight, specialized reviewer personas—focusing on distinct domains like language-idiomatic patterns or security—rather than analyzing entire codebases at once. Agents also authored a shared field guide to record lessons and track state across sessions. While this experiment highlights efficient multi-agent coordination strategies, rebuilding a system with 20 years of existing specification does not replicate real-world product development with evolving specs.
- Combining multiple reviewer agents focused on specialized domains outperformed single, monolithic review attempts.
- Allowing agents to maintain a shared field guide created persistent memory across independent execution runs.
- Rebuilding existing software with complete specifications differs fundamentally from greenfield product development.
Description
Cursor rebuilt SQLite in Rust. Multiple times, with different AI models. And it's not about the product. Instead, it's a really exciting experiment that has implications for us all! Official blog post: https://cursor.com/blog/agent-swarm-model-economics The result: https://github.com/cursor/minisqlite Learn to build with AI: https://academind.com/courses Website: https://maximilian-schwarzmueller.com/ Socials: 👉 Twitch: https://www.twitch.tv/maxedapps 👉 X: https://x.com/maxedapps 👉 Udemy: https://www.udemy.com/user/maximilian-schwarzmuller/ 👉 LinkedIn: https://www.linkedin.com/in/maximilian-schwarzmueller/ Want to become a web developer or expand your web development knowledge? I have multiple bestselling online courses on React, Angular, NodeJS, Docker & much more! 👉 https://academind.com/courses
