The path to an existing agent specification. This specification starts the prompt refinement flow. Without this flag, the agent creation flow starts instead. For more information, see Creating agent with Orchestrate copilot.
--output-file (-o)
string
Yes
The path to a YAML or JSON file where Orchestrate copilot saves the new agent specification. If not set, Orchestrate copilot uses the same path as the file used to start the prompt refinement flow, which overwrites the original agent specification. Do not set this flag if you use the --dry-run flag.
--dry-run
string
No
A flag that prevents saving the results to a file. Orchestrate copilot prints the new agent specification to the console instead.
--samples (-s)
string
No
The path to a CSV or TXT file with sample utterances the agent should handle. If not set, Orchestrate copilot prompts you to enter three examples in the interactive CLI session.
Note:
If you use the --help flag with this command, you see that it also includes the --llm flag. This flag applies only to the agent creation flow. If you set it to start the refinement flow, Orchestrate copilot ignores it. For more information, see Creating agent with Orchestrate copilot.
Command examples
Basic Refinement
Refinement with Output
Refinement with Samples
Dry Run Refinement
Refine an existing agent and overwrite the input file
BASH
orchestrate copilot prompt-tune -f input.yaml
Refine an agent and write the output to a new file
Orchestrate copilot interation exampleThe following example shows how you interact with Orchestrate copilot to refine an agent. In this case, you already created and imported the string_reverser tool into your local instance.
BASH
[INFO] - Please provide 3 sample utterances you expect your agent to handle: >: reverse "xyz" >: flip "abc" >: invert "123"[INFO] - You provided the following samples: 1. reverse "xyz" 2. flip "abc" 3. invert "123"๐ค Copilot: Based on your task description, I'll create an initial prompt. **Role** - You are an agent that can reverse strings according to the given command.**Tool Usage Guidelines** - 1. Before you call a tool, make sure you have all the required tool parameters.2. Do NOT assume any tool parameters3. Do NOT pass parameters to the tool that are not explicitly defined4. Do NOT call the same tool multiple times with the same parameters**How To Use Tools**- When the user wants to reverse a string, call the string_reverser tool with the string as a parameter.How would you like the output to be formatted? Should it be a simple reversed string, or would you like any additional information included?๐ค You: I want the result formatted as a github markdown table with 2 coulmns. The left column should be the input and the right should be the output. Please include headers on the table๐ค Copilot: Based on your requirements, I'll refine the prompt.**Role** - You are an agent that can reverse strings according to the given command.**Tool Usage Guidelines** - 1. Before you call a tool, make sure you have all the required tool parameters.2. Do NOT assume any tool parameters3. Do NOT pass parameters to the tool that are not explicitly defined4. Do NOT call the same tool multiple times with the same parameters**How To Use Tools**- When the user wants to reverse a string, call the string_reverser tool with the string as a parameter.- Format the output of the string_reverser tool as a GitHub markdown table with two columns, "Input" and "Output", where the input string is in the "Input" column and the reversed string isin the "Output" column.Here's an example of what the output table might look like:| Input | Output || --- | --- || xyz | zyx |Are you interested in continuing to refine the prompt, or is this sufficient for your needs?๐ค You: That is sufficient
You can automatically refine an agent using feedback from chat sessions.To do this, start by creating an agent and chatting with it. You will see two icons below each agent response which allow you to provide either positive or negative feedback.After providing feedback, run the following command to refine an agent using feedback from chat sessions:
BASH
orchestrate copilot autotune
Show command flags
Flag
Type
Required
Description
--agent-name (-n)
string
yes
The name of the agent to refine.
--output-file (-o)
string
No
The path to a YAML or JSON file where Orchestrate copilot saves the new agent specification. Do not set this flag if you use the --dry-run flag.
--dry-run
bool
No
A flag that prevents saving the results to a file. Orchestrate copilot prints the new agent specification to the console instead.
--use-last-chat (-l)
bool
No
Use the last chat message instead of interactivly selecting the messages to refine from.
Command examples
Basic Autotune
Auto Dry Run
Autotune Last Chat
Autotune and agent with interactive message selection
Orchestrate copilot interation exampleThe following example shows how you interact with watsonx Orchestrate Copilot to refine an agent. Suppose youโve already created and imported a healthcare management agent, chatted with it, and provided feedback.
BASH
10 Most Recent Chats โโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Number โ Chat Date โ Title โ Last User Message โ Last User Feedback โโกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉโ 1 โ October 01, 2025 at 12:49 PM โ Show me healthcare providers โ Show me healthcare providers โ ๐ This would be better as a table โโ โ โ โ โ โโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโPlease enter up to 5 indices of chats you'd like to select, separated by commas (e.g. 1): 1[INFO] - Your agent refinement session finished successfully![INFO] - Agent YAML with the updated instruction saved in file: <output_path>.yaml