Skip to main content

Teams

Teams enable multiple agents to work together. Choose how tasks are distributed: an orchestrator can pick agents, route to the best one, broadcast to all, or run iterative collaboration rounds.

Multi-Agent Collaboration

Coordinate

An orchestrator model picks which member agent handles the task.

Route

Routes to the single best agent based on input.

Broadcast

Sends input to ALL agents and merges results.

Collaborate

Iterative rounds between agents (maxRounds configurable).

TeamMode

enum TeamMode {
  Coordinate = "coordinate",
  Route = "route",
  Broadcast = "broadcast",
  Collaborate = "collaborate",
}
ModeBehavior
coordinateOrchestrator decides which agent(s) to invoke
routeSingle best agent selected based on input
broadcastAll agents process input; results merged
collaborateAgents pass work in rounds until done (maxRounds)

TeamConfig

interface TeamConfig {
  name: string;
  mode: TeamMode;
  model: ModelProvider;
  members: Agent[];
  instructions?: string;
  storage?: StorageDriver;
  maxRounds?: number;
  eventBus?: EventBus;
}
name
string
required
Display name for the team.
mode
TeamMode
required
How the team distributes work: coordinate, route, broadcast, or collaborate.
model
ModelProvider
required
The orchestrator model (for coordinate/route) or shared model for the team.
members
Agent[]
required
Array of member agents.
instructions
string
System instructions for the orchestrator (coordinate/route) or team context.
storage
StorageDriver
Storage for session state.
maxRounds
number
Max collaboration rounds (collaborate mode only).
eventBus
EventBus
Custom event bus for team events.

Basic Example

import { Team, TeamMode, Agent, openai } from "@radaros/core";

const researcher = new Agent({
  name: "Researcher",
  model: openai("gpt-4o-mini"),
  instructions: "You research topics and provide factual summaries.",
});

const writer = new Agent({
  name: "Writer",
  model: openai("gpt-4o-mini"),
  instructions: "You write clear, engaging content from research notes.",
});

const team = new Team({
  name: "Content Team",
  mode: TeamMode.Coordinate,
  model: openai("gpt-4o"),
  members: [researcher, writer],
  instructions: "Coordinate between Researcher and Writer. Use Researcher for facts, Writer for drafts.",
});

const output = await team.run("Write a short article about quantum computing.");
console.log(output.text);

Next Steps