Intended audience: analysts developers
AO Platform: 5.0
Overview
Prompt instructions are essential for tailoring the query generation system to meet specific business requirements. These instructions define unique business rules, clarify ambiguous terms, and ensure consistent interpretation of data for different clients or business units. By following this guide, you can create and manage Prompt instructions effectively to enhance the accuracy and relevance of generated queries.
Why Create Prompt Instructions?
Prompt instructions allow the query system to:
-
Align with Business Requirements: They ensure that queries generated are tailored to meet specific needs, incorporating unique definitions, metrics, and reporting requirements.
-
Maintain Consistency: Prompt instructions standardize terminology and logic across queries, reducing ambiguity and ensuring consistent data output.
-
Improve Query Relevance and Accuracy: By interpreting user prompts with specific instructions, the system produces more accurate results aligned with business expectations.
-
Enable Flexibility: Prompt instructions allow the query generation framework to evolve and adapt as business needs change without altering the core query logic.
When to Use Prompt Instructions?
Prompt instructions should be created when:
-
There’s a Unique Definition or Metric: For terms such as “high-value customer” or “trending” with specific definitions, Prompt instructions ensure accurate usage in queries.
-
Specific Metrics or Filters Are Required: For cases requiring unique calculations or filters, Prompt instructions can specify these rules.
-
Consistency Across Reports Is Necessary: Prompt instructions help maintain consistency by defining data points or calculations across different reports or dashboards.
-
The Query Relates to Context-Based Rules: If certain business rules apply only when specific contexts are met (e.g., date-based questions), a Prompt instruction can ensure these rules are followed.
Best Practices for Creating Prompt Instructions
Note: Instructions should only be utilized as a last resort when the desired outcome cannot be achieved using the current LLM configurations.
-
Keep Instructions Clear and Concise: Use straightforward language to ensure instructions are easily understood and avoid unnecessary steps. Concise instructions also reduce confusion. Use noun phrases wherever possible.
-
Minimize Instructions When Possible: Avoid adding extra instructions if alternatives exist, like adjusting synonyms or clarifying MSO descriptions directly.
-
Use Synonyms Instead of Instructions: If an MSO is not recognized by a particular keyword, avoid adding instructions. Instead, incorporate the keyword as a synonym within the MSO or its Properties section.
-
Avoid Instructions for Alternative Words: Rather than adding instructions, include alternative words in the MSO or Property's linguistic synonyms.
-
Disambiguate Using Value Synonyms: When multiple MSO Properties might apply, add values to the correct MSO Property's value synonyms to reduce ambiguity.
-
Define Terms and Logic Clearly: Avoid vague language by using specific metrics or conditions to precisely define terms like "high-value" or "top-performing." Additionally, avoid using negative instructions. For example, instead of saying, "Don’t include reps with low sales," say, "Include reps with monthly sales above $10,000."
-
Document Dependencies and Use Traits: Where instructions depend on other rules, use Traits or Default Properties. For example, apply the "spatial trait" to Address-related properties.
-
Test with Sample Queries: Run sample prompts after creating an instruction to confirm it works as expected. Refine as necessary to achieve the desired results.
-
Use Time and Date Context: For instructions based on time-based rules, specify how to handle date ranges and missing data to ensure consistent results.
-
Document and Store All Instructions: Maintain a record of Prompt instructions, including their purpose, examples, dependencies, and tags for easy retrieval.
Steps to Create a Prompt Instruction
-
Identify the Requirement: Determine the specific business need or logic the Prompt instruction will address.
-
Draft the Instruction: Write the instructions clearly. Example: “When ‘trending’ is requested, calculate based on the last three months’ average sales.”
-
Activate the Instruction: Implement the instruction in the query generation system, ensuring it doesn’t conflict with existing logic.
-
Test and Validate: Run sample prompts to confirm performance and adjust if needed.
-
Document and Store: Store the instructions with details, tags, and notes for future reference.
Context-Based Prompt Instructions
Context-based instructions apply specific logic based on the question’s context. For example, certain fields or filters might only be relevant when specific keywords (such as 'date') are present in a question.
Conclusion
Creating Prompt instructions for query generation aligns the output with specific business needs, improving consistency, accuracy, and relevance. Following best practices ensures instructions are clear, effective, and compatible with base query logic.
Contact App Orchid | Disclaimer