As an expert prompt engineer, review the below meta prompt generator mentioned between…
- User
As an expert prompt engineer, review the below meta prompt generator mentioned between *** and ***
You are a prompt engineering expert who creates prompts for AI agents. Your task is to analyze the capability specification provided between tags and generate a comprehensive prompt that will guide the behavior of a final AI agent.
INPUT PROCESSING
Follow these steps to extract necessary information:
- Extract Constraints: Identify and list all constraints from the capability specification.
- Determine the Goal: Determine the AI agent's goal from the "goal" field in capability specification.
- Identify Parameters and Validation Rules: List all required parameters and their respective validation rules.
- Note Formatting Requirements: Record any specific formatting instructions.
- Parse Allowed and Forbidden Patterns: For each field, specify patterns that are allowed or forbidden based on the specification.
- For each required parameter, define explicit missing value handling rules -- whether it should be explicitly requested from the user or assumed from a reasonable default.
PROMPT GENERATION RULES
Your output MUST be a complete prompt that:
- Addresses the Agent Directly: Begin with "You are..." to engage the final AI agent.
- Defines Constraints Clearly: State all constraints explicitly and unambiguously.
- Includes Valid and Invalid Examples: Provide specific examples demonstrating both compliance and violation of constraints.
- Provides a clear thought process template.
- Explicitly handles missing required parameters
REQUIRED SECTIONS IN GENERATED PROMPT
Your generated prompt MUST include these sections with full detail:
1. STRICT CONSTRAINTS AND VALIDATION
- List All Constraints: Enumerate every constraint extracted, ensuring none are overlooked.
- Validation Rules: Define how each constraint should be validated.
- Forbidden Patterns: State "MUST NOT" rules for forbidden patterns
- Invalid Response Examples: Provide examples of responses that violate constraints.
- For required parameters:
- MUST check if parameter value is present in user query
- MUST ask user for missing required parameters whenever necessary
2. FIELD-SPECIFIC CONSTRAINTS
For each field:
- Allowed Content: Specify what content is permissible, based solely on the provided specification.
- Forbidden Content: Clearly state prohibited content.
- Validation Examples: Provide examples showing correct and incorrect usage.
- Error Conditions: Define how to handle invalid or missing data
- For parameters field:
- MUST explicitly validate presence of required parameters
- MUST generate parameter request message if any are missing
3. RESPONSE STRUCTURE
Must enforce exact JSON structure with fields:
- thought: Detailed reasoning process including parameter validation
- message: User-facing response that either:
- Contains the answer to the user's query following all constraints, OR
- Requests parameter values from the user whenever necessary
- parameters: All parameters with valid values
- related_queries: 3-5 relevant follow-up queries
4. THOUGHT PROCESS TEMPLATE
Must include steps for:
- Constraint Validation: Check all inputs and planned outputs against the constraints.
- Parameter Check: Ensure all required parameters are filled.
- Content Generation: Create content that satisfies the user's query and adheres to constraints(only if all required parameters are present).
- Parameter Processing: Ensure all parameters are correctly utilized and validated.
- Final Validation: Review the response for compliance before producing it.
5. COMPREHENSIVE EXAMPLES
Provide THREE examples:
- Two Valid Responses:
- Demonstrate correct adherence to all constraints.
- Missing parameter example showing correct parameter request behavior
- One Edge Case: Present a complex scenario with intricate constraint interactions.
Include for each:
- Query: The user's input.
- Response: The agent's output in the specified JSON structure.
6. ERROR PREVENTION
Include instructions for the agent to:
- Double-Check Constraints: Always verify constraints before responding.
- Avoid Assumptions: Never presume any constraint is flexible.
- Request Information: If required parameters are missing or invalid, ask the user for the necessary information without mentioning internal validation failures.
7. CRITICAL RULES
Emphasize that the agent must:
- Never Violate Field-Specific Constraints: Adhere strictly to constraints per field.
- Always Validate Against Forbidden Patterns: Ensure no prohibited content is included.
- Include All Required Parameters: Verify that all necessary parameters are present.
- Avoid Placeholder Values: Use actual data, not placeholders, if not available leave it empty.
- Follow the Thought Process Template: Adhere to the outlined reasoning steps.
- Do not Skip Constraint Validation: Always perform validation before responding.
- Use Only Provided Information: Do not include or infer information not present in the capability specification.
- Do Not Mention Internal Processes: Avoid referencing internal validations or errors to the user.
- Request missing required parameters from user whenever necessary
OUTPUT FORMAT
Generate your prompt using this structure:
---BEGIN PROMPT---
You are a specialized AI assistant for [Actual App Name from Specification]. Your purpose is to [Specific Purpose from Goal field in Capability Specification].
-
STRICT CONSTRAINTS AND VALIDATION
[Insert the detailed constraints and validation rules here, using only information from the specification.]
-
FIELD-SPECIFIC CONSTRAINTS
[Insert detailed constraints for each field, based solely on the provided specification.]
-
RESPONSE STRUCTURE
[Exact JSON structure with field specifications]
-
THOUGHT PROCESS TEMPLATE
[Insert detailed thought process steps here.]
-
COMPREHENSIVE EXAMPLES
[Provide THREE detailed examples including validation here, ensuring examples are relevant and accurate according to the specification.]
-
ERROR PREVENTION
[Detail specific validation requirements and how to handle missing or invalid information politely.]
-
CRITICAL RULES
[Emphasize core rules and their importance, including using only provided information and not mentioning internal processes.]
---END PROMPT---
CRITICAL REQUIREMENTS FOR PROMPT GENERATOR
- The generated prompt must be COMPLETE and ready to use.
- Replace ALL placeholder values with actual values from the specification.
- Include SPECIFIC examples relevant to the capability.
- Define EXPLICIT validation rules for each field.
- Never use generic placeholders like {{app_name}} in the final output.
- Always include detailed validation steps in examples.
- Make all constraints and rules explicit and unambiguous.
- Use ONLY the information provided in the capability specification. DO NOT add any information or make assumptions beyond what is given.
- Do NOT include any hallucinated content or infer information that is not explicitly stated in the specification.
Now, please parse the following capability specification and generate a complete prompt for the final agent:
- Assistant
As an expert prompt engineer, I have reviewed the meta prompt generator you provided. Here is my assessment:
Overall Assessment
The meta prompt generator is comprehensive and methodically structured, providing clear and detailed instructions for generating a prompt that will guide the behavior of a final AI agent. It emphasizes critical aspects such as constraints, validation rules, response structure, and thought processes, which are essential for creating a robust and reliable AI assistant.
Strengths
-
Detailed Input Processing Steps: The meta prompt outlines a clear process for extracting necessary information from the capability specification, ensuring that all relevant aspects are considered.
-
Comprehensive Prompt Generation Rules: It provides explicit rules for generating the prompt, which helps maintain consistency and ensures that the final prompt adheres to the desired guidelines.
-
Structured Sections: By specifying the required sections in the generated prompt, it ensures that the prompt covers all critical areas, including constraints, field-specific details, response structure, thought process, examples, error prevention, and critical rules.
-
Emphasis on Constraints and Validation: The focus on strict constraints, validation rules, and forbidden patterns helps in creating an AI agent that behaves predictably and minimizes errors.
-
Thought Process Template: Including a thought process template guides the AI agent in reasoning through its responses, enhancing the quality and reliability of its outputs.
-
Examples Provided: Requiring comprehensive examples helps in illustrating the expected behavior of the AI agent, serving as a reference for both the prompt engineer and the agent itself.
-
Critical Requirements Emphasized: By highlighting critical requirements and rules, it minimizes the risk of oversights and ensures that the most important aspects are not neglected.
Areas for Improvement
-
Placeholder Replacement Emphasis: While the meta prompt mentions replacing placeholders with actual values from the specification, it could further emphasize the importance of this step to prevent any placeholders from being left in the final prompt.
-
Redundancy in Instructions: Some instructions are repeated across different sections (e.g., handling of missing required parameters). Streamlining these could make the meta prompt more concise.
-
Clarification on Forbidden Content: In some sections, it may be beneficial to provide more guidance on how to handle forbidden content, especially in relation to error messages or user interactions.
-
Handling Missing Capability Specification: Since the
{app_description}placeholder is used, the meta prompt could include instructions on how to proceed if the capability specification is incomplete or missing information.
Suggestions
-
Enhance Instructions on Placeholder Replacement: Add a prominent note or reminder to ensure that all placeholders (e.g.,
{app_description},[Actual App Name from Specification],[Specific Purpose from Goal field in Capability Specification]) are replaced with actual information from the capability specification. -
Consolidate Redundant Points: Review the meta prompt for any redundant instructions and consolidate them to improve clarity and reduce potential confusion.
-
Provide Guidance on Error Messaging: Include examples or guidelines on how the AI agent should communicate with the user when handling forbidden content or constraints violations, ensuring that messages are polite and helpful without revealing internal processes.
-
Include a Template for Capability Specification: Offering a template or example for the capability specification could assist prompt engineers in providing complete and detailed information for prompt generation.
Conclusion
The meta prompt generator is a robust tool for creating comprehensive prompts that guide AI agent behavior effectively. By addressing the suggested areas for improvement, it can become even more effective and user-friendly, ensuring that the final AI agents perform optimally within the specified guidelines.
Next Steps
To generate a complete prompt for the final agent, I would need the actual capability specification provided within the
<details>tags (replacing{app_description}with the specific details). Once the capability specification is available, I can proceed to:- Extract constraints, goals, parameters, and validation rules.
- Generate the prompt according to the specified rules and required sections.
- Ensure that all placeholders are replaced with actual values from the specification.
- Include specific examples relevant to the capability.
- Define explicit validation rules for each field.
Please provide the detailed capability specification, and I'll be happy to generate the prompt accordingly.
-