Stratix implementation of AgentOrchestrator.

Manages agent lifecycle, execution, tracing, budgets, and coordination.

const orchestrator = new StratixAgentOrchestrator(
repository,
auditLog,
llmProvider,
{
auditEnabled: true,
budgetEnforcement: true,
autoRetry: true,
maxRetries: 3
}
);

orchestrator.registerAgent(customerSupportAgent);

const context = new AgentContext({
sessionId: 'session-123',
environment: 'production'
});
context.setBudget(1.00);

const result = await orchestrator.executeAgent(agentId, input, context);

Implements

  • AgentOrchestrator

Constructors

Methods

  • Registers an agent with the orchestrator

    Parameters

    • agent: AIAgent<unknown, unknown>

      The agent to register

    Returns void

  • Unregisters an agent from the orchestrator

    Parameters

    • agentId: AgentId

      ID of the agent to unregister

    Returns void

  • Executes a single agent

    Type Parameters

    • TInput
    • TOutput

    Parameters

    • agentId: AgentId

      ID of the agent to execute

    • input: TInput

      Input data for the agent

    • context: AgentContext

      Execution context

    Returns Promise<AgentResult<TOutput>>

    The agent execution result

  • Executes multiple agents sequentially

    Each agent receives the output of the previous agent as input.

    Parameters

    • agents: AIAgent<unknown, unknown>[]

      Array of agents to execute in sequence

    • input: unknown

      Initial input data

    • context: AgentContext

      Execution context

    Returns Promise<AgentResult<unknown>>

    The final agent result

  • Executes multiple agents in parallel

    All agents receive the same input and execute simultaneously.

    Parameters

    • agents: AIAgent<unknown, unknown>[]

      Array of agents to execute in parallel

    • input: unknown

      Input data (same for all agents)

    • context: AgentContext

      Execution context

    Returns Promise<AgentResult<unknown>[]>

    Array of agent results

  • Delegates execution from one agent to another

    Parameters

    • fromAgent: AIAgent<unknown, unknown>

      The delegating agent

    • toAgent: AIAgent<unknown, unknown>

      The agent to delegate to

    • input: unknown

      Input data for the target agent

    Returns Promise<AgentResult<unknown>>

    The result from the target agent