Code Story · Transcripts

S11 E24: The Agent Swarm Architecture: Moving Beyond Single-Prompt Bots to Orchestrate 5,000 Parallel AI Agents Safely in Production with Mrinal Wadhwa, Founder & CTO of Autonomy

November 4, 2025 · 30:50
Listen to the episode Download .txtDownload .vtt
Mrinal Wadhwa

So by choosing this actor Model Based Design, we're able to spin up thousands of parallel agents in a single tiny container. So once we made the right design decisions, we tested how many agents can we spin up in a single 250 MB container, and it turns out tens of thousands. Then we were like, okay, we have this ability to spin up tens of thousands agents in a single container. Ockam allows us to connect securely several containers together. So how many agents can we spin up in parallel across a distributed fleet of containers that are connected using Ockam? And turns out hundreds of thousands, even millions. My name is Mrinal Wadhwa. I am CTO and co-founder of Autonomy.

Noah Labhart

This is Code Story, a podcast bringing you interviews with tech visionaries. It's six months moonlighting.

Mrinal Wadhwa

There's nothing on the back end. Who

Noah Labhart

share what it takes to change an industry. I don't exactly know what to do next. It took many goes to get right. Who built the teams that have their back.

Sound bite

A company is its people. The teams help each other achieve more. Most proud of our team. Keeping scalability top of mind. All that infrastructure was a pain. Yes, we've been fighting it as we grow. Total waste of time.

Noah Labhart

The stories you don't read in the headlines. It's not an easy thing to achieve. Took it off the shelf and

Sound bite

dusted it off and tried it again.

Noah Labhart

To ride the ups and downs of the startup life.

Sound bite

You need to really want it. It's not just about technology.

Noah Labhart

All this and more on Code Story. I'm your host, Noah Labhart. And today, I'm Mrinal Wadhwa, is enabling developers to ship autonomous products from agents build to deploy in 10 minutes. Mrinal Wadhwa grew up in India with a dad in the armed forces, so he moved around a lot. His mother was a teacher for 40 plus years and greatly influenced his love for teaching. In addition to this, he grew up loving to build things. He was introduced to computers and the internet by his cousin, and at that point, he was hooked. But outside of tech, he is married and enjoys attending concerts in the Bay Area. He plays pool very seriously. He's the guy carrying the little bag into a party with his own pool stick. Mrinal is one of the minds behind Ockam, a popular open-source Rust toolkit to build secure communications between applications. Late last year, he observed people desiring to build the layer between agent communications and set out to build something to do it the right way. This is the creation story of Autonomy.

Mrinal Wadhwa

Autonomy is a platform for developers to build and ship autonomous AI products. You can find us on autonomy.computer. That's our website. And what it does is it's a tool for developers to to run products for AI products for other people, right? Not build a personal script, but build a product that you want to give to customers. Now, these customers might be internal to your company or external facing customers, but it's about building these like reliable, scalable, secure products that you can be responsible for towards your customers. And the user experience of it is getting simpler and simpler by the day, But right now, for example, what you can do is write a little prompt in Claude Code and say, hey, here's a reference to the autonomy documentation. Build a app for me that uses AI agents to fact check news items or it uses AI agents to automate a recruitment process. So you can give these little prompts and you drop it into a coding agent like Claude Code or Cursor or something like that. And 10 minutes later, because you've given it that reference to our documentation, 10 minutes later, you will have a live product on the internet with a public URL, a set of APIs, streaming APIs. Under the hood, it's a multi-tenant product. So you have baked in kind of scope, isolation, user management, et cetera. You also get underlying databases managed and scaled for you. And you can create these massively parallel multi-agent fleets in this environment. So it's really good at scaling and connecting to various places where data might live at a company, like internal databases and things like that. So that's what autonomy is. It's a tool to build this new generation of products. Before Autonomy, a few years ago, me and my co-founder, we started an open source project called Ockam. And Ockam is a really popular Rust library to create end-to-end encrypted, mutually authenticated, secure communication between systems or applications. So think of it like WhatsApp, but for applications talking to other applications. And these could be applications in one cloud talking to another application in a different cloud. It could be distributed parts of the same application talking to each other across clouds or across companies, etc. So we built this Rust toolkit, which was Rust as a programming language for developers. And so we built this toolkit that developers could integrate into their applications and build any kind of distributed communication system. And what we started to see is lots of developers were applying it to various problems from cross-cloud communication to connecting to internal data sources or connecting to customer data sources. Like a really common use case was SaaS applications connecting to an internal database at a customer to enable that customer to use the SaaS application or in a fruitful way. And late last year, we started to also see some of our customers think about building agents and AI products and enabling the sort of the communication aspects of that using Ockam. And that's when we started to think further about, look, we could, if we do it ourselves, we can polish this user experience and make it really easy for our customers. And that's then started the journey towards building autonomy.

Noah Labhart

I'm curious about the MVP process then. So that's a perfect segue, perfect timing into that question. What was the process of building the MVP? How many, you know, how long did it take? And what sort of tools were you using to bring it to life? Obviously using Ockam, but I'm curious about anything else, you know, any sort of screwdrivers and hammers you were using there.

Mrinal Wadhwa

So our starting point was we had a bunch of things we've built around Ockam, which gave us a communication fabric, a secure communication fabric. But then there was a lot more that we had to build on top. From the get-go, our key thought process was that we'd like this to be a highly scalable and secure place to run this next generation of products. So we started thinking about what features should such a thing have? And some of the features were really obvious. Okay, AI agents are starting to become a thing. So we need a mechanism to run for a developer to define what an agent is, how does it work, how does it use a language model, we need a place to serve language models and things like that. So this part was fairly obvious. And the main choice we had to make there was, okay, which language do we expose this capability in? And we landed on Python, because that is a really popular language for people building AI things. Over time we might add more languages, but currently we chose that we'll make our framework for developing AI agents and autonomous applications. We'll provide that framework in Python. But in that environment, there is a key important kind of scalability decision we made early on. We chose that each agent in autonomy will be an actor, as in the actor model. An actor model is a design pattern developed in the 70s, and it's used in very highly scalable systems. Apache Spark uses the actor model. Discord uses the actor model. WhatsApp uses the actor model in the background. So these are like highly scalable concurrent systems in which a lot of entities are talking to each other in a very kind of streaming messaging oriented way. And so a key design decision for us very early on was those properties are properties agents should have because agents are these long-lived concurrent state machines. And you might want to run, for most applications, many of these agents. We chose to build agents in a way that they could be actors and we could create thousands of parallel agents really easily and cheaply. So to do that, we built a, in Rust, we built a actor runtime. And we wrapped that actor runtime and the Ockam communication capabilities together with a Python kind of wrapper. And that's what became our framework for building and defining autonomy applications, our autonomous applications, right? So what that enables for a developer is without writing much code, they can define an agent. This agent becomes a stateful actor. You can run many replicas of these agents. So the end result is that an agent can create thousands of sub-agents to achieve a job faster. It's also really good for keeping context in an agent really small. So that was a key design decision. And then along the way, we made some other decisions. We're running in AWS. Primarily, currently, we'll add multi-cloud support later. And in AWS, we're running on their Kubernetes offering, EKS. And we do isolation with things like Fargate.

Noah Labhart

So then from that point, you've got the MVP and it's working. You've chosen the tools. You've got it up and being able to service customers. How did you progress and mature the product from there? And I think to wrap that in a box a little bit, what I'm looking for is how did you build your roadmap? How did you decide that, okay, this is the next most important thing to build or to address?

Mrinal Wadhwa

is. So we had this like minimum viable thing where we were able to define a made up agent to do something. I think initially we started thinking of internally in the team, we were using examples because an agent that does translation of documents. And if it's given a lot of documents, it can split up that work into thousands of parallel things and translate thousands of parallel documents in a few seconds. So these were our initial examples. But you're right, Like, we didn't know if we're building the right thing and should we continue in this direction? What are we doing? Pretty early on, we started reaching out to people in our network, friends, etc. And talk to them about what type of agents or agentic products are they thinking about building. And we found a few interesting scenarios through these conversations. So the first two to two and a half months were us building in isolation, minimum demo-able thing. I wouldn't even call it viable. It was minimum demo-able thing that we could go show to someone so it would evoke their ideas. And then from there, as they shared their ideas of what they would like to build, we worked with them to build these things. The first customer we found, they were a bank. a loan processing agent, like a loan application document processing agent. So because we showed this like document processing example, they immediately went down this case of, look, we have these loan officers that receive phone calls. And during those phone calls, they're given hundreds of documents about a business to decide whether to give the business a loan or not. And currently, we're unable to use those documents in real time and make a really is this a person we want to issue a loan to or not? And so the example you've shown, if it could be transformed into this like parallel document analysis for loan applications, then it could be very useful for us. So we built that. And as we built that, we learned that we had not exposed some of the correct APIs or we needed to tweak our interface, the library's interface a little bit, et cetera. So we had these learnings. And three weeks later, we went back to them with a working example. some really cool things started to happen. What we noticed is that this director of engineering at this bank decided, okay, you've given me something working, I want to adapt it. And they immediately pulled up Cursor and started improving the example that we'd given them and deploying it. And so what we noticed is that people are entering this new age of building with coding assistants. This was about five, six months ago. And so immediately at that point, that we should make it so that our documentation is really usable and friendly to coding agents like Cursor at the time, but later on, Claude Code and Gemini, et cetera. And that has worked out really well. And so as we went to more customers, instead of giving them a working example, we started giving them these little example prompts. And we said, hey, why don't you go paste this into your Cursor or Claude Code and see what gets built and deployed. It takes 10, 15 minutes. then adapt it the way you want. And that has worked out really well. So in refining our user experience and getting to this state where we feel like it's a minimum viable thing, this was an iteration of working with five or six different early customers around their specific problems, but in this kind of new way. And so a month ago, when we finally announced autonomy, we already had five customers live in production, applying agents for various use cases from banking to pharma to recruitment and some other use cases.

Noah Labhart

I hear you saying we a lot. Tell me about how you built your team. What do you look for in those people to indicate that they are the winning horses to join you?

Mrinal Wadhwa

Good question. So we are tiny at the moment. It's me and my co-founder. We met a few years ago and we were strangers at the time, but we met because we were saying the same things online about the problem of identity in distributed systems and this like challenge of like, how do you enable trust in a complex distributed setting? And so we really connected on that. Some of the thoughts, both of us had shared online. And then when we met in person, we were like, okay, we're thinking about very similar challenges in the world. Let's go together and try to build something that goes and addresses this challenge. So that's what started the Ockam Open Source Project. We built a really nice community around it. It has, I think, 320 or 330 different contributors so far and a much larger community that's using it. And so part of building the team was nurturing and engaging and encouraging that community aspect. But we also built a team of developers around Ockam that as we transitioned over to autonomy, they've moved on to doing other things. And we're building autonomy from scratch as a new company. But yeah, that's been our journey so far. So far, we're just two people.

Noah Labhart

So let's move into scalability, because it's so early. Maybe this is still interesting based on what you're building, and I'm curious if you've already run into areas where you've had to you know, fight scale as you've grown.

Mrinal Wadhwa

Yeah, definitely. From the get-go we decided we want to build for scale use cases, and so we wanted to convince ourselves that the architectural approaches we were choosing really did lend themselves well to scale. So the counter example, if someone was not using autonomy, what they would be doing if they're building a application with lots of users that has agents is they would probably assemble a messaging infrastructure. So maybe use some real-time messaging thing like Amazon SQS or Kafka. So they'll place this messaging infrastructure in the middle. And then they'll try to consume messages off this messaging infrastructure in either containers running in Kubernetes that they've provisioned themselves or things like AWS Lambda and react into it. So this is the thing that a lot of people that are building and deploying agents currently are doing. We wanted to take a very different approach because what they're doing has really, really hard scale boundaries, right? So if you do that, first of all, you have to know how to provision a complex messaging infrastructure, design an app in an event-driven distributed messaging way. And then you have to provision a lot of underlying infrastructure, either run a complex Kubernetes environment or run things in Lambda. But then as you try to scale, sure, you can run a few hundred agents easily. The moment you get into thousands of agents, it starts to get really hard because in Kubernetes, you're running thousands of containers at that point. Or in Lambda, you're provisioning thousands of little Lambdas. And then you start hitting another problem is that agents by their very nature are not like apps everybody has used to building in the past. A three-tier web app only consumes a few milliseconds of compute time on a server, whereas an agent is a long-lived thing that runs for minutes, hours, or days. And infrastructure like Lambda isn't really designed for that type of thing. In fact, AWS will, if you run a Lambda longer than like a few seconds, AWS will actively kill your Lambdas. That is a set of constraints the world without autonomy was dealing with. So our choice was, how do we design autonomy in a way that those constraints go away? And so by choosing this actor model-based design, were able to spin up thousands of parallel agents in a single tiny container. So that's when we started, okay, can we do that? So once we made the right design decisions, we tested how many agents can we spin up in a single 250 megabyte container, and it turns out tens of thousands. Then we were like, okay, we have this ability to spin up tens of thousands agents in a single container. Ockam allows us to connect securely several containers together. How many agents can we spin up in parallel across a distributed fleet of containers that are connected using Ockam? And turns out hundreds of thousands, even millions, in a few seconds, they spin up. They can work on a task entirely in parallel and then spin down. And so we, of course, did a lot of measurement around, does this all work or not? And because of the work we'd already done with Ockam, we also knew that we could move data, even though it's end-to-end encrypted data, at really high throughput and low latency. So that combined effect was that if you take a problem of analyzing lots of documents or running, let's say one of our customers is building a voice recruiter that conducts first-round interviews. So if their voice recruiter is conducting a thousand interviews in parallel, You need thousands of stateful agents running long-lived, one-hour-long interviews in a voice-based streaming way. And so we ran tests of can we support that type of use case and it turns out very easily. And similarly, can we process lots of documents very quickly with a different customer that is analyzing videos and images, like over a petabyte of videos and images. And they're able to use autonomy to do a parallel, almost MapReduce-like, distributed, agentic processing of thousands of images in only a few minutes, which before autonomy would simply be impossible. So, yeah, we've been dealing with a lot of scale challenges.

Noah Labhart

As you step out on the balcony and you look across all that you've built thus far with autonomy, what are you most proud of?

Mrinal Wadhwa

I think my proudest moments have been like delight, seeing the delight of customers. And it's, it's everything around AI and agents building things on their own and achieving complex goals on their own is all so new that every time there's like a success, even though we all, we built it, we know it should work because we've seen it work before. Every time someone successfully is able to achieve the goal. It's very exciting to me personally, but it's even more exciting when I get to see others experience that delight. So for example, a week ago, Autonomy hosted a hackathon in San Francisco in the Ferry Building. And there were 150 developers here at the hackathon. And over a period of five or six hours, I saw several of them build and ship and make a live application using autonomy. And in many cases, I saw that like moment of delight of almost like multiple times people were like, oh, it worked and it's live. And all I did is type two sentences. So it's pretty amazing when that happens.

Noah Labhart

Let's flip the script a little bit. Tell me about a mistake you made and how you and your team responded to it.

Mrinal Wadhwa

The world around agents is evolving rapidly and understanding of what is the right way to build these types of applications is also evolving very rapidly. We made several kind of architectural choices that had to be corrected. For example, initially we thought that we will have long-term memory and we will keep the entire history of the conversation an agent is having with its LLM in a loop. And we keep feeding that history back to the LLM. And it seemed to work initially. Like in our initial prototypes, when you have agents that only need to do, only need to autonomously take five or 10 independent steps, that approach works really well. But if an agent needs to take 500 independent steps, if you keep all the history of the conversation it's been having with its LLM and with its tools, and you feed it back in, 10, 20, 30 iterations in, it's too much information to feed to an LLM. It's too noisy. And there's a term now in the industry around it, like it creates context rot. So what ends up happening is that the LLM gets confused and makes a wrong turn. And it makes a wrong turn and then makes another wrong turn. The problem continues to compound and the agent is never able to achieve its goal. So the learning from that was actually what we need to do is prune and trim very carefully what we send to the LLM in each iteration of the agent's loop. And if we do that well, we can have agents that are able to coherently work towards their goal over many hours. So I earlier gave that example of that interview agent that conducts first-round voice interviews. What we saw was like, you know, it'll ask two good questions or three good questions But at the fourth or fifth question, it would start to steer the interview in some completely incorrect direction. And the reason was it had too much noise in its context. And so once we had this realization that we need to be careful about what we put in, we were able to run hour-long interviews. So this is just one example of the type of mistake we made along the way, but there were several others.

Noah Labhart

Mrinal, this will be interesting. And this will be really exciting to hear the passion in your voice, which is already coming through in the whole interview. But I'm curious about what the future looks like for autonomy, for the product, the company, and for your team.

Mrinal Wadhwa

About a year ago, we started to see website builders that were autonomous, right? So we saw examples like Bolt and Lovable and v0 and some others, where they could pull together a website almost on their own. You gave it a little prompt and it pieced together a website. But it had all sorts of challenges. It's not a website you can build a company around. Maybe you can use it for some prototyping, gathering feedback, etc. But if it's a critical product of your business, you can't have it change behavior randomly, or you can't have mistakes in it. You want very precise control over how it looks, feels, behaves. and that so far hasn't been that easy to do in this kind of new way of building things but that's changing and autonomy is a good example of this there are other people building, working towards this goal as well. I feel like Claude Code is a good example of this evolution and so what i'm excited about is this possibility that where we're able to build and iterate on products that are stable, production-ready, highly secure, and scalable in this kind of new approach of talking to the computer rather than writing all the code ourselves. But by no means do I mean that that takes away the thing I love to do, which is build software, right? Like, it's a lot of programming, engineering, thinking about systems, thinking about architecture is still very critical to success in this new way. But maybe we won't be typing a lot of it anymore. We'll instead drive these agents with either voice or other kind of spec-driven instructions. But I think that architecture is still very important. In fact, it's critical to success. But what's exciting to me about this kind of change is it's easy to iterate and see the parts that lead to mistakes because you can very quickly create five variations of an approach. Or try five different approaches and see which ones leads to the right result. Whereas earlier in the old way of building software, we would have to spend weeks trying out each experiment. So I'm very excited about this new way of building software, which I think that borrows from skills that software engineers have built and developed over the years. And those skills are critical, but at the same time, it unlocks new possibilities to build more powerful, scalable things.

Noah Labhart

Okay, Mrinal, let's switch to you. Who influences the way that you work? Name a person or many persons or something you look up to and why.

Mrinal Wadhwa

My parents are a big influence. They have a very sincere, dedicated work ethic. And that has been quite an influence throughout my career. Publicly, I learn a lot from my co-founder all the time. We spend a lot of time together chatting. He has a lot of experience with the Azure team before this and Heroku before that. I also try to find smart people online that have good balanced views because there's also a lot of like extreme views online these days. But good balanced views on how to evolve and learn in this kind of changing world. Yeah, there's some ways of learning.

Noah Labhart

Mrinal, last question. So you're getting on a plane and you're sitting next to a young entrepreneur who built the next big thing. They're jazzed about it. and kick my shit off to you right down the plane. What advice do you give that person having gone down this road a bit?

Mrinal Wadhwa

Entrepreneurship is a long journey. If you look at like the, I don't know, Twitter or LinkedIn or whatever, right? It's important to note that world is heavily influenced by like selection bias, right? So what you hear is one in thousand, one in, I don't know what the right ratio is. Maybe it's one in 10,000. One in 10,000 company that ends up raising or one in a hundred thousand company that ends up growing their revenue at an extremely fast rate or whatever. But it's those stories get amplified so much online that it feels like that's the journey all entrepreneurs have. And that's not the case. I know so many friends who are entrepreneurs and even my own journey. It's a slow ride. You have successes, you have failures. You learn along the way. But it doesn't mean you can't build a successful business taking that slow approach. It's a long-term commitment to that goal of I would like to build something, employ other people, create employment and opportunities for other people to build interesting things with me. I guess my advice to someone like that would be prepared for the more likely outcome, which is this is going to be tough and hard and will take a long time, many years. And if you're prepared for it, it is a transformative, learning-centric journey and a lot of fun if you take it from that, take it with that mindset.

Noah Labhart

That's fantastic advice. Well, Mrinal, thank you for being on the show today. Thank you for telling the creation story of autonomy. Thank you. And this concludes another chapter of Code Story. Code Story is hosted and produced by Noah Labhart. Be sure to subscribe on Apple Podcasts, Spotify, or the podcasting app of your choice. And when you get a chance, leave us a review. Both things help us out tremendously. And thanks again for listening.

Transcribed with Whisper and reviewed for names and terms; speaker labels are automatic and may contain small errors. Timestamps link to that moment of the transcript.