48 slides extracted.


Slide 1 — 0:12 (watch)

Slide 1Welcome. I'm Matt, and this is Sunil. We work on agents at Cloudflare.

Slide 2 — 0:26 (watch)

Slide 2I'm Matt Carey. I tend to hire my friends for our team. Please say something to introduce yourself, and make sure to speak into the microphone.

Slide 3 — 0:32 (watch)

Slide 3Is my microphone on?

Slide 4 — 0:38 (watch)

Slide 4I view Cloudflare as a friends and family company. We enjoy doing favors for our closest friends. No one pays for Cloudflare services, which are already very affordable.

Slide 5 — 0:46 (watch)

Slide 5We began developing AI agents in earnest a little over a year ago, and the progress has been remarkable. How many people here are familiar with orange-billed, referring to durable objects?

Slide 6 — 1:10 (watch)

Slide 6The technology has a poorly chosen name, but it is remarkable. Many people refer to it as a database, but it functions differently, incorporating database features. We began using it, and it proved to be very effective. It offers unique capabilities that some may view as vendor lock-in, while others may see them as innovative.

Slide 7 — 1:34 (watch)

Slide 7Since then, the team has grown, with most of us based in London. However, one of our team members recently moved to Lisbon, which is fantastic. They enjoy their days drinking wine and eating fish, potatoes, and bread. I live in Newcastle, where the weather is much worse, but I do enjoy it.

Slide 8 — 2:16 (watch)

Slide 8I tried watching Geordie Shore, and I regret it. Let's get back on topic. We've been building agents, and I can share our journey so far, the technology we're using, and some upcoming features. Thankfully, none of this is recorded, so I can discuss some secret features that are coming out. I’d love to open the floor for questions for a couple of minutes. Otherwise, we have five topics we thought would be interesting to discuss. What would you like to know about Cloudflare and AI agents?

It starts with durable objects. Everyone believes that building servers today involves writing a function that takes a request and returns a response, which is the simplest model. For example, if you want to build a hit counter for your website, you might initialize a counter variable to zero. For every request, you would increment the counter. This works locally, but once deployed, it fails immediately. Why does it fail? There’s no state; the function spins up, performs its task, and then disappears. As a result, the counter will always be zero most of the time, although it might reuse the isolate under heavy traffic.


Slide 9 — 3:38 (watch)

Slide 9To manage state, you need to use a database, which involves additional complexity. Instead, imagine having a class that initializes once for a given ID, allowing every future request and WebSocket connection to land in the same instance. We refer to this as stateful serverless, which can be confusing since servers are typically stateful. However, it behaves like serverless technology by scaling globally. Thanks to Cloudflare's extensive network, users in London experience approximately 15 milliseconds of latency. For comparison, 60 frames per second translates to just over 16 milliseconds. For example, TLDraw, which utilizes this technology, allows multiple phones to draw on a shared screen with perfect synchronization. This approach also serves as an ideal compute unit for building AI agents. These agents are addressable, capable of running long-term processes even without incoming requests. They can hibernate, sleep, and maintain persistence, allowing them to connect to various services. This was the foundational concept we pursued.

Slide 10 — 4:38 (watch)

Slide 10The API is available on this page. You can create a cloud environment by importing from agents. We won't disclose the cost of the npm package. You can extend it and schedule tasks to run at startup. Additionally, you can create callable functions. The agents package includes a full-stack solution, providing React hooks, although it also supports plain JavaScript clients. You can define functions that are callable from clients and run tasks in the background.

Slide 11 — 5:08 (watch)

Slide 11Scheduling is my favorite feature because it allows you to set tasks such as reviewing your entire Git history and wiki every Friday at 9 p.m., compiling the information, and sending it to your manager. You can even alter the spelling to make it look like you wrote it. This functionality is quite useful.

Slide 12 — 5:22 (watch)

Slide 12It can scale up to millions or even trillions, achieving some impressive numbers with Cloudflare.

Slide 13 — 5:26 (watch)

Slide 13That's where it starts. Over the last year, we have built several components.

Slide 14 — 5:44 (watch)

Slide 14We have developed a first-class back-end for Vercel's AISDK, which has proven to be highly effective. However, there is still much work to be done to make it production-ready, including implementing tool calls and resumability across tabs. We believe we have the best back-end for the AISDK. Now, I want to discuss code mode, which is an important aspect of our development.

Slide 15 — 6:38 (watch)

Slide 15Around April last year, MCP gained significant popularity. It turns out that durable objects are an excellent solution for MCP servers. Originally, deploying MCP servers to production in the cloud was challenging due to the need for a stateful connection between the client and server. Durable objects maintain this stateful connection easily, which was a key advantage. We adopted this approach early on and were among the first to implement MCP servers for major clients like PayPal and Sentry, along with others like Linear and Intercom. This success led us down many interesting paths, ultimately guiding us to code mode. We also have durable objects and workers, which function similarly to serverless functions, akin to AWS Lambda, but designed with advancements reflecting 10 to 20 years of progress.

Slide 16 — 7:20 (watch)

Slide 16Next, we introduce a new primitive called dynamic workers. This functions similarly to a worker, but instead of deploying the worker to the cloud, you can take a string of code provided by a customer, user, or generated by an LLM, and execute that code in its own isolated worker.

Slide 17 — 7:34 (watch)

Slide 17You can execute code directly from a string, which often surprises people.

Slide 18 — 7:42 (watch)

Slide 18I attended the MCP Dev Summit last week, where a startup next to me was trying to convince me that no enterprise environment would permit people to run generated code that they had never seen.

Slide 19 — 7:56 (watch)

Slide 19Someone from Lockheed Martin approached me and expressed enthusiasm for generated code. The contrast between their perspective and the previous conversation was amusing. Essentially, you can execute user-generated code within a dynamic worker, which we believe serves as an excellent sandbox for various applications.

Slide 20 — 8:10 (watch)

Slide 20It is not a virtual machine and does not have a full file system or the associated overhead. However, it is an isolate that can be spun up, allowing for the creation of billions of instances on demand.

Slide 21 — 8:34 (watch)

Slide 21This is significant because it allows for user-generated code without the need for a domain-specific language (DSL). Previously, you might have used a JSON file generated from a frontend form and converted it into code. Now, you can simply write code directly. I encourage you to check out our blog on the Cloudflare website; it’s very technical and informative. The only promotional content is a call to action at the bottom, as requested by our marketing team.

Slide 22 — 9:02 (watch)

Slide 22You can disregard that part, but everything else is excellent. We provide detailed information on this topic. Typically, sandboxes start from a VM or a container, adding security around them. In contrast, we take the opposite approach. The only code that can run is JavaScript, and it has no access to fetch, APIs, or anything else.

Slide 23 — 9:16 (watch)

Slide 23From the outside, you can specify four APIs, allowing only outgoing fetches to github.com, such as github.com/XYZ or math.random. Some requests may fail, but you can write code to handle that.

Slide 24 — 9:30 (watch)

Slide 24We recommend blocking all outgoing fetches. Provide the sandbox with explicit capabilities for execution, ensuring that no environment variables are exposed to the code. This approach is worth exploring.

Slide 25 — 9:38 (watch)

Slide 25Should I demonstrate the MCP server? Can I show it a bit?

Slide 26 — 9:46 (watch)

Slide 26No, I won't be doing a demo of the MCP server because I will cover it in my talk. We can tease our presentations a bit. Essentially, we claim that we have improved MCP, not just once but twice, and that will be the focus of both of our talks.

Slide 27 — 9:56 (watch)

Slide 27At 5:40 p.m., I will be giving a talk about what we refer to as code mode.

Slide 28 — 10:04 (watch)

Slide 28For those asking about the Codemode hat, you can find it on our careers page at cloudflare.com.

Slide 29 — 10:52 (watch)

Slide 29Tomorrow, I will discuss how to use Codemode in your MCP server to access all 2,600 API endpoints of Cloudflare with just 1,000 tokens. The concept of generating code that you can then execute is incredibly powerful. Unfortunately, we don't have enough time to fully explain how it works, so I encourage you to attend our talks.

For the last 30 years, we’ve been advised against using eval in code because it’s considered dangerous. In fact, Cloudflare Workers do not support eval. However, we have developed dynamic workers, which can be thought of as eval++. This opens up an entire branch of technology that hasn’t been explored in decades. We are providing a fast, secure, and cost-effective way to rethink how you build interfaces, especially in a world where all users can write code. Dynamic workers are exciting, and I’ve been enjoying experimenting with this new approach.


Slide 30 — 11:52 (watch)

Slide 30I’m trying to find a way to connect the projects I’m working on to this broader context. I’d like to hear your thoughts on what people in the industry are building that might not be the best approach. What should they be doing instead? I have a good anecdote that could be helpful. I’d love to share examples. Let’s each provide a few. You go ahead.

Slide 31 — 12:42 (watch)

Slide 31We are here to discuss some interesting examples. One of my favorites involves the current trend of generative UI. Have you heard of JSON render? It generates JSON for rendering, but why not generate HTML or even React directly? Some platforms lack a primitive to render untrusted code, which limits this approach. However, if that primitive existed, users could generate code that runs and is rendered in a UI. For instance, Cloud Artifacts allows HTML to be rendered in the browser, and users are less concerned about security in that context. The real concern arises when rendering on servers, which is why JSON is often required. But you don't need JSON; you can render React instead. This illustrates a fun possibility in building applications. Shall we move on to the next example?

Slide 32 — 14:24 (watch)

Slide 32The feature we want to highlight is dynamic workers. Our agent framework serves as an execution environment rather than a specific library. You can use LangChain, AI SDK, or any other tool with our agents SDK. The durable object model allows for resumable streaming. For example, if you ask the LLM to generate a long story and refresh the page midway, the system ensures the streaming continues seamlessly. In a serverless environment, this would typically require a database, replication, and sticky sessions. However, with durable objects and the agents SDK, you simply reconnect, and if a stream is ongoing, it resumes from where it left off.

This capability enables multi-tab and multi-browser synchronization. You can view the same content on your phone and laptop simultaneously, all provided out of the box. The initial use case for durable objects was real-time collaborative synchronization. I believe AI should function as a multiplayer experience. For instance, why can’t I share a link to my ChatGPT conversation so we can collaborate? OpenAI hasn’t implemented that feature yet, likely due to other pressing challenges.

With primitives like these, you don’t need to manage complex distributed systems yourself; you can rely on Cloudflare to handle it. We take care of the underlying JavaScript, allowing you to focus on what matters most to you. The synchronization feature is particularly engaging, as it encourages users to shift their focus towards monetization and other priorities.


Slide 33 — 15:48 (watch)

Slide 33There are some exciting possibilities here. Imagine an agent loop running in the agent's SDK that manages the backend of Cloud Code. This setup creates a persistent server that can be accessed from any client, whether it's a terminal, chat application, phone, iOS app, or web app. The specific client doesn't matter.

Slide 34 — 16:34 (watch)

Slide 34Everything is synced across all your clients, and everything is resumable and stateful. It is up to Cloudflare to build a harness, a coding agent that runs purely on Workers. We are indeed building this and hope to ship it imminently. The conference is taking time away from burning tokens, but we are committed to this project. Everyone is developing their own harness and leveraging the benefits of their infrastructure or philosophy. This is ours. Not only do we offer spin-ups and spin-downs with stateful agents, but we also provide the capability to generate and run code on the fly, instantly and quickly. Resumability comes out of the box, and if you want to delegate to a large container, you should absolutely be able to do that.

Slide 35 — 17:06 (watch)

Slide 35Our team also manages the Cloudflare Sandbox SDK.

Slide 36 — 17:16 (watch)

Slide 36You want to run it in a browser, and we have a solution for that. You should definitely consider using our tools. If you're interested in Daytona, it's a great product, and I really appreciate their Sandbox features. If you're looking to use a browser or run Light Panda, we can support that as well.

Slide 37 — 17:24 (watch)

Slide 37You can do that.

Slide 38 — 17:44 (watch)

Slide 38The workers and our agents SDK serve as the central connection point for all components. This vision is becoming a reality sooner than expected. How would you create a Cloudflare that can develop its own skills? This is something I find particularly exciting. We offer various storage solutions, including SQLite directly within durable objects, allowing you to store data there.

Slide 39 — 18:32 (watch)

Slide 39You can store data in R2, and currently, you need to wire everything up manually, but that will change soon. So, what is OpenCloud? It requires a heartbeat, a virtual file system, and connectivity to services for controlling secrets. You also want extensions, which allow for generating code that runs in a safe, sandboxed environment. I implemented extensions this morning, and they work really well. By the way, I'm friends with Mario—hi, Mario! We love Py, the coding agent, and we want to run Py directly on workers as well. We've been discussing this with him because it makes sense. This is the future, and we are working tirelessly on it right now. If it weren't for you all, I'd be burning tokens. Do you have any more questions? How much time do we have left?

Slide 40 — 19:38 (watch)

Slide 40React Cloud has a significant amount of JavaScript. What about other languages? We will also support Python, as we have Pythonic workers. The Add Workers feature supports Python as well; I just need to spend some time polishing the rough edges. Python is a first-class language, just like JavaScript. Other languages primarily use WebAssembly. Recently, we have been experimenting with Zig. I believe you are the first person to bring Zig into production in Cloudflare Workers, although we can't discuss the specific projects today. The advantage of Zig is that its WebAssembly bundles are much smaller compared to those of Go and Rust. Other languages can also compile to WebAssembly, but if you need to run them natively, you can spin up a container instead. We provide a first-class SDK that facilitates this process. That said, your LLM is capable of writing code at this point, so does it really matter whether it's JavaScript or not? That's my point as well. Currently, the first-class languages are JavaScript and Python. As a React programmer, I find Python a bit challenging, but I will ensure we address those rough edges and support it fully.

Slide 41 — 20:42 (watch)

Slide 41We have a tool that allows you to run a bundler inside a worker, called Worker Bundler. It pulls down dependencies from npm, removes types, JSX, TypeScript, and generates the code you want to run. This is beneficial because it uses the Cloudflare cache for dependencies, alleviating concerns about npm downtime. Regarding the SQLite storage, when I mentioned it works, I meant it is operational. It's available at Cloudflare/shell. The API is stable and usable today, providing a full file system layered on top of Durable Objects, SQLite, and R2 for larger files. You can use it right now. I don't want to delve into the history of that project. Is there anything else?

Slide 42 — 21:18 (watch)

Slide 42If you search for Sunil's name on Twitter, you'll find the history of that project, which is a bit dramatic. Is there anything else we can assist you with? Does anyone want free credits? As I mentioned, we are a friends and family company.

Slide 43 — 22:10 (watch)

Slide 43We launched a new CMS last week called MDash, which is a great name for a product today. It runs fully on Workers and Durable Objects. The plugin system is built entirely on dynamic Workers, addressing security issues that often arise with plugins in systems like WordPress. You can lock down where the plugins run, and it works out of the box. MDash can be deployed on any platform, not just Cloudflare, and we are working on support for other platforms with our dynamic Worker technology. Additionally, we have a version of Next.js that runs fully on Workers, which is very enjoyable to use. Next week is our Agents Week, during which we will announce a lot of exciting updates. We have these announcement weeks twice a year, and next week will be particularly busy with fun news. You can send your account ID and, if you like, consider it a bribe or protection money. I'm trying to cultivate a bit of a mafioso vibe around that.

Slide 44 — 23:04 (watch)

Slide 44The cost-effectiveness of Cloudflare stems from decisions made a decade ago. We do not build massive data centers; instead, we install hardware close to ISPs.

Slide 45 — 23:12 (watch)

Slide 45We purchase bandwidth in bulk from top-level ISPs and establish agreements that allow us to avoid charges for bytes that cross boundaries.

Slide 46 — 23:36 (watch)

Slide 46Our free accounts are not a marketing expense; they are part of our business model. It's important for more people to understand this. The standard cost is $5 a month, and we know people are building multi-million dollar SaaS applications on top of that. If you want to access our services for less than $5, you just need to connect with us. I see we're running out of time. Thank you all for your attention. We have a booth on the expo floor, and I will be speaking today at 5:40 PM, while my colleague will speak tomorrow. We encourage you to attend both talks.

Slide 47 — 24:10 (watch)

Slide 47Look at us! I even got a haircut for this. It's going to be fun. We invite you to come hang out with us; we enjoy chatting with people. You can find all the documentation at agents.cloudflare.com or developers.cloudflare.com/agents.

Slide 48 — 24:28 (watch)

Slide 48Visit GitHub.com/cloudflare/agents to file issues. We encourage you to connect your clanker with our clankers. We look forward to seeing what you build.