It has been a while since I wrote a new article.
I had originally planned to write a series of articles on developing Agents. But after spending the past six months developing Agents intensively and using them in real-world scenarios, I have found that simply explaining how to develop an Agent no longer means much.
It is better to have a code agent read the code of open-source agent or harness projects and follow how their approaches change and evolve than to read static articles.
The discussion around multi-Agent organization has developed considerably since the beginning of the year. In my practice, however, there are only three types of Agents:
- Neighbor: another independent Agent.
- Clone: inherits from the parent Agent itself and performs a task within a single topic.
- Sub-agent: a child execution unit launched to complete one part of the work.
Why three types?
An Agent type is only worth having if there is a reason for it that no other type can replace.
In different scenarios, an Agent's work has different context requirements. Therefore, dividing Agents into types is, in essence, a way of dividing context.
What is context?
It is the information an Agent carries while running in order to complete a task. The range of context each type can see is different.
| Context level | Content | Another Neighbor | Another Clone | Another Sub-agent |
|---|---|---|---|---|
| Agent level | Identity, memory, logs, contacts, configuration | Uses external tools or Agent Link | Shared | Only if included in the instructions |
| Topic level | History, associated workspace | Uses external tools or Agent Link | Not shared | Only if included in the instructions |
| Task level | Current working state | Not shared | Not shared | Not shared |
The division of context and the corresponding Agent types are therefore as follows:
| Context level | Type | Reason for existence | Applicable scenarios |
|---|---|---|---|
| Agent level | Neighbor | Requires an independent identity and state | The work belongs to a different set of memories, personality, or owner |
| Topic level | Clone | Has an independent goal | A person or an Agent may return to continue this work in the future |
| Task level | Sub-agent | Is part of a goal | The result matters more, and the context that produced it can be discarded (though it does not have to be) |
Neighbor
Initially, the discussion was about networking multiple Agents together, that is, a neighborhood. The outcomes of that discussion included small teams of AI-assigned roles, the "Three Departments and Six Ministries" system, and so on.
In terms of behavior, they are independent individuals. If they share context with one another, it resembles communication between people and requires external tools.
Typical forms include adding multiple Agents to Slack or Discord and letting them communicate and collaborate with one another, as well as the earliest version of Raft.build.
Like many others, I thought at the time that imitating the human form might be the right one, so I also built Aqua to construct an agent swarm. But I soon realized this was wrong.
Consider the following scenario:
After AI arrived, 10 human employees at a company were laid off. But they were not replaced by 10 Agents. There may be only one Agent, doing the work of 10 humans.
When it works, it does not necessarily need 10 clones in every scenario. The need for 10 clones comes from human physical limitations. In practice, today's work may need only 2 clones, and tomorrow's may need 24. The number of clones actually required differs according to each day's workload.
This is difficult in a human organization. A company cannot have 2 people today and 14 people tomorrow.
Moreover, synchronizing and aligning information has a cost, for humans and AI alike. We might see a conversation like this:
Backend: blah blah blah ... API blah blah
Frontend: What API are you talking about?
Backend: It's defined in the file /Users/alice/.../api.md
Frontend: That file is on your machine, and I don't have it. Please send it to me.
Backend: [file: api.md]
See, this puts human shackles on AI.
Humans take almost entirely this form because they have no choice. AI does have a choice, which is why Clones and Sub-agents exist.
So is this kind of Neighbor network, with its fixed roles, of any use?
From the standpoint of meeting specific human needs, yes. Consider the following two scenarios:
Scenario a. Give each agent a Claude Code instance to share the development load. Claude Code subscription accounts have a 5-hour usage limit and a weekly usage limit, so multiple agents are needed to form a neighborhood. Each agent is paired with a Claude Code instance, and external tools such as Git are used to share task context and complete development tasks.
This neighborhood exists to work around the limits of Claude Code subscription accounts. If one day money is no object and I use the API directly, there will naturally be no such limits, there will be no need for multiple agents, and this scenario will disappear.
Scenario b. Set up two agents, one as a family assistant and one to banter in a group chat, deployed on two separate machines so that they are physically isolated. This prevents any group member from bypassing prompt safeguards to steal the family's private information.
This neighborhood exists to solve the problem of state boundaries, so by the definition above, neighbors are appropriate here.
Clone
Within a single Agent, the executor of every running task is a Clone.
Clones share the same personality, memory, and toolset.
They differ only in the Topic each works on and the different context that comes with it.
In most cases, Clones are the best alternative to a Neighborhood.
There are, however, two misconceptions:
- The way a Clone is launched is an attribute, not a different Agent type. For example, when a scheduled job starts a task, the one executing it is still a Clone.
- The Model a Clone uses is also an attribute, not a different Agent type. For example, one Clone uses a Claude model to write code, and once it finishes, it triggers another Clone that uses a GPT model to review the code. Both are Clones derived from the same Agent.
Sub-agents
When part of a goal is better done in an independent context, a Clone launches a Sub-agent.
What this part of the work reads and the methods it tries never enter the parent Clone's context; only the final result is returned to the Clone. Correspondingly, the Sub-agent cannot see anything in the parent topic unless it is explicitly included in the instructions.
For example, suppose we run a task that translates an article into 18 languages. The Clone naturally launches 18 Sub-agents, each responsible for translating into one language. After the translations are complete, the Clone collects the results from all 18 Sub-agents and consolidates them.
So context flows as follows: instructions are passed down, and results are returned up.
When the task ends, the parent retains only the execution result. The run record can keep the complete log for auditing, while the Sub-agent's working context is discarded.
The Difference Between a Clone and a Sub-agent
A Clone and a Sub-agent may look similar, because both are launched by an Agent to get work done.
The difference lies in goal and context.
In terms of goal, a Clone's work has an independent goal, whereas a Sub-agent's work is often part of its parent's goal.
Take the translation example mentioned when introducing Sub-agents. Each Sub-agent's goal (translating the article into language X) is part of the parent goal (translating the article).
In terms of context, a Clone's working context is more valuable, and one purpose of a Sub-agent is to avoid polluting the Clone's context.
For example, suppose one step in a task requires a sub-agent to fetch a web page's source code and summarize it. The source code does not help execute the task, so letting it into the context window would only pollute it, consume more tokens, and mislead the Clone. Once the sub-agent has finished fetching, the source code can simply be discarded, which avoids this problem.
Special Handling in Morph
Solo Mode
In Morph, there is one special, unique Clone called the Solo Clone.
Here is an example of how it is used:
Code for different projects is organized in different folders, but each topic can be associated with only one folder. To switch between projects, you can manually switch between topics.
Solo Mode is another path. The Solo Clone switches topics on the human's behalf, launching and calling other Clones to carry out the work belonging to their respective topics.
So in essence the Solo Clone is the same as any other Clone: it works within a topic, only the content of the work differs.
The reason for this design is that Solo Mode is a product design aimed at humans. Sometimes it is difficult for humans to search for and manage sessions.
For an AI, however, the Solo Clone is largely unnecessary.
Calling External Agents from a Sub-agent
In Morph's engineering practice, a Sub-agent can run on one of two execution engines: the spawn tool, which is Morph's own engine, or the coder tool, which is an external Claude Code, Codex, agy, or Grok.
There are two reasons for this design:
- In my use cases, for programming tasks, these specialized Harness CLIs are better at coding than Morph's own execution loop.
- The ACP protocol and
claude -pdo not satisfy Morph's Topic management well, and reading the TUI through a pty is explicitly prohibited, which is unacceptable in my use cases. So, as a second-best option, external Agents enter Morph as coders.
If a better approach emerges in the future, having external Agents work directly at the Topic level would be the better choice.
Do We Really Need Multiple Agents?
If context becomes extremely large, is there no longer any need for context management, and therefore no need to distinguish these types of Agents?
I think the answer is yes and no.
Context management affects attention, so it will probably still be needed. But dividing work among Agents is only one means of context management. If better means emerge in the future for reaching goals and solving problems, perhaps multiple Agents will no longer be needed.