AI Briefing
KO

How We Completely Redesigned Our Agent to Be Durable Object-Based Using Pi, Agents SDK, and Code Mode

·2026.07.29 09:00

Key point

camelAI completely redesigned its existing VM-based agent architecture to be based on Cloudflare Durable Objects for cost-efficient scaling.

Details

Existing coding agents had to allocate an independent Linux VM for every single user, which created massive infrastructure cost and scaling problems as the number of users grew. In particular, the biggest bottleneck was the fact that the agent required an always-on VM in order to execute Bash commands.

To solve this, camelAI went through a three-stage architectural transition. In the first stage, they separated the agent's 'brain' from its 'hands (execution environment),' introducing an approach where the agent runs on a Cloudflare Durable Object and only calls a VM when executing commands.

In the second stage, they removed the VM entirely. They moved the agent's file system into a Durable Object based on SQLite and R2, and built an environment that could execute code without a VM by leveraging Cloudflare's Shell library.

Finally, the agent now runs by directly writing JavaScript. While this approach places explicit limits on what the agent can do, it has, as a result, dramatically reduced infrastructure costs and made it possible to run the agent at the Edge, close to users, with low latency.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.