Routing Configuration Files
The routing configuration files, located in Public/Configs/Routing/, define how WilmerAI directs incoming user prompts
to different processing workflows. Each JSON file maps prompt categories (e.g., "Coding", "Factual") to a specific
workflow file.
When a request is received and the customWorkflowOverride setting in the user's configuration is false, the system
first runs a "categorization workflow." This initial workflow uses an LLM to analyze the request and assign it to one of
the categories defined in the routing file. The system then executes the workflow associated with that category.
This process allows different types of prompts to be handled by specialized workflows. A user's active routing file is
specified by the routingConfig field in their Public/Configs/Users/<username>.json file.
File Structure
A routing configuration file is a single JSON object where each top-level key is a unique string representing a category. The value for each key is a nested object containing the route's details.
Category Key (e.g., "CODING")
- Description: The unique identifier for the route. This key serves as the target output for the categorization
LLM. The system's categorization service attempts to match the LLM's response to one of these keys. By convention,
keys are in
UPPERCASE_SNAKE_CASEfor reliable matching. - Data Type:
string - Required: Yes
- Example:
"FACTUAL"
Category Object Fields
For each Category Key, the value is a nested JSON object containing the following two fields.
description
- Description: A detailed explanation of what kind of prompt should be assigned to this category. This field is *
critical for accurate routing. The
PromptCategorizationServicecombines the Category Key and this * description into a single string (e.g.,"CODING: Any request which requires generating or analyzing a code snippet...") and injects it into the prompt that is sent to the categorization LLM. - Data Type:
string - Required: Yes
workflow
- Description: The name of the workflow file to execute if this category is selected. The system will look for this
file in the user's workflow directory. By default, this is
Public/Configs/Workflows/<username>/, but it can be changed using theworkflowConfigsSubDirectoryOverridesetting in the User config. The.jsonextension must be omitted. - Data Type:
string - Required: Yes
- Example: A value of
"FactualWorkflow-With-RAG"instructs the system to run the workflow file from the user's configured workflow directory (e.g.,Public/Configs/Workflows/<username>/FactualWorkflow-With-RAG.json).
Example Routing File
Filename: assistantSingleModelCategoriesConfig.json
{
// The unique identifier for the route. This is the target output
// for the categorization LLM.
"CODING": {
// This text is injected into the categorization prompt to help the LLM
// make an accurate choice.
"description": "Any request which requires generating or analyzing a code snippet, discussing algorithms, or explaining programming concepts.",
// The workflow file (without .json) to execute if this category is chosen.
"workflow": "CodingWorkflow-LargeModel-Centric"
},
"FACTUAL": {
"description": "Requests that require verifiable, factual information, data lookups, or answers from a knowledge base. This includes history, science, and definitions.",
"workflow": "FactualWorkflow-With-RAG"
},
"CONVERSATIONAL": {
"description": "Casual conversation, general inquiries, brainstorming, creative writing, or any request that does not fall into other specific categories.",
"workflow": "DefaultConversationalWorkflow"
}
}
The Routing Process
- Initiation: A request is received. The system checks that the user's
customWorkflowOverridesetting isfalse. - Loading: The
PromptCategorizationServicereads the routing file specified in the user'sroutingConfigsetting. - Prompt Assembly: The service constructs a prompt for the categorization LLM. This prompt includes the user's message history and the list of all categories and their descriptions from the routing file.
- Categorization: The system executes the workflow specified in the user's
categorizationWorkflowsetting. This workflow calls an LLM with the assembled prompt to get a one-word category back. - Matching: The
PromptCategorizationServicereceives the category name (e.g.,"CODING") and matches it to aCategory Keyin the routing file. - Execution: The service retrieves the
workflowvalue from the matched category (e.g.,"CodingWorkflow-LargeModel-Centric") and executes that final workflow to generate the response. - Fallback: If the categorization LLM's output does not match any defined
Category Key, the system executes the_DefaultWorkflowas a fallback.