Unit 4: Multi-Agent Systems and Collaboration
I. Orientation
Multi-agent systems (MAS) study how multiple autonomous computational agents perceive environments, make decisions, and coordinate actions to achieve individual or shared goals. Modern agentic AI combines language models, tools, memory, planning, and communication so that complex work can be divided across specialized agents rather than handled by one general-purpose system.
- Agent: An entity that observes inputs, maintains state, selects actions, and pursues an objective.
- Autonomy: The agent can decide its next action within assigned constraints without requiring human approval for every step.
- Environment: The external system in which agents operate, such as a database, software repository, enterprise platform, or physical space.
- Shared objective: Agents may optimize one organizational goal, such as completing a customer order accurately and quickly.
- Local knowledge: Each agent usually has incomplete information, making communication and coordination necessary.
- Coordination cost: Additional messages, planning time, conflict resolution, and monitoring can reduce the benefits of collaboration.
- Human governance: Permissions, audit trails, approval gates, and safety policies remain necessary when agents affect people, money, or regulated data.
II. Multi-Agent Systems — Multiple autonomous entities working together
A multi-agent system is a collection of agents that interact within an environment and whose combined behavior produces results that may be impossible or inefficient for one agent to achieve alone.
A. Introduction to multi-agent systems
This introduction establishes why agent multiplicity is useful and what properties distinguish a MAS from a simple software pipeline.
- Specialization: A research agent may retrieve sources, a coding agent may modify files, and a testing agent may execute validation; each uses narrower tools and instructions.
- Parallelism: Independent tasks can run concurrently, reducing elapsed time. If three independent tasks require 4, 5, and 6 minutes, serial execution takes 15 minutes, while ideal parallel execution approaches 6 minutes plus coordination overhead.
- Partial observability: Agents see different parts of the problem; a finance agent may access invoices while a legal agent accesses contract clauses.
- Interaction model: Agents can cooperate, compete, negotiate, or use a shared resource such as a blackboard or message queue.
- System objective: Performance is commonly evaluated through task success, latency, cost, reliability, safety, and the quality of the final artifact.
- Failure assumption: Any agent can produce an incorrect answer, timeout, duplicate action, or misleading message; the system therefore needs validation and recovery.
III. Planner-Executor Architectures — Separating reasoning from action
A planner-executor architecture divides work between an agent that develops a plan and one or more agents that carry out and verify the plan. The separation improves structure, specialization, and observability.
A. Planner-executor architectures
This architecture is useful when a task contains multiple dependent steps, tool calls, or checkpoints.
- Planner role: Converts a goal into ordered or partially ordered tasks, such as
collect_data -> analyze_data -> generate_report. - Executor role: Performs an assigned task using approved tools, then returns a result, status, and evidence.
- Verifier role: Checks outputs against constraints, schemas, tests, or business rules before the next step proceeds.
- Feedback loop: Execution results can cause replanning when a dependency fails or new information changes the plan.
- State representation: A plan may be represented as a directed acyclic graph (DAG), where each node is a task and each edge indicates a dependency.
- Core control flow:
plan = Planner(goal, constraints)
for task in plan.ready_tasks:
result = Executor(task, tools, permissions)
if Verifier(result, task.acceptance_criteria):
mark_complete(task)
else:
plan = Planner(revise(goal, result, plan))Here, goal is the desired outcome, constraints are limits, task is an executable unit, and acceptance_criteria define success.
IV. Collaborative Intelligence — Agents as interacting teammates
Collaborative agents combine specialized capabilities through communication, shared context, and mutual evaluation. Collaboration is valuable when no single agent has sufficient knowledge, access, or reasoning capacity.
A. Collaborative agents
This subsection explains how agents contribute complementary expertise without requiring identical internal models.
- Complementary capabilities: A planner can decompose a task, a database agent can query structured records, and a critic can identify unsupported claims.
- Shared workspace: Agents may write artifacts to a common repository, document store, or blackboard containing facts, drafts, and task status.
- Peer review: One agent generates a proposal while another checks correctness, security, completeness, or policy compliance.
- Consensus limitation: Agreement does not guarantee truth; several agents can repeat the same incorrect assumption, so external evidence or deterministic validation is important.
- Context control: Agents should receive only relevant information. Excessive shared context increases token cost and can cause attention to be diverted from the active task.
- Termination condition: Collaboration needs a clear stopping rule, such as valid test results, an approved document, or a maximum number of revision rounds.
B. Inter-agent communication
Inter-agent communication provides the information exchange required for coordination, but message design determines reliability and cost.
- Message schema: A message should identify
sender,recipient,task_id,action,payload,priority, andtimestamp. - Direct messaging: A point-to-point request is appropriate when one agent owns a specific capability, such as asking an inventory agent for stock levels.
- Publish-subscribe: An agent publishes an event such as
payment_verified; subscribed agents react without the publisher knowing every recipient. - Shared blackboard: Agents read and update a common state, which is useful for asynchronous investigation but requires conflict control.
- Protocol discipline: Requests should specify expected output format, deadline, and failure response; structured JSON is safer to parse than unconstrained prose.
- Security boundary: Authentication, authorization, redaction, and message validation prevent an agent from invoking tools or receiving data outside its role.
V. Distributed Problem Solving — Dividing work across agents
Distributed problem solving decomposes a global problem into subtasks, assigns them to capable agents, and combines their partial results into a coherent solution.
A. Task delegation
Task delegation determines which agent should perform each task and under what authority.
- Capability matching: Assign a task according to required skills, tools, data access, and reliability history; a tax agent should handle tax classification rather than a general writing agent.
- Dependency awareness: A task requiring a completed purchase order cannot begin before the procurement agent validates the request.
- Delegation contract: The contract should define input, output schema, deadline, permissions, acceptance test, and escalation path.
- Dynamic assignment: A coordinator can reassign work when an agent is overloaded, unavailable, or unable to satisfy the acceptance criteria.
- Least privilege: Delegated authority should cover only the required operation; a reporting agent may read sales data without being allowed to modify invoices.
- Idempotency: Repeating a delegated request should not create duplicate effects. An API can use a unique
task_idas an idempotency key for a payment request.
B. Distributed problem solving
This process combines locally generated solutions while managing dependencies, disagreement, and incomplete information.
- Decomposition: Break a goal into tasks with explicit inputs and outputs; “launch campaign” may become audience analysis, content creation, budget approval, and publication.
- Parallel subproblems: Independent tasks can execute simultaneously, while dependent tasks wait for predecessor outputs.
- Result aggregation: A synthesizer merges outputs, resolves conflicts, and preserves provenance linking each claim to an agent or source.
- Conflict handling: Contradictory results can trigger a critic, a vote weighted by evidence, or escalation to a human decision-maker.
- Distributed constraint: Each agent may optimize its own task while harming the global objective, so the coordinator must enforce shared limits such as budget, latency, or risk.
- Recovery: Failed tasks should be retried selectively, compensated, or marked for escalation rather than silently ignored.
VI. Orchestration and Coordination — Managing collective execution
Orchestration determines the control structure of a multi-agent workflow, while coordination mechanisms determine how agents remain consistent as they act.
A. Orchestration patterns
This subsection identifies common control patterns for sequencing, parallelizing, and supervising agent work.
- Centralized supervisor: One coordinator assigns tasks and aggregates results; this is easy to audit but can become a bottleneck or single point of failure.
- Sequential pipeline: Agent A passes output to Agent B, then to Agent C; it is predictable but cannot exploit independence between tasks.
- Parallel fan-out/fan-in: A coordinator sends the same case to several specialists and later combines their responses, useful for independent analysis.
- Hierarchical orchestration: A manager agent delegates to team leads, who coordinate specialist agents; hierarchy reduces manager overload but adds communication layers.
- Event-driven workflow: Events trigger agents asynchronously, such as a
ticket_createdevent starting classification, enrichment, and routing. - Human-in-the-loop: High-impact steps pause for approval, especially before external communication, financial transactions, or irreversible changes.
B. Agent coordination mechanisms
Coordination mechanisms prevent collisions and help agents align actions with shared state.
- Task locks: A lease on
case_482prevents two agents from editing the same case simultaneously; leases must expire so abandoned work can recover. - Queues: A durable queue buffers tasks between producers and workers, supporting retries and load balancing.
- Consensus: Voting or quorum rules can select a decision, such as requiring 2 of 3 validation agents to approve a classification.
- Negotiation: Agents exchange proposals when resources conflict, for example negotiating who receives a limited computing slot.
- Shared state versioning: Version numbers or optimistic concurrency control detect updates made against stale data.
- Monitoring: Traces should record agent calls, prompts or task identifiers, tool actions, latency, token usage, errors, and final outcomes.
VII. Enterprise Collaboration — Applying agents to organizational work
Enterprise collaboration connects agents to business roles, systems, policies, and measurable workflow outcomes. Reliability and governance are as important as language-model capability.
A. Collaborative enterprise workflows
This subsection shows how multiple agents can coordinate across a complete business process.
- Workflow stages: An insurance claim may pass through intake, document extraction, fraud screening, coverage analysis, approval, and customer notification.
- System integration: Agents may use CRM, ERP, email, databases, and ticketing APIs; each tool call should be authenticated and logged.
- Business controls: Approval thresholds, segregation of duties, retention rules, and personally identifiable information handling must be encoded as constraints.
- Artifact continuity: Each stage should pass structured artifacts, such as a claim record with extracted fields, confidence values, and source references.
- Exception routing: Low-confidence extraction or a policy conflict should create a human review task rather than forcing automatic completion.
- Outcome measurement: Useful metrics include processing time, straight-through completion rate, error rate, rework, cost per case, and customer-impact incidents.
B. Role-based agents
Role-based agents receive responsibilities and permissions aligned with organizational functions rather than acting as undifferentiated generalists.
- Role definition: A role specifies mission, allowed tools, data scope, decision limits, and escalation rules; a compliance agent may inspect records but cannot approve its own exception.
- Examples: Researcher gathers evidence, analyst interprets it, operator performs system actions, reviewer checks quality, and auditor records justification.
- Separation of duties: Different agents can prepare and approve a payment, reducing the risk of one compromised or mistaken agent completing the entire transaction.
- Prompt and policy boundary: Role instructions should be supplemented by enforceable tool permissions because prompts alone are not a security control.
- Accountability: Agent identity, role, input, output, and tool calls should be attached to an audit record.
- Role transition: A workflow may promote a draft from analyst to reviewer only after required fields and evidence links are present.
VIII. Scalable Collaboration and Optimization — Improving performance at system level
Scaling requires control over concurrency, cost, reliability, and information flow. Optimization should measure the complete workflow rather than only the quality of an individual agent response.
A. Scalable AI collaboration strategies
This subsection describes strategies for increasing workload capacity without losing coordination quality.
- Worker pools: Multiple instances of the same specialist consume tasks from a queue, allowing horizontal scaling as demand increases.
- Routing: A lightweight router sends simple requests to smaller models and complex or high-risk requests to stronger models.
- Load balancing: Assignment can consider queue length, estimated task duration, agent availability, and historical success rate.
- Caching: Stable results, embeddings, or retrieved documents can be reused; cache keys must include relevant data versions to avoid stale decisions.
- Bounded concurrency: Limits prevent excessive simultaneous tool calls, rate-limit failures, and uncontrolled spending.
- Fault tolerance: Timeouts, exponential backoff, circuit breakers, checkpointing, and fallback agents keep one failure from stopping the workflow.
- Cost model: Total cost includes model calls, tool operations, storage, retries, and human review; parallelism is beneficial only when its value exceeds these costs.
B. Workflow optimization for multi-agent systems
Optimization improves the end-to-end relationship between quality, speed, cost, and risk.
- Critical path: In a dependency graph, prioritize the longest chain of required tasks because shortening noncritical work may not reduce total completion time.
- Batching: Similar independent requests can be processed together when the tool or model supports batching, reducing per-call overhead.
- Context minimization: Pass summaries, identifiers, and relevant evidence instead of full conversation histories; this reduces latency and accidental information leakage.
- Early validation: Validate schemas and permissions immediately after each tool call so invalid data does not propagate to later agents.
- Adaptive retries: Retry transient network failures but avoid repeating deterministic policy failures; classify errors before choosing recovery.
- Evaluation loop: Compare workflow versions using success rate, p95 latency, cost per completed task, escalation rate, and safety violations.
- Optimization constraint: A useful objective can be expressed as:
maximize Quality - (alpha * Cost) - (beta * Latency) - (gamma * Risk)Here, Quality measures task success, Cost is resource expenditure, Latency is completion time, Risk is expected harm or policy exposure, and alpha, beta, and gamma are weights chosen by the organization.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →