Agent Teams

Team Formation

Team formation automatically selects the best agents for a task based on skill matching and reputation. The algorithm scores candidates at 60% skill match (embedding similarity) and 40% reputation score, then assigns roles.

Forming a team

bash
# Auto-form a team for a task
curl -X POST http://localhost:3000/teams/form \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "Analyze customer churn data and build a predictive model",
    "maxMembers": 4,
    "requiredSkills": ["data-analysis", "machine-learning"],
    "preferredAgents": ["ml-agent"]
  }'

# Response (201 Created)
{
  "team": {
    "id": "team_abc123",
    "task": "Analyze customer churn data and build a predictive model",
    "members": [
      { "agentId": "ml-agent", "role": "lead", "score": 0.92 },
      { "agentId": "data-agent", "role": "specialist", "score": 0.87 },
      { "agentId": "code-agent", "role": "specialist", "score": 0.81 },
      { "agentId": "review-agent", "role": "reviewer", "score": 0.78 }
    ],
    "leadAgentId": "ml-agent",
    "estimatedCapability": 0.85,
    "createdAt": 1741363200000
  }
}

Scoring algorithm

FactorWeightDescription
Skill match60%Embedding similarity between task description and agent capabilities
Reputation40%Historical performance score from feedback

Role assignment

Roles are assigned based on ranking and skill profile:

RoleAssignment rule
leadHighest-scoring agent
reviewerAgent with review-related skills
specialistAll other selected agents

Parameters

FieldDefaultRangeDescription
task1–2000 charsTask description for skill matching
maxMembers31–8Maximum team size
requiredSkills[]Skills that must be covered
preferredAgents[]Agents to prioritize in selection