Cloudflare Unveils Project Think for AI Agents

Cloudflare launches Project Think, a new SDK for building scalable, durable, and secure AI agents with advanced code execution and persistent session capabilities.

5 min read
Cloudflare logo with abstract AI-themed graphics
Cloudflare introduces Project Think to advance AI agent development.· Cloudflare

Cloudflare is stepping up its AI infrastructure game with the launch of Project Think, a significant evolution of its Agents SDK. This new initiative aims to provide the foundational tools necessary for building the next generation of AI agents, focusing on durability, scalability, and enhanced execution capabilities. According to Cloudflare, Project Think introduces a suite of primitives designed for long-running agents, including durable execution, sub-agents, sandboxed code execution, and persistent sessions.

The surge in powerful AI coding assistants like Pi and Claude Code has demonstrated a paradigm shift: granting LLMs the ability to read, write, execute code, and retain memory transforms them into sophisticated, general-purpose assistants. These agents are increasingly used for complex tasks ranging from calendar management to automating business workflows, operating on a pattern of read-reason-act-observe-iterate. Code has emerged as the universal medium for action in this agentic landscape.

The Agent Scaling Problem

However, current agent architectures face significant hurdles. They often run solely on local machines or expensive virtual private servers, limiting collaboration and device handoff. Furthermore, idle agents incur fixed monthly costs, a model that becomes unsustainable when scaled to teams or enterprises.

A deeper structural issue lies in the fundamental difference between traditional applications and AI agents. While applications typically serve many users from a single instance, agents are inherently one-to-one, each acting as a unique instance for a single user and task. This one-to-one model, akin to a personal chef preparing unique meals, drastically alters scaling mathematics. Supporting tens of millions of simultaneous agent sessions, even at modest concurrency, requires a new foundation beyond per-container costs.

Introducing Project Think Primitives

Project Think addresses these challenges with a set of new primitives for the Agents SDK:

  • Durable execution with fibers: Ensures crash recovery, checkpointing, and automatic keepalive for long-running processes.
  • Sub-agents: Enables isolated child agents with their own SQLite databases and typed RPC, managed via Durable Objects.
  • Persistent sessions: Offers tree-structured messages for forking, compaction, and full-text search.
  • Sandboxed code execution: Utilizes Dynamic Workers and codemode for secure, runtime execution of LLM-generated code.

These primitives can be used individually or combined with the new Think base class for rapid development.

Related startups

Long-Running Agents and Durable Execution

Traditional agents are ephemeral, tied to a single session or device. Project Think's approach, building on Durable Objects, provides each agent with an identity and persistent state. Agents consume zero compute when hibernated, waking only when an event occurs. This actor model approach drastically alters agent economics, making the marginal cost of spawning a new agent effectively zero.

Surviving crashes: durable execution with fibers

Fibers provide a solution for long-running agent tasks that might otherwise be interrupted. A fiber is a durable function invocation registered in SQLite before execution, checkpointable via `stash()`, and recoverable via `onFiberRecovered`. This ensures that even if the execution environment vanishes, the agent can resume its work seamlessly.

The SDK automatically keeps agents alive during fiber execution. For tasks measured in minutes, `keepAlive()` prevents eviction. For longer operations, agents can persist job IDs, hibernate, and wake on callback.

Delegating Work with Sub-Agents

Project Think advocates for modularity with sub-agents, or Facets. These are child Durable Objects colocated with the parent, each possessing its own isolated SQLite database and execution context. This isolation prevents implicit data sharing and enforces strict boundaries, with RPC latency comparable to function calls.

Conversations That Persist: The Session API

For agents operating over extended periods, the experimental Session API provides a robust conversation model. Stored as trees with parent-child message relationships, sessions enable forking alternative discussion paths, non-destructive summarization, and full-text search across history using FTS5.

From Tool Calls to Code Execution

Project Think reframes the interaction between LLMs and tools. Instead of sequential, token-intensive tool calls, the LLM writes a single program to accomplish a task. This approach, facilitated by `@cloudflare/codemode`, drastically reduces token usage and execution time.

For example, instead of a hundred model round-trips to read and analyze files, the LLM generates a single script. This significantly cuts costs and improves performance, as demonstrated by Cloudflare's MCP server reducing token consumption by 99.9% through this method.

Safe Sandboxes: Dynamic Workers

The crucial question of where LLM-generated code runs is answered by Dynamic Workers. These are lightweight, ephemeral V8 isolates spun up in milliseconds. They offer a secure execution environment with minimal ambient authority, requiring explicit capability grants through bindings. This capability model shifts the focus from preventing overreach to defining precisely what an agent should be able to do.

The Execution Ladder

Project Think defines an "execution ladder" of compute environments agents can escalate through:

  • Tier 0: Workspace - A durable virtual filesystem backed by SQLite and R2, managed by `@cloudflare/shell`.
  • Tier 1: Dynamic Worker - Sandboxed JavaScript execution for LLM-generated code.
  • Tier 2: npm Integration - Runtime package resolution via `@cloudflare/worker-bundler`.
  • Tier 3: Headless Browser - Web automation using Cloudflare Browser Run.
  • Tier 4: Sandbox - Full OS access for complex tasks like compilation and testing, synced bidirectionally with the Workspace.

The design principle is that agents remain useful at Tier 0, with each subsequent tier adding additive capabilities.

Building Blocks, Not a Framework

The primitives—Dynamic Workers, `@cloudflare/codemode`, `@cloudflare/worker-bundler`, and `@cloudflare/shell`—are available as standalone packages. Developers can combine these to equip any agent with workspace access, code execution, and package resolution without adopting a rigid framework.

The complete stack for building agents on Cloudflare includes: per-agent isolation via Durable Objects, zero idle cost through hibernation, persistent state with SQLite, a durable filesystem, sandboxed code execution via Dynamic Workers, runtime dependencies, web automation, full OS access in sandboxes, scheduled execution with Alarms + Fibers, real-time streaming via WebSockets, external tool integration via MCP, typed RPC between agents, and LLM connectivity through Workers AI. This forms a robust platform for building capable, serverless, durable, and secure AI agents.

The Think Base Class

The Think base class acts as an opinionated harness, orchestrating the full chat lifecycle: agentic loop, message persistence, streaming, tool execution, and stream resumption. Developers can focus on their agent's unique logic. A minimal implementation involves defining the model provider, such as using `createWorkersAI`. This setup provides a working chat agent with essential features like streaming, persistence, and a built-in workspace filesystem, deployable with a single command.

© 2026 StartupHub.ai. All rights reserved. Do not enter, scrape, copy, reproduce, or republish this article in whole or in part. Use as input to AI training, fine-tuning, retrieval-augmented generation, or any machine-learning system is prohibited without written license. Substantially-similar derivative works will be pursued to the fullest extent of applicable copyright, database, and computer-misuse laws. See our terms.