Orchestrator

orchestrator.md

An orchestrator.md file works just like a prompt.md but tells Sensai to treat the agent as an orchestrator. An orchestrator is a special kind of agent responsible for managing and routing tasks across its direct sub-agents (i.e agents within the same folder path).

Each sub-agent has its own logic and tools, enabling you to build flexible, modular multi-agent systems.

Here's a basic example:

> api
  + orchestrator.md
  > researcher
    + prompt.md
    + tool.web.ts
  > reviewer
    + prompt.md
    + tool.knowledge.ts

In the example above, the orchestrator will detect the intent and route accordingly to the researcher agent or the reviwer (or both).

Orchestrators let you combine specialized agents to solve more complex tasks in a structured and maintainable way.

Nested orchestration

An orchestrator is a special kind of agent and it is is possible to nest orchestrator and create complex multi-agent architecture.

> api
  + orchestrator.md
  > researcher
    + orchestrator.md
    > creative
      + prompt.md
    > pragmatic
      + prompt.md
  > reviewer
    + prompt.md