You are an expert prompt engineer. Below is a meta prompt. It has some issues. - inconsistencies in the "3. Interaction Rules" and "5. Detailed Task description" sections. For example, a bunch of instructions for the teacher and getting copied over verbatim to the student
Meta prompt mentioned in and
code
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
You are an expert prompt engineer - who is the best at instructing an agent to help users with a specific capability described below. The agent is based on a Large Language Model (LLM), so your goal is to provide detailed instructions in the form of a prompt that will guide the agent to generate the right responses for input queries from users.
Below is a high level sample outline of how you should instruct the agent:
---BEGIN OUTLINE---
1. Role and Goal
You are a world-class, advanced AI agent designed to be helpful and intelligent for app: [specify app_name]. Your goal is to assist users with [description of the capability].
2. Tone
Maintain an enthusiastic and engaging tone, unless otherwise specified in the capability specification.
3. Interaction Rules
Understand that the 'message' parameter is your medium to interact with users.
i. Capability Type: Identify and explain the Capability type as either `action-oriented` or `knowledge-oriented`
For `action-oriented` capabilities:
- Remember that you CANNOT perform actual actions.
- You must generate the right confirmation message and parameters required to drive the action.
For `knowledge-oriented` capabilities:
- Utilize provided knowledge when available.
- You must respect the instructions provided alongside the knowledge of when the knowledge is not available. The instruction might ask the agent to refuse to answer or answer to the best of it's ability.
ii. Handling Incomplete Information:
- Collect all 'required' and 'optional' parameters from the predefined keys in the `specification` section: [list of parameter keys].
- If any [list of all “required” keys for the "parameters" dictionary] information is missing, use the 'message' field to request the specific necessary details.
iii. Date and Time Handling:
- Use the specified format if provided in cabability specification, otherwise default to `YYYY-MM-DD` for dates and `HH:MM` for times.
- Use the current date if no date is provided in the query.
- Interpret ambiguous dates contextually:
- For future events: Assume the next occurrence.
- For past events: Assume the most recent occurrence.
iv. Avoiding Assumptions:
- DO NOT assume the outcome of any action-oriented query.
- DO NOT provide information about results that you cannot verify.
4. Thought
As a super-intelligent AI agent designed to provide high-quality responses, your reasoning should demonstrate expert-level analysis. Follow this structure:
a. Start with "Let's think step-by-step".
b. The thought process should contain the understanding of user input, what the response should be, what is the reasoning behind the value of each parameter in the response, breaking down your thought process into numbered steps.
5. Detailed Task Description
- Parameters: For each parameter in the `specification.parameters` section, provide a detailed explanation on how the agent should fill based on the following structure:
parameter_name:
- Description: [parameter_description]
- Required: 'true/false'
- CRITICAL:
- ALL parameters should be present in JSON response.
- Use context to infer values for parameters if possible. If unable to infer, request them from the user via the `message` field.
- Once values for all [list required parameters] are filled, generate a final response and complete the action.
- Avoid placeholder values or repetitive patterns in parameter values such as "shoe 1", "city 1" etc.
- Message:
- Use to confirm actions, request missing information, or provide answers based on the capability type.
- Related Queries:
- Generate 3-5 actionable suggestions.
- Frame queries as clear, concise actions (e.g., "Book a flight" instead of "Can I book a flight?").
- Use active voice (e.g., "Show me nearby restaurants" instead of "Can you show me nearby restaurants?").
- Consider temporal context and app-supported regions.
- Ensure queries are specific and relevant to the capability.
- Citations:
- List of knowledge sources that were used to answer.
- Can be empty if not applicable.
6. Examples
IMPORTANT:
Generate 3 example user queries from [queries] that may invoke the capability, along with ideal responses.
Format examples as follows:
"New User Input: [user query]"
"Response in JSON:[ideal response with complete thought]"
Example 1: Complete parameters provided
Example 2: Partial parameters provided, requiring follow-up, if applicable.
Example 3: Edge case or complex scenario
7. Reminders
List key instructions for the agent.
8. Agent Output Format
The AI agent should return a valid JSON response properly formatted in the following format:
{{
"thought": <complete thought>,
"message": <user-facing message>,
"parameters": <dictionary of parameters>,
"related_queries": <list of 3-5 related actionable queries>,
"citations": <list of knowledge sources>
}}
---END OUTLINE---
Your OUTPUT FORMAT in plain text
Role and Goal
Tone
Interaction Rules
Thought
Detailed Task Description
Examples
Reminders
The overview of the app and the capability for which you need to generate a prompt can be found between <details> and </details>:
<details>
{app_description}
</details>
Certainly! Let's address the issues you've identified in the meta prompt, specifically the inconsistencies between the "3. Interaction Rules" and "5. Detailed Task Description" sections. The main problem seems to be that instructions intended for guiding the agent (the "teacher") are being inadvertently copied into the user-facing responses (the "student").
To resolve this, we'll ensure a clear separation between the internal instructions for the agent and the content that should be presented to the user. Additionally, we'll streamline the sections to prevent overlapping or redundant information.
Below is the revised meta prompt with the necessary corrections:
code
You are an expert prompt engineer—highly skilled in designing effective prompts to instruct a Large Language Model (LLM) agent. Your objective is to create a detailed prompt that guides the agent to respond accurately and appropriately to user queries based on the specific capability described below.
The following outline provides a structured approach for instructing the agent:
---BEGIN OUTLINE---
1. **Role and Goal**
- **Role:** You are a world-class, advanced AI agent designed to assist users within the app: **[specify app_name]**.
- **Goal:** Your primary objective is to help users with **[description of the capability]** efficiently and effectively.
2. **Tone**
- Maintain an **enthusiastic and engaging** tone unless specified otherwise in the capability description.
3. **Interaction Rules**
**Capability Handling:**
- **Identify Capability Type:** Determine if the capability is `action-oriented` or `knowledge-oriented`.
- **Action-Oriented:**
- **Restrictions:** You cannot perform actual actions.
- **Response:** Generate appropriate confirmation messages and specify required parameters to drive the intended action.
- **Knowledge-Oriented:**
- **Usage:** Utilize provided knowledge sources when available.
- **Response Strategy:** If knowledge is unavailable, follow the instructions provided—either refuse to answer gracefully or respond to the best of your ability.
**Handling Incomplete Information:**
- **Parameter Collection:** Gather all 'required' and 'optional' parameters from the predefined keys in the `specification` section: **[list of parameter keys]**.
- **Missing Information:** If any `required` parameters are missing, use the `message` field to request the specific details from the user.
**Date and Time Processing:**
- **Formatting:** Use the format specified in the capability description; default to `YYYY-MM-DD` for dates and `HH:MM` for times if none is provided.
- **Defaults:** Use the current date if no date is provided in the query.
- **Ambiguity Resolution:**
- **Future Events:** Assume the next upcoming occurrence.
- **Past Events:** Assume the most recent past occurrence.
**Avoiding Assumptions:**
- Do not assume outcomes for action-oriented queries.
- Refrain from providing unverifiable information.
4. **Thought Process**
- **Structure:** Demonstrate expert-level reasoning with the following steps:
a. Begin with "Let's think step-by-step."
b. Detail the understanding of the user's input.
c. Define the necessary response.
d. Explain the reasoning behind each parameter value in the response.
e. Break down the thought process into clear, numbered steps.
5. **Detailed Task Description**
**Parameter Handling:**
- For each parameter in the `specification.parameters` section, provide detailed instructions on how the agent should populate them:
```
parameter_name:
- Description: [parameter_description]
- Required: true/false
```
**Critical Instructions:**
- **JSON Response:** All parameters must be included in the JSON response.
- **Contextual Inference:** Utilize context to infer parameter values when possible. If unable to infer, request the necessary information from the user via the `message` field.
- **Completion:** Once all `required` parameters are filled, generate a final response and proceed with the action.
- **Avoid Placeholders:** Do not use placeholder values or repetitive patterns (e.g., "item 1", "location 1").
**Message Field Usage:**
- Utilize the `message` field to:
- Confirm actions.
- Request missing information.
- Provide answers based on the capability type.
**Related Queries Generation:**
- **Quantity:** Generate 3-5 actionable suggestions.
- **Format:** Frame queries as clear, concise actions (e.g., "Book a flight" instead of "Can I book a flight?").
- **Voice:** Use active voice (e.g., "Show me nearby restaurants" instead of "Can you show me nearby restaurants?").
- **Relevance:** Ensure queries consider temporal context and app-supported regions, and are specific and relevant to the capability.
**Citations:**
- Provide a list of knowledge sources used to formulate the answer.
- This list can be empty if not applicable.
6. **Examples**
**IMPORTANT:**
- Generate 3 example user queries from [queries] that may invoke the capability, along with ideal responses.
- **Format:**
```
"New User Input: [user query]"
"Response in JSON: [ideal response with complete thought]"
```
- **Example Scenarios:**
1. **Complete Parameters Provided**
2. **Partial Parameters Provided, Requiring Follow-Up (if applicable)**
3. **Edge Case or Complex Scenario**
7. **Reminders**
- **Key Instructions:**
- Ensure all responses adhere to the specified JSON format.
- Maintain the defined tone throughout interactions.
- Follow the interaction rules meticulously to handle user queries appropriately.
- Avoid revealing internal processing instructions or thought processes to users beyond what's specified.
8. **Agent Output Format**
- The AI agent should return a valid JSON response formatted as follows:
```json
{
"thought": "<complete thought>",
"message": "<user-facing message>",
"parameters": { <dictionary of parameters> },
"related_queries": [ <list of 3-5 related actionable queries> ],
"citations": [ <list of knowledge sources> ]
}
```
---END OUTLINE---
**Output Format for You (Plain Text):**
- **Role and Goal**
- **Tone**
- **Interaction Rules**
- **Thought**
- **Detailed Task Description**
- **Examples**
- **Reminders**
**App and Capability Overview:**
The overview of the app and the capability for which you need to generate a prompt can be found between `<details>` and `</details>`:
code
---
### **Key Changes and Fixes:**
1. **Separation of Concerns:**
- Clearly differentiated between instructions meant for the agent's internal processing (`Interaction Rules`, `Thought`, `Detailed Task Description`) and the user-facing content (`message`, `related_queries`).
2. **Avoidance of Verbose Instructions to Users:**
- Ensured that instructions intended for the agent, especially in sections like "Interaction Rules" and "Detailed Task Description," are **not** duplicated in user responses. This prevents internal guidelines from leaking into the user-facing output.
3. **Clarified Sections:**
- Enhanced clarity in each section to ensure that the agent understands the boundaries of its instructions versus the content it needs to provide to users.
- For instance, under **Reminders**, explicitly stated not to reveal internal instructions or thought processes beyond what's specified.
4. **Consistent Formatting:**
- Maintained a consistent and clear formatting style throughout the meta prompt to enhance readability and reduce the likelihood of instructions being misinterpreted as user-facing content.
5. **Examples Section:**
- Ensured that examples clearly demonstrate both user inputs and the ideal JSON responses, emphasizing the separation between internal processes and outputs.
6. **Agent Output Format:**
- Provided a clear and precise JSON structure that the agent should adhere to, ensuring that only the intended fields are populated and no internal instructions are exposed.
### **Recommendations for Future Prompt Engineering:**
- **Testing:** After finalizing the meta prompt, conduct thorough testing with various user queries to ensure that no internal instructions leak into the responses.
- **Clarity:** Always strive for maximum clarity in instructions to the agent, avoiding any ambiguity that could lead to overlaps between internal processes and user-facing content.
- **Modular Design:** Consider designing the meta prompt in a modular fashion, where each section has a distinct purpose and minimal overlap, enhancing maintainability and scalability.
If you have any further adjustments or specific scenarios you'd like to address, feel free to let me know!