Skip to main content

[!FROZEN] MPLP Protocol v1.0.0 Frozen Specification Freeze Date: 2025-12-03 Status: FROZEN (no breaking changes permitted) Governance: MPLP Protocol Governance Committee (MPGC) License: Apache-2.0 Note: Any normative change requires a new protocol version.

Multi-Agent (MAP) Profile

1. Purpose

The Multi-Agent (MAP) Profile extends the SA Profile to support collaboration between multiple agents. It introduces coordination mechanisms, turn-taking, and shared state management for complex workflows.

Design Principle: "Explicit coordination, traceable handoffs, conflict-free collaboration"

2. Profile Classification

AttributeValue
Profile IDmplp:profile:map:1.0.0
Requirement LevelRECOMMENDED (optional)
ExtendsSA Profile
Extended By

3. Required Modules

All MAP-compliant runtimes MUST implement:

ModuleRequirementUsage
All SA ModulesREQUIREDContext, Plan, Trace, Role, Core
CollabREQUIREDSession and turn management
DialogREQUIREDInter-agent communication
NetworkREQUIREDAgent topology

4. Coordination Modes

From: schemas/v2/mplp-collab.schema.json

4.1 Mode Descriptions

ModePatternUse Case
broadcastOne-to-many fan-outAnnouncements, swarm tasks
round_robinSequential turnsStructured reviews
orchestratedCentral controllerComplex pipelines
swarmSelf-organizing parallelIndependent subtasks
pairTwo-agent directCode review, debugging

4.2 Mode Selection

4.3 Mode Examples

Orchestrated (Software Development):

Orchestrator
> Architect (design)
> Coder (implement)
> Tester (test)
> Reviewer (review)

Pair (Code Review):

Coder <> Reviewer

Swarm (Research):

Task: "Find solutions"
> Agent A (approach 1)
> Agent B (approach 2)
> Agent C (approach 3)

5. Invariants

From: schemas/v2/invariants/map-invariants.yaml

5.1 Session Structure

IDRuleDescription
map_session_requires_multiple_participantsparticipants.length >= 2At least 2 participants
map_collab_mode_validmode enumValid mode required
map_session_id_is_uuidcollab_id is UUID v4Valid session ID
map_participants_have_role_idsparticipants[*].role_id non-emptyAll have roles

5.2 Participant Validation

IDRuleDescription
map_role_ids_are_uuidsrole_id is UUID v4Valid role references
map_participant_ids_are_non_emptyparticipant_id non-emptyValid IDs
map_participant_kind_validkind enumValid participant type

5.3 Event Consistency

IDRuleDescription
map_turn_completion_matches_dispatchDispatch Complete pairTurn tracking
map_broadcast_has_receiversSent Received pairBroadcast tracking

5.4 Validation Code

function validateMAPProfile(session: Collab): ValidationResult {
const errors: string[] = [];

// Session structure
if (!session.participants || session.participants.length < 2) {
errors.push('map_session_requires_multiple_participants: Need participants');
}

// Mode validation
const validModes = ['broadcast', 'round_robin', 'orchestrated', 'swarm', 'pair'];
if (!validModes.includes(session.mode)) {
errors.push(`map_collab_mode_valid: Invalid mode ${session.mode}`);
}

// Participant validation
for (const p of session.participants || []) {
if (!p.role_id) {
errors.push(`map_participants_have_role_ids: ${p.participant_id} missing role`);
}
const validKinds = ['agent', 'human', 'system', 'external'];
if (!validKinds.includes(p.kind)) {
errors.push(`map_participant_kind_valid: ${p.participant_id} invalid kind`);
}
}

return { valid: errors.length === 0, errors };
}

6. Execution Lifecycle

6.1 Session State Machine

6.2 Turn-Taking Flow (Orchestrated)

6.3 Broadcast Flow

7. Mandatory Events

From: schemas/v2/events/mplp-map-event.schema.json

7.1 Event Table

PhaseEvent TypeRequired Fields
InitializeMAPSessionStartedsession_id, mode, participant_count
AssignMAPRolesAssignedsession_id, assignments[]
DispatchMAPTurnDispatchedsession_id, role_id, turn_number
CompleteMAPTurnCompletedsession_id, role_id, status
EndMAPSessionCompletedsession_id, status, turns_total
ScenarioEvent TypeRationale
BroadcastMAPBroadcastSentFan-out tracking
BroadcastMAPBroadcastReceivedFan-in tracking
ConflictMAPConflictDetectedState integrity
ConflictMAPConflictResolvedAudit trail

7.3 Event Examples

MAPTurnDispatched:

{
"event_type": "MAPTurnDispatched",
"event_family": "RuntimeExecutionEvent",
"session_id": "collab-550e8400",
"timestamp": "2025-12-07T00:00:02.000Z",
"initiator_role": "orchestrator-001",
"target_roles": ["coder-001"],
"payload": {
"role_id": "coder-001",
"turn_number": 2,
"task": "Implement authentication module"
}
}

MAPSessionCompleted:

{
"event_type": "MAPSessionCompleted",
"event_family": "GraphUpdateEvent",
"session_id": "collab-550e8400",
"timestamp": "2025-12-07T00:30:00.000Z",
"payload": {
"status": "completed",
"participants_count": 4,
"turns_total": 12,
"duration_ms": 1800000
}
}

8. Governance Rules

8.1 Turn Token Management

Only the agent holding the turn token can modify shared state:

interface TurnToken {
token_id: string;
session_id: string;
holder_role: string;
acquired_at: string;
expires_at?: string;
}

function canModifyState(session: Collab, role_id: string, token: TurnToken): boolean {
// In orchestrated/round_robin, only token holder can modify
if (['orchestrated', 'round_robin'].includes(session.mode)) {
return token.holder_role === role_id;
}
// In swarm/pair, concurrent modification allowed
return true;
}

8.2 Conflict Resolution

When concurrent modifications occur:

  1. Last-Write-Wins (LWW): Latest timestamp wins
  2. Hierarchy: Higher-rank role wins
  3. Voting: Majority vote
  4. Escalation: Human decision

9. Usage Scenarios

9.1 Software Development Pipeline

Orchestrator 
Phase 1: Design Architect (design system)
Phase 2: Implementation Coder A (frontend) Coder B (backend)
Phase 3: Testing Tester (run tests)
Phase 4: Review
Reviewer (code review)

9.2 Debate Pattern

Proposer     Moderator?   
Opponent

9.3 Research Swarm

Task: "Explore solution space"       
A1 A2 A3 A4 A5 (parallel exploration)
Aggregator

10. SDK Examples

10.1 TypeScript

async function runMAPSession(
context_id: string,
mode: CollabMode,
participants: Participant[]
): Promise<void> {
// Create session
const session: Collab = {
meta: { protocolVersion: '1.0.0' },
collab_id: uuidv4(),
context_id,
title: 'Code Review Session',
purpose: 'Review authentication changes',
mode,
status: 'draft',
participants,
created_at: new Date().toISOString()
};

// Validate MAP invariants
const validation = validateMAPProfile(session);
if (!validation.valid) {
throw new Error(`MAP validation failed: ${validation.errors.join(', ')}`);
}

// Start session
session.status = 'active';
await emit({ event_type: 'MAPSessionStarted', session_id: session.collab_id, mode });
await emit({ event_type: 'MAPRolesAssigned', session_id: session.collab_id, assignments: participants });

// Execute based on mode
if (mode === 'orchestrated') {
await runOrchestratedSession(session);
} else if (mode === 'round_robin') {
await runRoundRobinSession(session);
} else if (mode === 'broadcast') {
await runBroadcastSession(session);
}

// Complete
session.status = 'completed';
await emit({ event_type: 'MAPSessionCompleted', session_id: session.collab_id });
}

Architecture:

Profiles:

Invariants:

  • schemas/v2/invariants/map-invariants.yaml

Document Status: Normative (Optional Profile)
Profile ID: mplp:profile:map:1.0.0
Required Modules: SA modules + Collab, Dialog, Network
Invariant Count: 9 normative rules
Coordination Modes: broadcast, round_robin, orchestrated, swarm, pair

2025 Bangshi Beijing Network Technology Limited Company Licensed under the Apache License, Version 2.0.