Orchestrator AI Execution and Tool Management

🔒 You must be logged in as an Administrator or Editor to listen to this audio.

In the context of the CrestApps AI module for Orchard Core, an Orchestrator acts as the "brain" or central coordinator for an AI Profile or Chat Interaction.

When the description says, "The orchestrator controls how tools are selected and how the AI execution loop is managed," it is referring to the core engine that dictates how the AI behaves when trying to answer a user's prompt.

Here is a deeper breakdown of what it is for, how it works, and how you configure it:

What is the Orchestrator for?

When a user submits a prompt, the AI rarely just gives a static response if it has access to tools (like a search tool, a database lookup, or an image generator). The Orchestrator is responsible for managing this complex workflow.

Its primary responsibilities include:

  1. Managing the AI Execution Loop: If the AI model decides it needs to use a tool to answer a question, the Orchestrator intercepts that request. It pauses the generation, runs the requested tool, takes the output of the tool, and feeds it back to the AI model. It loops this process until the AI has all the information it needs to construct a final response for the user.
  2. Tool Selection and Context: The orchestrator determines which tools (from the IToolRegistry) are injected into the prompt's context and makes them available to the Large Language Model (LLM) during that specific session.
  3. Behavioral Strategy: Different orchestrators can have different strategies. For example, a DefaultOrchestrator might handle standard back-and-forth conversational tool calling, while a specialized orchestrator (like an Agent Orchestrator or Copilot Orchestrator) might follow a more complex chain-of-thought or multi-agent routing strategy.

How to Configure and Use It

Based on the OrchestratorViewModel and the CrestApps UI patterns, the orchestrator is configured at the Profile or Chat Interaction level.

1. Configuration in the Admin Dashboard:

  • Navigate to the Orchard Core Admin dashboard and go to your AI Profiles, Chat Interactions, or Default Orchestrator Settings.
  • When editing a profile or interaction, you will see a setting or dropdown for the Orchestrator.
  • The Orchestrators property in the code (IList<SelectListItem> Orchestrators) populates this dropdown with all the registered orchestrators in your system (e.g., Default, Copilot, etc.).
  • By assigning the OrchestratorName, you are binding that specific AI Profile to use that orchestrator's logic.

2. Usage (Under the Hood):

  • As a user or admin, you don't typically interact with the orchestrator directly during a chat. You simply assign it.
  • Once assigned, whenever a chat session is initiated under that profile, the CrestApps module looks up the defined OrchestratorName.
  • It then routes the user's messages through that specific orchestrator's pipeline, ensuring that the selected AI model adheres to the exact tool-calling rules and execution loops defined by it.

In short, the Orchestrator is the manager that bridges the gap between the raw LLM, the user's prompt, and the internal Orchard Core tools.