Teams

A team is a named group of agents that work together with shared context and coordinated knowledge fusion. Teams are managed by the TeamManager and persisted in Cortex as RDF triples.

How teams work

Each team has:

  • A unique ID and name
  • A merge strategy for combining agent outputs
  • A shared namespace for knowledge isolation
  • Members with assigned roles, statuses, and results
mermaid
stateDiagram-v2
    [*] --> Pending : createTeam()
    Pending --> Running : first member starts
    Running --> Completed : all members done
    Running --> Failed : critical failure

Team operations

OperationDescription
createTeam(config)Create a team with members, roles, and merge strategy
getTeam(teamId)Retrieve full team state
listTeams()List all teams with summary info
updateMemberStatus(teamId, agentId, status)Update a member's progress
mergeTeamResults(teamId)Merge all member outputs using the team's strategy
isTeamComplete(teamId)Check if all members are completed or failed

Merge strategies

When a team finishes, member outputs are merged using one of these strategies:

StrategyBehavior
additiveCombine all findings from all members
replaceLast writer wins
conflict-flagFlag conflicting findings for manual resolution
newest-winsKeep the most recent finding per topic
majority-winsKeep findings agreed upon by majority

Cortex storage

Team state is stored as RDF triples:

{ns}:team:{teamId} → {ns}:team:name → "code-review-team"
{ns}:team:{teamId} → {ns}:team:status → "running"
{ns}:team:{teamId} → {ns}:team:strategy → "additive"
{ns}:team:{teamId} → {ns}:team:member:{agentId} → { JSON member state }

Configuration

json5
{
  teams: {
    maxTeamSize: 8,              // Max agents per team
    defaultStrategy: "additive", // Default merge strategy
    workflowTimeout: 600,        // Team timeout in seconds
  },
}