Supervisor Prompting
The supervisor prompt is the central control mechanism in your multi-agent system. It determines which agent should handle each user message, directing the flow of the conversation appropriately.
What is the Supervisor Prompt?
The supervisor prompt controls the routing logic that determines which agent handles each user message. Think of the supervisor as a director that manages specialized employees (sub-agents), deciding who should handle each task based on their expertise.
How to Access and Edit the Supervisor Prompt
- Navigate to your team settings in the Kodey.ai dashboard
- Select the "Supervisor" tab
- You'll see a text area containing the default supervisor prompt
- Make your edits while preserving the core functionality
- Click "Save" to apply your changes
Default Supervisor Prompt Structure
The platform provides a default supervisor prompt that looks like this:
You are a supervisor being tasked to route/choose one worker among all options.
Respond with the worker to act next followed by its reasoning.
When everything is done, respond with finish.
IMPORTANT: Always keep this default text as the foundation of your supervisor prompt. Add your customizations after or around it, but do not remove these critical instructions. Removing key elements like "Respond with the worker to act next" or the "finish" instruction may break your agent system.
Why Customize the Supervisor Prompt?
Custom supervisor prompting allows you to:
- Define specific routing conditions for different conversation types
- Create specialized conversation flows
- Set up context-aware agent selection
- Maintain consistent conversation patterns
How to Customize the Supervisor Prompt
- Start with the default prompt
- Add context about your agents and their specialties below the default prompt
- Use XML tags (like
<normal_flow>
and<deep_dive_flow>
) to organize different routing conditions - Include specific criteria for when each agent should be selected
- Test your customized prompt with sample user inputs
Example addition to the default prompt:
<normal_flow>
For normal conversational interactions, use the Coach agent. This includes introductory
conversations, answering basic questions, and providing general information.
</normal_flow>
<deep_dive_flow>
If the user explicitly asks for a deep dive or detailed analysis, use the DeepDive agent.
This includes when users ask for comprehensive information, step-by-step explanations, or in-depth analysis.
</deep_dive_flow>
Best Practices for Supervisor Prompts
- Always start with the default supervisor prompt
- Add your customizations while preserving the core functionality
- Create clear, distinct criteria for when each agent should be selected
- Use XML tags to organize different routing conditions
- Keep routing logic simple and understandable
- Test thoroughly after making changes
Testing Your Supervisor Prompt
- Save your changes to the supervisor prompt
- Use the test interface to start a conversation
- Try different inputs that should trigger different agents
- Verify that the expected agent is selected each time
- Make adjustments as needed based on the results
Next Steps
Once you've configured your supervisor prompt, you may want to set up custom agent routing logic for more precise control over agent selection.