Skip to Content
SDKvibexCollaboration

collaboration

Module: vibex/collaboration

Collaboration Module - Multi-Agent Collaboration Engine

Provides:

  • Parallel agent execution
  • Agent-to-agent communication
  • Shared context management
  • Collaborative planning

Classes

AgentCollaborationManager

View source

Agent Collaboration Manager Handles agent-to-agent communication and shared context

Methods:

sendMessage

View source

Send a message from one agent to another

function sendMessage(from: string, to: string, content: string, metadata?: Record<string, any>): void

Parameters:

NameTypeDescription
fromstring
tostring
contentstring
metadataRecord<string, any> (optional)

getMessages

View source

Get pending messages for an agent

function getMessages(agentId: string): AgentMessage[]

Parameters:

NameTypeDescription
agentIdstring

subscribe

View source

Subscribe to messages for an agent

function subscribe(agentId: string, callback: (message: AgentMessage) => void): () => void

Parameters:

NameTypeDescription
agentIdstring
callback(message: AgentMessage) => void

updateContext

View source

Update shared context

function updateContext(agentId: string, updates: Record<string, any>): void

Parameters:

NameTypeDescription
agentIdstring
updatesRecord<string, any>

getContext

View source

Get shared context

function getContext(): SharedContext

getContextValue

View source

Get a specific value from shared context

function getContextValue(key: string): any

Parameters:

NameTypeDescription
keystring


ParallelExecutionEngine

View source

Parallel Execution Engine Executes multiple agent tasks in parallel

Methods:

executeParallel

View source

Execute multiple tasks in parallel

function executeParallel(tasks: ParallelTask[]): Promise<ParallelExecutionResult[]>

Parameters:

NameTypeDescription
tasksParallelTask[]

cancelTask

View source

Cancel a running task

function cancelTask(taskId: string): void

Parameters:

NameTypeDescription
taskIdstring

getActiveTaskCount

View source

Get active task count

function getActiveTaskCount(): number


CollaborativePlanner

View source

Collaborative Planner Helps agents plan together

Methods:

createCollaborativePlan

View source

Create a collaborative plan with multiple agents

function createCollaborativePlan(goal: string, agentIds: string[]): Promise<{ plan: any; agentAssignments: Map<string, string[]> }>

Parameters:

NameTypeDescription
goalstring
agentIdsstring[]


Interfaces

AgentMessage

View source

Properties:

NameTypeDescription
fromstring
tostring
contentstring
metadataRecord<string, any>(optional)
timestampDate

SharedContext

View source

Properties:

NameTypeDescription
spaceIdstring
dataRecord<string, any>
updatedAtDate
updatedBystring

ParallelTask

View source

Properties:

NameTypeDescription
idstring
agentIdstring
messagesany[]
systemstring(optional)
metadataRecord<string, any>(optional)
prioritynumber(optional)

ParallelExecutionResult

View source

Properties:

NameTypeDescription
taskIdstring
agentIdstring
resultAgentResponse
errorError(optional)
durationnumber