Multi-agent and Orchestration|INEMA.CLUB-PRO

Lesson 1 · 15 min

When NOT to use multi-agent

Every extra agent reads the context again, spends its own quota, and has to be coordinated. For most code tasks, a single agent, or subagents that return little, gets you more. In this lesson you decide before opening the second agent, using a matrix of signals that runs as a script.

Start the lesson
A lone screwdriver on a dark workbench, next to a closed toolbox.

In this lesson you will

  1. 1What a team costs: the published numbers and what they measure
  2. 2The 6 sequence signals and the 7 parallel ones
  3. 3The 2-point difference rule and the hybrid
  4. 4The matrix as a script, with your own tasks

Goal: decide between a single agent, sequence, parallel, or hybrid using the signal matrix, before opening the second agent.

01Before the second agent

Click each step. The matrix comes from the arquiteto-de-execucao kit (agenteexecuta).

Click each block in the diagram to see what it does.

The matrix is a starting point, not a measurement. It prevents the reflex of opening agents just because you can.

02The cost that doesn't show up in the request

What is published, with dates, and what each number measures.

1. Tokens

In Anthropic's post about its research system (06/13/2025): agents use about 4× the tokens of a chat, and multi-agent systems about 15×. The data is theirs, from a research product.

The Claude Code agent teams doc says the same without a number: a team uses significantly more tokens than a single session, and the spend grows with each active teammate.

03The matrix as a script

Write each task's signals in a file; the script adds them up and decides. No model involved: it runs for free.

Terminal · course training project (once)
git clone https://github.com/inematds/inema-agent-runtime.git ~/treino-multi
cd ~/treino-multi && git log -1 --format='%h %cs'   # testado em 5cb431b 2026-10-05
decide.py · save it in ~/treino-multi/
# decide.py — decision matrix of the arquiteto-de-execucao (inematds/agenteexecuta), in code
# Usage: python3 decide.py tarefas.txt
# tarefas.txt: one block per task; "# nome" opens the block; then, one code per line:
#   S1..S6 = sequence signals, P1..P7 = parallel signals,
#   simples = small task (the matrix does not apply), erro-caro = high cost of error
import sys

SEQ = {"S1": "depende da saída anterior", "S2": "contexto compartilhado grande",
       "S3": "decisões precisam ficar consistentes", "S4": "erro inicial contamina várias tarefas",
       "S5": "juntar versões divergentes sai caro", "S6": "uma etapa ensina a seguinte"}
PAR = {"P1": "tarefas independentes", "P2": "entradas congeladas",
       "P3": "cada saída se valida sozinha", "P4": "trabalho mecânico ou determinístico",
       "P5": "contexto pequeno por tarefa", "P6": "urgência alta", "P7": "há máquina sobrando"}

def decide(nome, cods):
    print(f"# {nome}")
    for c in cods:
        if c not in SEQ and c not in PAR and c not in ("simples", "erro-caro"):
            print(f"aviso: código desconhecido '{c}' (ignorado)")
    if "simples" in cods:
        print("decisão: direto (um agente só, sem matriz)\n")
        return
    s = sum(c in SEQ for c in cods)
    p = sum(c in PAR for c in cods)
    if abs(s - p) >= 2:
        d = "sequencial" if s > p else "paralelo"
    else:
        d = "híbrido"
    print(f"sequência: {s} · paralelo: {p} · diferença: {abs(s - p)}")
    print(f"decisão: {d}")
    if "erro-caro" in cods:
        print("custo de erro alto: planejamento e revisão centralizados")
    print()

nome, cods = None, []
for linha in open(sys.argv[1], encoding="utf-8"):
    linha = linha.strip()
    if linha.startswith("#"):
        if nome:
            decide(nome, cods)
        nome, cods = linha.lstrip("# ").strip(), []
    elif linha:
        cods.append(linha.split()[0])
if nome:
    decide(nome, cods)
tarefas.txt · four example tasks
# refactor the login module
S1  each step uses the previous one
S2  the whole module has to be in your head
S3  same names and contracts everywhere
S4  an error in the contract breaks the rest
erro-caro

# convert 500 .md files to .html
P1  one file doesn't depend on another
P2  the converter and the model are locked
P3  each .html checks itself
P4  it's mechanical
P5  each file is small

# market research across 4 segments
S3  the questions have to be the same
S6  the first segment tunes the questions
P1  independent segments
P5  little context per segment

# summarize a text in 5 lines
simples
Terminal · run
cd ~/treino-multi
python3 decide.py tarefas.txt; echo "saída: $?"
Example from the repository
# refatorar o módulo de login
sequência: 4 · paralelo: 0 · diferença: 4
decisão: sequencial
custo de erro alto: planejamento e revisão centralizados

# converter 500 arquivos .md para .html
sequência: 0 · paralelo: 5 · diferença: 5
decisão: paralelo

# pesquisa de mercado em 4 segmentos
sequência: 2 · paralelo: 2 · diferença: 0
decisão: híbrido

# resumir um texto em 5 linhas
decisão: direto (um agente só, sem matriz)

saída: 0

Converting 500 files is mechanical parallel work: a script with several workers and a sample check at the center (that's lesson 3). The market research came out tied: the first segment runs alone, the other three in parallel.

04Practice

First the example, then three tasks of your own.

E1 · The matrix in the example

10 min

Clone the practice project, save decide.py and tarefas.txt, and run it.

Done when: python3 decide.py tarefas.txt | grep -c "^decisão:" → 4, and the market research comes out as decisão: híbrido.

E2 · Three tasks of your own

20 min

Write minhas-tarefas.txt with three real tasks from your week (one you've thought about splitting between agents). Mark only the signals that are true today.

Done when: python3 decide.py minhas-tarefas.txt > decisao.md; grep -c "^decisão:" decisao.md → 3 and grep -c "^aviso:" decisao.md → 0.

05Lesson quiz

Question 1 of 4

According to Anthropic's post (Jun/2025), how many tokens does a multi-agent system use compared to a chat?skill

06In three sentences

A team costsEach agent rereads the context and spends its own quota; published: about 15× the tokens of a chat.
Matrix firstSigns of sequence × parallel; a difference of 2 decides, less than that is hybrid; costly errors centralize.
Simple means directA small task doesn't go through the matrix, and mechanical work goes to a script.

Going further

Next lesson