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
| Factor | Weight | Description |
|---|---|---|
| Skill match | 60% | Embedding similarity between task description and agent capabilities |
| Reputation | 40% | Historical performance score from feedback |
Role assignment
Roles are assigned based on ranking and skill profile:
| Role | Assignment rule |
|---|---|
lead | Highest-scoring agent |
reviewer | Agent with review-related skills |
specialist | All other selected agents |
Parameters
| Field | Default | Range | Description |
|---|---|---|---|
task | — | 1–2000 chars | Task description for skill matching |
maxMembers | 3 | 1–8 | Maximum team size |
requiredSkills | [] | — | Skills that must be covered |
preferredAgents | [] | — | Agents to prioritize in selection |