Problem: teams of AI agents are often designed up front, with roles chosen because they sound sensible, and the result is more handoffs and more checking without better output. Result of this article: a short script that reads a log of corrections made to a single agent and says which areas deserve their own agent and which should stay. Stack: plain Python 3.10+ (tested on 3.15.2), no external packages. Boundaries: the areas and the log are invented for teaching; the thresholds are judgement and should be tuned to your own case
The rule behind it
A task deserves its own agent when it repeats systematically and needs its own knowledge base, memory and tools. The practical warning sign is a single agent that starts mixing up its rules: writing rules interfere with image rules, memory grows, and answers become average at everything. If you keep correcting it in one area, that area is the candidate
The opposite case is common too. My personal agent, Jes, runs 10 scheduled jobs on her own and hands other bots only work that needs a separate skill. Splitting her would add handoffs and give nothing back
When splitting does pay off, it looks like my content team: 8 agents on one server with clear roles. The marketer, copywriter and designer each work in their own Telegram topic. A program collects 20 live questions people ask AI and 10 topics each morning, the marketer adds what worked yesterday, the copywriter offers three headlines and I choose, and the designer draws only after my yes. Over three months the team has produced 80 morning briefs and 94 images, and nothing is published without my approval
The script below is a teaching version of the decision that comes before a split. It is not code from that team
Input, processing, output
Input: a set of work areas, each marked with whether it repeats weekly, has knowledge of its own and has tools of its own, plus a log of which area each correction touched
Processing: corrections are counted per area. An area qualifies for its own agent if it repeats weekly, has its own knowledge and takes at least a quarter of all corrections. Areas that fail any test stay in the main agent, with the reasons listed
Output: one line per area, from most to least corrected, with the verdict and reasons
The example
from collections import Counter
from dataclasses import dataclass
@dataclass
class Area:
name: str
repeats_weekly: bool
own_knowledge: bool
own_tools: bool
AREAS = {
"text": Area("text", True, True, False),
"images": Area("images", True, True, True),
"calendar": Area("calendar", True, False, False),
"invoices": Area("invoices", False, True, True),
}
def candidates(corrections, areas, min_share=0.25):
counts = Counter(corrections)
total = len(corrections)
out = []
for name, n in counts.most_common():
a = areas[name]
share = n / total
missing = [label for ok, label in (
(a.repeats_weekly, "does not repeat weekly"),
(a.own_knowledge, "no knowledge of its own"),
(share >= min_share, f"only {share:.0%} of corrections"),
) if not ok]
out.append((name, n, share, missing, a.own_tools))
return out
if __name__ == "__main__":
for name, n, share, missing, tools in candidates(CORRECTIONS, AREAS):
verdict = "split into its own agent" if not missing else "keep in the main agent: " + ", ".join(missing)
extra = " (own tools too)" if tools and not missing else ""
word = "correction " if n == 1 else "corrections"
print(f"{name:9} {n:2} {word} ({share:.0%}) {verdict}{extra}")
Output, exactly as it printed when I ran it:
images 6 corrections (50%) split into its own agent (own tools too)
text 4 corrections (33%) split into its own agent
calendar 1 correction (8%) keep in the main agent: no knowledge of its own, only 8% of corrections
invoices 1 correction (8%) keep in the main agent: does not repeat weekly, only 8% of corrections
Reading the result
Images and text both qualify, which matches the common content split into a designer and a copywriter. The designer needs the meaning of the post and the image requirements, not the writing rules; the copywriter needs style rules, examples and a memory of corrections. Calendar work stays with the main agent because it has no knowledge of its own and is rarely corrected. Invoices stay because they do not repeat weekly, even though they have their own knowledge and tools
Design notes
Count corrections, not opinions. The log should come from real work with one agent, not from a list of roles that sound useful
Split one area at a time. Each new role adds a handoff, and handoffs are where most problems in agent teams happen. If the designer starts from a draft and the text changes later, the image stops matching
Define the handoff with the role. Which version moves on, and who checks the finished pair. In my team a person decides at three points: the headline, the go-ahead for the image and publication
Re-run after the split. If corrections in the split area did not drop, the problem was the rules, not the mixing of roles, and the new agent will not fix it
Errors and trade-offs
Small logs mislead. A dozen corrections is enough for a teaching example; a real decision needs a few weeks of work
Not every correction is equal. A wrong price matters more than a clumsy sentence. Weight corrections if severity varies a lot
Setup cost is real. A team takes me about 2–3 weeks to launch, mostly roles, rules, memory and handoffs. A clinic I work with runs a team of 6 agents the same way on the owner's server
How to reproduce the check
- Save the example as
roles.py - Run
python3 roles.pywith Python 3.10 or newer - Compare the output with the block above
- Replace
AREASandCORRECTIONSwith a few weeks of your own corrections and run it again
For the business version, with how the copywriter and designer are set up, see multi-agent system for business: when to build a team
This article was created with the help of AI.



Top comments (0)