Agent TeamsDelegationArchitecture

How I Structure Agent Teams: Roles, Routing, and Boundaries

50 AI agents need structure or they produce chaos. Here's how I organize agents into teams with clear roles, routing rules, and hard boundaries.

H
Hichem Refes ·
How I Structure Agent Teams: Roles, Routing, and Boundaries

When I had five agents, organization did not matter. I could keep everything in my head. Which agent did what. Where to send each task. What each one needed to function.

At fifty, that fell apart completely.

The turning point was a Tuesday when two agents independently drafted different responses to the same client inquiry. Neither knew the other existed. The client received two conflicting emails within an hour. Not a great look.

That was the week I stopped treating agents as individual tools and started treating them as a team. With roles, reporting lines, and boundaries.

The Org Chart

My agent system mirrors a company org chart. Not because I am sentimental about corporate structure, but because it solves the same problem: coordinating many specialized workers toward a common goal.

At the top sits the orchestrator. Below it are team leads, each responsible for a domain. Below them are individual agents that do the actual work.

Engineering team. Led by Spock. Handles code, architecture decisions, deployments, infrastructure. Sub-agents cover specific tasks: code review, documentation updates, build processes.

Marketing team. Led by Isabelle. Handles content creation, social media, brand voice, campaign management. Sub-agents handle research, drafting, scheduling.

Operations team. Led by Chief. Handles daily briefings, system monitoring, reporting, team coordination. Sub-agents cover health checks, status reports, metric collection.

Research team. Led by Colombo. Handles deep research, competitive intelligence, market analysis. Sub-agents specialize in different source types: web research, document analysis, data gathering.

Business development team. Led by Fennecky. Handles client outreach, proposals, relationship management. Sub-agents cover lead qualification, proposal drafting, follow-up sequences.

Each team lead knows its domain. Tasks that fall within the domain get handled without involving me. Tasks that cross domains or fall outside any domain escalate to the orchestrator, which routes them or asks me for guidance.

AI Agent Blueprint — futuristic system architecture diagram
Free Resource

Want the blueprint behind this system?

The exact architecture, memory layers, and delegation patterns I use to run 50 agents across two businesses.

Get the AI Agent Blueprint →

Why Roles Matter

Without defined roles, agents overlap. Two agents both think content is their job. Three agents all try to monitor system health. Nobody handles invoicing because everybody assumed somebody else was doing it.

Roles create clarity. Each agent has an explicit scope: the types of tasks it handles, the outputs it produces, and the resources it can access.

The role definition for each agent includes four things.

Responsibility. What this agent is responsible for producing. Not a vague “handles marketing” but specific: “drafts LinkedIn posts from approved topic briefs using the brand voice guide.”

Authority. What this agent can do without asking for approval. A monitoring agent can generate a health report on its own. It cannot restart a service without escalation. A content agent can draft a blog post. It cannot publish without review.

Inputs. What the agent expects to receive. A writing agent expects a topic brief with talking points, target audience, and word count. If it receives a vague “write something about AI,” it requests clarification rather than guessing.

Outputs. What the agent produces and where it delivers the result. Formats, file locations, notification channels. Standardized so that any downstream process can consume the output without customization.

This level of definition might seem excessive for software. But at scale, the precision is what prevents the kind of collision I experienced with the duplicate client emails.

Routing Rules

Hichem and Ayla survey a multi-tiered holographic org chart showing structured agent teams in action
Hichem and Ayla survey a multi-tiered holographic org chart showing structured agent teams in action

Every incoming task needs to reach the right agent. The routing logic is a decision tree in the orchestrator.

Keyword matching handles the obvious cases. Tasks mentioning code, deployment, bugs, or architecture go to the engineering team. Tasks mentioning content, posts, or audience go to the marketing team. Tasks mentioning status, health, or reports go to the operations team.

Context handles the ambiguous cases. “Update the pricing page” could be engineering (change the code) or marketing (change the copy). The orchestrator checks the task context. If the task brief mentions messaging or conversion, it goes to marketing. If it mentions layout or functionality, it goes to engineering.

Explicit routing handles the rest. Some tasks get manually routed. When I send a task with a specific agent name, the orchestrator skips classification and sends it directly.

The rule I follow: 80% of tasks should route automatically. The remaining 20% need either context-based routing or manual direction. If more than 20% need manual intervention, the routing rules are incomplete and need updating.

Boundaries That Prevent Chaos

Boundaries are the most important part of the structure. They define what an agent will not do.

Hard boundaries. An engineering agent will not send external communications. A marketing agent will not modify code. A research agent will not make decisions. These boundaries are absolute regardless of what the task brief says.

Scope boundaries. Each agent operates within its defined scope. If a content agent receives a task about financial reporting, it does not attempt it. It returns the task to the orchestrator with a note that this falls outside its scope. Better to bounce a task than produce bad output in an unfamiliar domain.

Resource boundaries. Agents have access only to the tools and data they need. The content agent can read the content calendar and the voice guide. It cannot access the financial database. The ops agent can read system logs. It cannot modify production configurations.

Communication boundaries. Agents do not talk to each other directly. All inter-agent communication goes through the orchestrator. This prevents the chaotic cross-talk that happens when agents start triggering each other without coordination.

This last boundary is one I added after a cascade failure. Agent A triggered Agent B, which triggered Agent C, which triggered Agent A again. An infinite loop that ate API credits until I noticed and killed it manually. Central routing through the orchestrator prevents loops because it tracks the full task chain.

How Handoffs Work

Many tasks require more than one agent. The orchestrator manages the handoff.

Sequential handoffs. Agent A finishes its work and the orchestrator passes the output to Agent B. The research agent produces a brief, then the writing agent receives the brief and produces a draft. Each step is explicit. No implicit “and then the next thing happens.”

Parallel work. When tasks are independent, the orchestrator spawns multiple agents simultaneously. Researching three different topics does not require sequential processing. Three research agents work in parallel, and the orchestrator collects all results before triggering the next step.

Conditional routing. Sometimes the next step depends on the result of the previous step. If the research agent finds enough data, proceed to drafting. If not, escalate for more direction. The orchestrator evaluates the condition and routes accordingly.

Every handoff includes the full context the receiving agent needs. No assumptions about what the next agent already knows. This adds token cost but prevents the errors that come from incomplete context.

What I Learned Building This

Start with two teams, not ten. My first attempt created too many categories too early. Tasks fell between teams constantly. Now I advise starting with two broad teams (engineering and everything else) and splitting further only when the volume justifies it.

Role definitions evolve. The initial role definitions were wrong. Some agents were too broad, some too narrow. I adjusted monthly for the first three months based on where tasks were getting stuck or misrouted.

Boundaries matter more than roles. An agent with a vague role but clear boundaries will produce decent work within its lane. An agent with a precise role but no boundaries will eventually cause a problem by doing something outside its lane.

Document the org chart. This sounds obvious but I did not do it initially. When I could not remember which agent handled what, that was a sign the system was too complex to be undocumented.

The blueprint includes the full agent org chart, role definitions, and routing logic I use in production.

Get the AI Agent Blueprint

Structure is not bureaucracy. At scale, structure is what makes the difference between a coordinated team and fifty agents tripping over each other.