Resident Multi-Agent Architecture: Let AI Agents Manage Multiple Tasks for You
Many developers juggle multiple AI agent sessions at once—one running tests, another drafting a proposal, a third answering a manager's question—and end up losing track of tasks. This article explains why human attention, not agent capability, is the bottleneck, and introduces a resident multi-agent architecture built on a single router plus multiple worker nodes. It covers the four core capabilities such a system needs (shared context, parallel task coordination, proactive state tracking, and persistent recoverable execution), along with engineering practices, security guidelines, and the architecture's limitations. A task ledger, state machines, and human approval gates can significantly reduce the cost of managing concurrent tasks.
Let Agents Manage Agents: Why the Bottleneck Is Human Attention
A common scenario: one session is modifying code while tests run for ten-plus minutes. Midway, a client raises a new requirement, so you open another session to draft a proposal. Then your manager asks about yesterday’s project status. You end up switching between sessions, digging through history, and re-explaining context.
The root cause is that two resources grow at different rates. Agent concurrency can scale almost on demand—running several or even dozens of tasks in parallel is technically feasible. Human attention is finite. In practice, one person can effectively follow around 3 to 5 active tasks at a time, depending on the person and task complexity. Treat this figure as a design reference, not a precise measurement. Beyond it, tasks start to slip, producing three types of cost:
- Fragmented context: each session holds only part of the background, and you must mentally assemble the full picture.
- Missed tasks: to-dos scattered across windows are easy to forget.
- Repeated communication: after switching sessions, you re-describe requirements, wasting time and increasing errors.
The table below maps symptoms to root causes and systemic fixes:
| Symptom | Root Cause | Systemic Fix |
|---|---|---|
| Repeatedly asking “where does this stand?” | Status scattered across sessions | A summary view showing all task statuses in one place |
| A to-do gets forgotten | No unified task record | A task ledger where every item has an owner and deadline |
| Re-explaining context after switching sessions | Context lives only in a single session | Context snapshots that new sessions load automatically |
Simply making a single agent more capable cannot solve this. What needs to change is how tasks are organized: agents handle scheduling, tracking, and reporting, while humans set goals, make key decisions, and approve high-risk operations.
Core Idea: Let Agents Manage Agents
Human work splits into two categories: execution-type attention and decision-type attention. Execution work—writing code, researching, organizing documents, running tests—fits agents well. Decision work—setting priorities, weighing trade-offs, confirming releases—must stay with humans.
| Type | Example Tasks | Owner | Failure Consequence |
|---|---|---|---|
| Execution | Modify code, run tests, organize materials | Agent | Usually retriable or rollback-able |
| Decision | Set priorities, choose approach, approve release | Human | Wrong direction or production incidents |
Based on this split, the goal of a resident multi-agent system is to move humans from “watching every session” to “reviewing summaries and making decisions.” The system provides one or a few user-facing entry points. All requests enter through this entry point, and the system decides how to split, assign, and report on them.
Resident Architecture: Single Router, Multiple Workers
The prevailing architecture is a single router with multiple worker nodes. The router handles scheduling, workers handle execution, and they communicate through structured messages.
- Router
The router is the system’s sole entry point and scheduling center. Its responsibilities:
- Understand user intent and classify tasks;
- Break large tasks into independently executable subtasks, defining dependencies, acceptance criteria, return formats, and retry policies;
- Assign subtasks to appropriate workers and track execution status;
- Aggregate results from workers into user-facing progress reports;
- Decide when human intervention is needed and proactively request approval or ask questions.
- Worker
Each worker handles exactly one subtask—for example, writing a module, running a test suite, or retrieving a category of documents. Worker boundaries:
- Access only the context and tools assigned to it; never read or write other nodes’ internal state directly;
- On completion, return only a summary and artifact locations, not the full intermediate process;
- When permissions are insufficient or information is missing, stop and report back to the router instead of guessing.
- Communication Protocol
Router and worker messages use a unified schema for recording, retrieval, and recovery. A typical task message:
{“task_id”: “T-102”, “parent_id”: “P-17”, “status”: “running”, “depends_on”: [“T-101”], “acceptance”: “All tests pass with no new warnings”, “summary”: “Login module changes done; integration tests running”, “artifacts”: [“branch: feature/login”, “report: test-report-0412.html”], “retry_count”: 0}
Field meanings: task_id identifies the subtask, parent_id points to the originating user request, depends_on lists prerequisite tasks, acceptance defines acceptance criteria, summary is a short human-readable progress note, artifacts records output locations, and retry_count tracks attempts so far.
Four Required Capabilities of a Resident System
- Context Continuity: Shared State with Memory Boundaries
The system needs a project-level state store recording requirements, decisions, progress, and to-dos. The router reads the full state; workers read only the parts relevant to their subtasks.
Boundaries: when context grows too large, summarize and compress it periodically to keep cost and latency in check. Sensitive content should not be shared in full—distribute on a least-privilege basis.
- Parallel Coordination: Task Dependencies and Conflict Handling
Dependencies between subtasks typically form a directed acyclic graph (DAG). Independent tasks run in parallel; dependent tasks wait for their prerequisites. When two tasks need to modify the same file or resource, the system should lock or serialize them; if a conflict cannot be resolved automatically, escalate to the router or a human.
Boundaries: tightly coupled tasks yield little parallel benefit—forcing them apart only adds coordination overhead. Such tasks are better handled by a single worker.
- Proactive Progression: State Machines and Timed Triggers
Every subtask should have an explicit state machine with common states such as: pending, running, waiting for input, waiting for approval, completed, failed, and cancelled. Timers periodically check task states and proactively advance or flag tasks that are timing out, stuck, or whose dependencies are now satisfied.
Boundaries: checking too frequently wastes call costs; checking too rarely lets tasks stall. Adjust check intervals based on task urgency.
- Persistent Operation: Durability, Recovery, and Idempotency
After each step, the system should write state to persistent storage first. After a process restart, execution resumes from the latest state rather than starting over. Operations like sending messages or deploying to production must be idempotent—repeating them must not produce duplicate effects.
Boundaries: the persistent store itself needs backup and access controls, or it becomes a new risk.
Engineering Practices
Six components are essential for a resident system:
Task state machine: define legal states and transitions per task—for example, only a “running” task can become “completed.” Illegal transitions are rejected and logged.
Persistent storage: the task ledger, context snapshots, and execution logs should all be written to disk. Choose storage by scale—a local database for personal use, a centralized database for teams.
Permission and approval: tier operations by risk. Reading materials and running tests can execute automatically; modifying production configuration, sending external messages, and deleting data require human approval.
Audit logging: record time, actor, and result for every tool call, state change, and human decision, enabling post-hoc tracing.
Failure retry: distinguish retriable errors (e.g., network timeouts) from non-retriable ones (e.g., insufficient permissions). For retriable errors, set a maximum attempt count with backoff; after exceeding it, escalate to a human.
Human takeover: provide an entry point for intervention at any time. A person can pause a task, change its parameters, take over execution, or cancel the whole request. After takeover, the system should clearly mark the task’s owner.
A minimal viable workflow:
- The user submits a request; the router logs it in the task ledger.
- The router classifies the task, splits it into subtasks, and defines dependencies and acceptance criteria.
- Workers execute in dependency order, updating status and summaries after each step.
- On high-risk operations or failures exceeding the retry limit, the router pauses the task and requests a human decision.
- Once all subtasks pass acceptance, the router generates a summary report for the user.
- The user confirms the result; the task closes and logs are archived.
Security and Risk Guidelines
- Permission isolation: each worker gets only the minimum permissions needed for its subtask, so one node’s mistakes cannot affect the whole system.
- Audit logs: all critical operations must be traceable, and the logs themselves must be tamper-resistant.
- Sensitive data masking: strip keys, personal information, and customer data before passing content to workers or writing logs.
- Human takeover triggers: immediately halt automated execution and notify a human upon unauthorized requests, consecutive failures, failed acceptance checks, or anything involving money or production environments.
Boundaries and Summary
The single-router, multiple-worker architecture suits scenarios with heavy task aggregation, requirement splitting, and approval flows—such as development collaboration, project management, and document production. It depends on the router, whose scheduling latency adds to every task, so it is not suitable for extremely latency-sensitive workloads. Since workers share resources, isolation is relatively weak; strong-isolation scenarios (e.g., multi-tenant data processing) need additional isolation mechanisms.
In short, the key to a resident multi-agent architecture is not making agents do more things simultaneously, but making the system remember context, track tasks, proactively progress, and guarantee recoverability. Humans retain goal setting, priority judgment, and high-risk approvals, while handing execution and tracking to the system. With a task ledger, state machines, and human approval in place, the cost of managing multiple tasks drops significantly.
