Skip to content

By playing, you agree to uListen's Terms and Privacy Policy and YouTube's Terms of Service.

ClaudeClaude

Lessons from building agents on the Claude Platform

Anthropic built the infrastructure behind Claude Managed Agents three times before turning it into a platform for customers.

Nov 24, 202616mWatch on YouTube

Summaries, chapters, transcripts, and FAQs on this page are made by uListen, not YouTube.

Great conversations run long. Their best ideas don't have to.

uListen is free on iPhone, iPad, Android, Chrome, and Claude.

See how

Transcript

0:00 – 0:20

Intro

Host 0:00 In the human brain, we use dreaming to-

Host 0:01 Mm

Host 0:01 ... consolidate the memories that we write over the course of the day with our overall knowledge. So the agent is proceeding through a task, writing kind of in the hot path what it deems to be important, but there's also a dreaming process. [upbeat music]

0:20 – 1:50

Why we built Claude Managed Agents

Host 0:22 We launched Claude Managed Agents in the spring of this year. I guess before we kind of start talking about it more, what is Claude Managed Agents?

Host 0:30 Claude Managed Agents is a suite of developer APIs and interfaces that allows companies of any shape and size to build agents and deploy them at scale. And so this suite of APIs goes above delivering raw tokens and really delivers you agentic capabilities out of the box, but still in a very customizable interface.

Host 0:49 We, we kind of built a version of this as a platform like three different times within Anthropic.

Host 0:53 Yeah.

Host 0:54 Um, it kind of started as a desire to increase our own internal productivity and have agents kind of work where we work, and then we decided to bring it to our apps, and we built almost the exact same infrastructure again from scratch. And, uh, you know, this time we kind of applied some of our lessons, and we were, were kind of learning as we were going, and then we built it a third time. And [chuckles] we realized there was a recurring pattern there, and that we were clearly, uh, banging our head against the wall in doing this. And while that was happening, we were noticing that a lot of our external customers that we would talk to in the platform org were running into a lot of the same problems, where they might have had access to the Messages API or to Claude Code or the Agent SDK, but they couldn't run these things at scale, and they couldn't run it for, uh, like, hours on end. And we realized that we probably were best positioned in order to be able to help people bridge that gap from where they were at the time to being able to just get to production faster

1:50 – 4:50

Keeping up with models and managing cost

Host 1:50 with real impressive functional agents.

Host 1:54 What's hard about building agents? Like, I, I think ... When I think about this, you know, I think about in, in my past life, I spent a lot of time building agent harnesses-

Host 2:01 Mm

Host 2:01 ... before coming here, and it's hard to keep your harness up to date with the model.

Host 2:05 Mm-hmm.

Host 2:06 And, like, you kind of end up learning that a bunch of primitives for building agents are very useful to keep your harnesses, like, up to date with the model.

Host 2:15 Yeah. Well, an agent is just like a while loop, right? It's just ... That's it.

Host 2:18 At the core.

Host 2:18 That's it, and you're done. Um, no, [chuckles] but, uh, as, uh, as models were getting more and more intelligent, we kind of realized that, uh, these primitives kind of fall out of these models getting smarter.

Host 2:28 Right.

Host 2:29 So, uh, Claude very quickly became really, really good at using, um, a terminal and, uh, calling bash commands and editing files. So we knew we had to give the model some access to a file system and a computer where you can actually execute those commands. That's kind of where the sandbox came from. Um, then we realized that having these kind of repeatable procedures as skills is also something that's very, very useful, so we knew we kind of had to roll that into Claude Managed Agents as well. And I think that pattern kind of kept repeating itself over and over again. And then around that, we kept building more of the infrastructure that would make this work at scale. So sure, you can have a sandbox, but you have to make sure it's very secure, and if you're going to connect to MCP servers, you need to make sure that those credentials never leak anywhere, and that's kind of where a lot of these primitives kind of, like, rolled out. We wanted to have a lot of this kind of come naturally from, from where we see the models going.

Host 3:19 Yeah, I, I think that the models, as they advance faster and faster, we have put the burden on the developer historically to keep up with that innovation and to continually invest to stay on the frontier. And I think that if we want AI deployments to succeed at scale, we actually need to make that process of staying on the frontier a lot easier for people, and it shouldn't be something that requires a lot of maintenance cost. It should be something that we abstract away because we know what gets the best out of Claude, and we're, we're able to build that very quickly.

Host 3:50 Also making sure agents are cost efficient.

Host 3:52 Mm-hmm.

Host 3:53 A major aspect of that is prompt caching and other things. And so those things we can kind of build into Managed Agents, ensure that they're well optimized. What are some of the primary cost considerations, and how does Managed Agents kind of address them?

Host 4:04 Yeah, I think that cost is definitely one of the biggest talking points and concerns of anyone from a prosumer to an enterprise today. We see a lot of users starting with a highest class model for a sophisticated task and then, you know, that's fine for development, and as they scale, they realize that they need to more strategically delegate across maybe a variety of models, and maybe that means multi-agent orchestration where the most sort of capable model serves as a coordinator or a delegator for a roster of more, uh, you know, baseline models. As we move into more and more sort of long-running asynchronous work, it becomes increasingly important for us to support budgeting and cost optimization as built-in primitives within Managed Agents and, and r- really that's where we see this heading.

Host 4:49 I, I

4:50 – 8:10

Using dynamic workflows and multi-agent harnesses

Host 4:50 actually think, uh, sub-agent delegation's really interesting.

Host 4:52 Mm-hmm.

Host 4:52 Um, in particular, flows, I think, is, is really interesting along these lines.

Host 4:56 Mm-hmm.

Host 4:56 So basically giving the agent ability to reflect on a task and then kind of spawn a workflow with the right size models for sub-tasks.

Host 5:03 Mm-hmm.

Host 5:04 Tell us about how flow supports that.

Host 5:06 Something that we are ... I think everybody's kind of starting to realize is that task completion rates just improve if you have multiple agents that can kind of coordinate and work together. And I think the first version of this that we kind of launched with Claude Managed Agents was relatively straightforward in that a single coordinator could just, like, effectively send messages back and forth to other agents that were long-lived and can do their own kind of trajectories of work, and that was nice and dandy, but the communication between them was relatively straightforward and basic. But really what a lot of people want at scale is workflows or multi-agent harnesses that can be a lot more complex. So you can have-

Host 5:44 Yeah

Host 5:44 ... branching logic between them. You might want to put some, some agents on a for loop, uh-

Host 5:49 Yeah

Host 5:49 ... with, with- within those agents. You might want to do some sort of like parallelization where a bunch of agents go seek out a bunch of information, and then you kind of reduce that back to a single output. What we realized is that, uh, we shouldn't try to kind of dictate specific way of doing these things, and really the easiest way to do that is by letting Claude just kind of stitch together this multi-agent harness at runtime.

Host 6:10 Yeah.

Host 6:11 So, uh, just giving it the ability to kind of write the code that's necessary in order to stitch these different agents and their results, um, from one to the other. And we've seen like amazing results with this on, uh, a lot of our frontier tasks, especially the ones that require a lot of long horizon thinking and task completion. We hope that eventually we can also try to kind of bring that back to the user a little bit more directly, and give them the ability to define these, uh, workflows and, um, like pass them to us so that, uh, we can run it for them. Um, and that'll be very, very exciting because then they can, uh, like hill climb on specific harnesses that they want to, to... These models kind of be operating as.

Host 6:50 I, I think that historically we viewed outcome optimization, the idea that Claude should iterate on a known idea of what good looks like-

Host 6:58 Mm-hmm

Host 6:58 ... as kind of separate from multi-agent orchestration and task decomposition, and I think that Flows really brings these two together in a very natural way. Like, you shouldn't be thinking about how to construct your team as separate from the pattern through which Claude gets from good to better to best. Um, these are really two like of the same concepts that we initially separated, and I think aggregating them together actually gives us a lot of power.

Host 7:24 Something that we were talking about the other day actually, um, that ties into this, into, uh, cost management as well, is, uh, this notion of letting Claude decide, uh, which model its sub agents are going to be.

Host 7:35 Yeah.

Host 7:36 Um, I know you've been working a lot on this. Can you, can you tell us a little bit more about this?

Host 7:39 I think in general, allowing models to basically define their own harness at runtime based upon the shape of the task is a really powerful general paradigm. We already have outcomes in, in Managed Agents, and that basically gives like the affordance, like I can run in a loop until an outcome's satisfied. Typically, we think of outcomes tuning things like maybe prompts or maybe some small part of the task, but like more broadly, an outcome can also tune the prompt or the harness itself.

Host 8:04 Mm-hmm.

Host 8:04 So, like Flows makes, like basically the, the harness an affordance that Claude can

8:10 – 10:30

Scaling Claude Managed Agents: decoupling the brain and hands

Host 8:10 tune and modify in a loop in order to satisfy an objective, I think that's-

Host 8:13 One of the things that's been most exciting about Claude Managed Agents has been the fact that we kind of invested a lot of time up front on the core architecture. A lot of people talk about it as the brains and the hands split because, um, our primitives are not so like directly coupled and stitched together. Um, we can decide tomorrow to have a session that doesn't ever have sandboxes or doesn't ever use MCPs or skills or any of these other primitives, but can use the entire other, like kind of menu of options that we have. Um, and I think that, uh, investments in things like the brains-hand split, where the harness itself is kind of running as the, the brains of the operation, but it can delegate work to a sandbox, to other MCP servers, kind of allowed for that to happen a little bit more naturally, and also allowed our team to move a lot faster on shipping a lot of these features.

Host 8:57 You've written a lot about how our first version was just shipping Claude into a container, and every single-

Host 9:03 Mm-hmm

Host 9:03 ... bit was in that container. Um, can you tell me about the sort of fragility of that infrastructure and what led us to revisit it?

Host 9:11 Yes. So, uh, our first approach was to just be very, very simple. Put the harness inside of a sandbox and let Claude kind of run, run crazy in there. We realized very, very quickly how just not reliable and slow this would be. These containers are really not intended to be long-lived. They are meant to be a little bit more ephemeral, and we were kind of forcing them into this world where they had to operate for hours on end uninterrupted.

Host 9:36 Hmm.

Host 9:37 If we didn't checkpoint and store to our databases any of the previous state, the entire session is kind of dead, and that is just like not viable for us. Um, we needed to offer a platform that people can depend on and can actually grow at scale with. So we went back to the drawing board, and we kind of realized and wanted to internalize a lot of... Like this, there's this, uh, engineering, uh, concept of treating your infrastructure as cattle, not pets. You shouldn't be so precious about every single instance of your infrastructure or every single component. But if for whatever reason it decided to crash or after some time of being idle, it just isn't running anymore, all we have to do is just restore a new instance of that sandbox from the checkpoints that we had, and that is a relatively cheap operation. That allowed us to completely decouple Claude being able to continue doing work, maybe reach out to the internet, and use any of the other primitives

10:30 – 12:15

How customers are building with Claude Managed Agents

Host 10:30 that we kind of give it without having to be so bound by this, uh, sandbox.

Host 10:33 Hmm. So I recently did an interview with a few customers and, and they mentioned the reason why they really like Managed Agents is because it provides primitives that let you get to time to market or ship something very, very quickly-

Host 10:46 Mm-hmm

Host 10:46 ... and it lets you experiment very quickly.

Host 10:48 Mm-hmm.

Host 10:49 These are very general primitives. So like for example, one customer talked about, uh, using sandboxing to basically host code for their customers, basically using the code sandbox-

Host 10:57 Mm-hmm

Host 10:57 ... to internal-- to separate the code and isolate it for app analytics. Um, another customer is using Managed Agents for memory, um, and another was using it for outcomes. So like, what stories have you heard from customers that are particularly interesting?

Host 11:10 I think one of my favorite stories was about this startup in the legal space who just gave Managed Agents access to all their employees, whether it was developers or non-developers, um, sort of business functions across the organization, and that the primitives were obvious enough a-and simple enough that even non-developers sort of became builders very, very quickly. And so once they kind of got the hang of Claude Code, once they got the hang of some of the developer sort of niceties that we had granted on this platform, employees all over the company were spawning their own agents. So everyone suddenly had a chief of staff, their own, uh, sort of bespoke and personalized, um, agent that was customized to their own needs and, and their own processes and workflows, um, in, in a matter of hours. It told me that like, you know, w- uh, companies that are struggling to get, um, employees to, uh, adopt, uh, AI for productivity at scale are potentially not deploying the right interfaces to those employees, right? Um, agents need to meet you where you are, and also the platform

12:15 – 16:28

How dreaming and agent memory work

Host 12:15 needs to educate you, um, in a simple and as relatable as a way as possible.

Host 12:20 I know you're, like, constantly hacking together quick little prototypes with Claude Managed Agents. What has been couple that you've been enjoying?

Host 12:27 Yeah. I've been doing a lot with memory.

Host 12:28 Mm-hmm.

Host 12:29 Uh, and, and kind of an anecdote I liked o- on memory and, and why memory's hard, and why memory is very well designed in Managed Agents-

Host 12:34 Mm

Host 12:35 ... is, is evolving. So the philosopher Kierkegaard said, "Life can only be understood, uh, backwards, but it must be lived forwards."

Host 12:41 Mm.

Host 12:42 And so this is kind of the core encapsulation what's hard about memory.

Host 12:44 Mm.

Host 12:45 So the agent is proceeding through a task. It's writing kind of in the hot path what deems to be important to memory as it goes. They are not necessarily de-conflicted relative to prior memories. It's written-- They're written greedily for that task at hand.

Host 12:57 Mm-hmm.

Host 12:58 In the human brain, we use dreaming to-

Host 12:59 Mm

Host 12:59 ... consolidate the memories that we write over the course of the day with our overall knowledge. So what's really interesting and what I really like about Managed Agents is it has an encoding step where you can write memory using our file store, but there's also a dreaming process that runs independently offline-

Host 13:15 Mm

Host 13:15 ... that allows those memories to be reconsolidated, de-conflicted, and this I found from a bunch of experiments along these lines, is a very important architecture for memory because if you only have an encoding step, you end up with a memory store that's extremely incoherent.

Host 13:29 Mm-hmm.

Host 13:30 'Cause it's basically Claude writing memories greedily, independently across lots of different tasks with- without ever some kind of consolidation step.

Host 13:37 Yeah.

Host 13:37 And so this combination of encoding at runtime and consolidation in via dreaming, which our dreaming API supports, is, I think, very interesting.

Host 13:46 It's kind of like, uh, when you see a file that Claude edited a couple of times, you always see the, the intermediate edits that it's making-

Host 13:51 Yes

Host 13:52 ... and you can kind of tell where-

Host 13:53 Yeah

Host 13:53 ... where things change. So this kind of helps with, like, what? Consolidating that?

Host 13:56 It does. And so there, there's, uh, I've run a lot of different evaluations showing this. I'll give a fun example. So I've been doing a lot of long horizon gameplay using Claude Managed Agents in Pokemon, okay?

Host 14:05 Okay. [chuckles]

Host 14:05 So basically, I have this classic example from Claude plays Pokemon where, uh, Claude writes an incorrect memory about the location of a, of a particular thing, okay? This is without dreaming. Claude hits this point in the game and always gets-- maybe falls into a trap. And so this erroneous memory can get, like, locked in, so you have, like, basically an incorrect memory that persists. With dreaming, it can actually look at the past session logs, end this incorrect memory, and fix it. So I've shown very consistently that when you have dreaming enabled, this particular incorrect memory gets fixed and Claude proceeds in the game.

Host 14:37 Mm.

Host 14:37 So it's almost like if you look at game progress, with this incorrect memory, it always falls off, and but with, with dreaming enabled, the memory's resolved and gameplay is like proceeds much, much more, like, basically past that particular trap point. So it's a good example of, like, just from trivial gameplay, incorrect memories can get locked and fixed. This dreaming step allows you to basically find and correct those errors.

Host 14:59 Mm.

Host 14:59 And in particular, it does this because it's looking at prior session logs in conjunction with the memory store. So it can look at, here's what actually happened and here's what it wrote to memory, and it can fix things.

Host 15:10 Got it.

Host 15:11 Memory and dreaming is one of my favorite examples of where I feel like we built our platform in a very future-proofed way, right? Because I think when we first launched memory, we were still experimenting with its performance at scale, still running the evals. I don't think we maybe had as deep of an understanding and/or as much clarity on these kind of pitfalls that you're mentioning. But we did know that versioning and, like, a proper audit trail was incredibly important for general performance management of memory. And then, so when we launched dreaming, we already had this platform that very clearly understood the idea that memory evolves over time.

Host 15:47 Right.

Host 15:47 And so it became very natural to slot in dreaming, um, which it-- which is just a, a triggered evolution rather than a natural one, um, into this platform that sort of already supported the idea that, uh, you know, that change was, uh, going to be persistent across memory.

Host 16:05 Yeah. It's a good point, 'cause in my gameplay, the dreaming process is triggered kind of on a schedule after some number of rounds of gameplay. It just runs on a cron, it runs offline, Claude's playing, and then this dreaming process is just kind of running-

Host 16:17 Mm-hmm

Host 16:17 ... and fixing the memory store as it goes.

Host 16:19 Yeah.

Host 16:20 Well, thanks, uh, great to talk to you guys about all this.

Host 16:22 Yeah. This was, this was fun. I had fun.

Host 16:23 Yeah. [outro music]

Episode duration: 16:28

In the uListen app, the transcript lights up word by word as you listen. Get uListen

Transcript of episode 8Aoq6mJeAXI

Get more out of YouTube videos.

Read along on your phone, search it beside the video, or ask your favorite AI app what was said.