0:00 / 0:00

Run Subagents In Parallel

From the course: Agentic AI For Founders & Senior Operators

A subagent is a mini chat session started inside your main session. Without subagents, one agent works through tasks one after another, which is slow and keeps filling its context window. With them, the main agent hands each task, like your email, meeting notes or analytics, to its own subagent running in parallel, and each sends back a summary for the main agent to pull together.

Transcript

So you have a chat session. A chat session is an agent. A subagent is a mini chat session that you start within that main chat session, okay? And the way you do that, and this is actually how a lot of production AI apps work as well, they distribute work to a bunch of little, little agents and I'll show you how to do that and why you do that and so on. But the broad workflow splits into two ways of doing work. Okay, so let's say we have this prompt: "Prep my day, go through my email, pull yesterday's meeting notes, run the live analytics." So let's say you want to do this competitive brief, whatever your work is, right? The way it works without subagents, which is maybe how it works right now for most things that you've been trying, is it'll go sequentially, right? So it does a task, then it does another task, then it does another task and two things happen. One is your context window keeps filling up. And the other is that it is super slow. So like for me, if I'm doing something and if I only use one agent, then I won't get anything done. Like just even before this class, I had to build out this little piece on my website and I had to edit a video and I had to do a bunch of things. And if I just do it in one session, it's slow and the context window accumulates. So what a lot of these apps now have is this thing called subagents that help you with parallel processing. So what you could do is you would have your main agent, which is the session you're talking to, okay? And then Claude can dispatch three subagents individually. So mini chat sessions within the main session, one will get your email, one will pull your meeting notes, one will pull your analytics. These are just examples. It can be anything at all, any task you're working on. And then each subagent sends back a summary to the main agent. So this agent is basically the orchestrator. It's like the boss agent. And for some reason people call it the fat agent. So the fat agent sends off these little minions to do work, summarizes everything and then proceeds forward.