PromptBuilder Guide
A comprehensive guide to crafting effective prompts for AI language models.
Core Components
A prompt can be broken down into these essential components:
=[Task, Format, Voice, Context]
Where:
- Task (Required): What you want done
- Context (Required): Background information and constraints
- Format (Optional): How the output should be structured
- Voice (Optional): Tone and style of communication
Basic Structure
Minimal Prompt Template
=[Task: {action}, Context: {background}]
Complete Prompt Template
=[Task: {action}, Format: {structure}, Voice: {style}, Context: {background}]
Component Details
Task
- Must include a clear verb/action
- Should be specific and measurable
- Examples: "summarize", "analyze", "write", "create", "explain"
Context
- Anything you type in or paste
- Relevant background information
- Constraints and limitations
- Source materials or references
- Domain-specific knowledge
Format (Optional)
- Output structure (bullet points, paragraphs, table)
- Length requirements
- Special formatting needs
- File type or medium
Voice (Optional)
- Tone (formal, casual, technical)
- Perspective (first person, third person)
- Target audience
- Brand voice alignment
Syntax Variations
Verbose Style
Please {task} with the following parameters:
- Format: {desired structure}
- Voice: {tone and style}
- Context: {background information}
XML Style
<prompt>
<task>action to perform</task>
<format>desired structure</format>
<voice>tone and style</voice>
<context>background information</context>
</prompt>
JSON Style
{
"task": "action to perform",
"format": "desired structure",
"voice": "tone and style",
"context": "background information"
}
Custom Instructions Integration
Custom instructions can be used to set persistent preferences for:
- Default voice/tone
- Output format preferences
- Domain expertise
- Ethical constraints
- Language preferences
Example:
Custom Instructions:
1. Always use professional tone
2. Prefer bullet points for lists
3. Include source citations when possible
4. Use metric units
5. Write at university level
Best Practices
-
Be Specific
- Use clear, measurable terms
- Provide concrete examples
- State explicit constraints
-
Iterate
- Start simple
- Refine based on results
- Build complexity gradually
-
Context Matters
- Include relevant background
- Specify audience
- Define scope
-
Format Clearly
- State structural requirements
- Define length constraints
- Specify output format
Example Prompts
Basic
=[Task: write a product description, Context: eco-friendly water bottle]
Complete
=[Task: write a product description, Format: 3 paragraphs with bullet points, Voice: enthusiastic and eco-conscious, Context: stainless steel water bottle with recycled materials]
Professional Email
=[Task: draft an email, Format: business letter, Voice: professional and concise, Context: meeting followup with action items from Project X discussion]
Emerging Standards
-
Role-Based Prompting
As a {role}, {task} for {audience}... -
Chain-of-Thought
Think through this step by step: 1. First, consider... 2. Then analyze... 3. Finally, conclude... -
Few-Shot Learning
Example 1: {input} -> {output} Example 2: {input} -> {output} Now do: {new input}
Tips for Success
- Start with required components (Task and Context)
- Add Format and Voice as needed
- Use consistent syntax within projects
- Iterate and refine based on results
- Document successful prompt patterns
- Build a prompt library for common tasks
- Use custom instructions for persistent preferences
Troubleshooting
If the output isn't what you expected:
- Verify task clarity
- Add more specific context
- Adjust format requirements
- Modify voice/tone
- Break into smaller subtasks
- Use example outputs
- Try alternative syntax
PLINQ (Prompt Integrated Natural Query) Specification
Overview
PLINQ is a structured approach to prompt engineering that borrows concepts from SQL to create more precise and predictable prompt outcomes. It provides a formal way to compose prompts using familiar database-like operations.
Basic Syntax
Query Structure
{OutputType}_BY_{Constraint}_WITH_{Parameter}_IN_{Context}
Basic Operators
_BY_: Primary filter/constraint_WITH_: Additional parameters_IN_: Context specification_AS_: Output format_FOR_: Target audience/purpose
Common Patterns
Recipe Generation
Recipe_BY_Ingredients_WITH_Time(30min)_IN_ItalianCuisine
Translates to: "Create a recipe using these ingredients, taking 30 minutes, in Italian cuisine style"
Content Creation
BlogPost_BY_Topic(AI)_WITH_Length(1000words)_AS_Tutorial
Translates to: "Write a 1000-word blog post about AI in tutorial format"
Analysis
Analysis_BY_Metrics(ROI,Growth)_IN_Q4Report_AS_ExecutiveSummary
Translates to: "Analyze ROI and Growth metrics from Q4 Report as an executive summary"
Complex Queries
Multiple Constraints
MealPlan_BY_Diet(Vegan)_AND_BY_Calories(1500)_WITH_Shopping(List)
Nested Contexts
Email_BY_Purpose(Meeting)_IN_(Project(Alpha)_WITH_Team(Development))
Modifiers and Parameters
Format Modifiers
{Content}_AS_{Format}
- _AS_Bullet
- _AS_Table
- _AS_Paragraph
- _AS_JSON
Audience Modifiers
{Content}_FOR_{Audience}
- _FOR_Experts
- _FOR_Beginners
- _FOR_Stakeholders
Examples in Practice
Content Creation
Article_BY_Topic(AI Ethics)_WITH_Length(2000)_FOR_GeneralAudience_AS_Discussion
Generates: An article about AI Ethics, 2000 words long, written for general audience in discussion format
Technical Documentation
Documentation_BY_Feature(Authentication)_IN_Project(UserAPI)_AS_TechnicalSpec
Generates: Technical specification for authentication feature in UserAPI project
Business Analysis
Report_BY_Metrics(Revenue,Growth)_IN_Q2Data_WITH_Visuals(Charts)_FOR_Executives
Generates: Executive report analyzing revenue and growth from Q2 data, including charts
Advanced Features
Temporal Parameters
Forecast_BY_Data(Sales)_IN_TimeRange(2024Q1-2024Q4)_WITH_Confidence(95)
Conditional Logic
Content_BY_IF(Metric > Threshold)_THEN_Style(Positive)_ELSE_Style(Neutral)
Best Practices
- Consistency: Use consistent naming conventions for parameters
- Clarity: Keep queries readable and logical
- Modularity: Break complex queries into smaller, reusable parts
- Documentation: Comment complex queries for future reference
- Validation: Include parameter type checking where possible
Use Cases
Content Generation
Blog_BY_Keywords(AI,ML)_WITH_SEO(High)_FOR_TechAudience
Newsletter_BY_Industry(Tech)_WITH_Frequency(Weekly)
Tutorial_BY_Topic(Python)_FOR_Beginners_WITH_Examples
Business Documentation
Proposal_BY_Service(Consulting)_WITH_Budget(100K)_AS_PDF
Contract_BY_Type(NDA)_WITH_Party(Client)_IN_Legal(US)
Report_BY_Department(Sales)_WITH_Period(Q3)_AS_Dashboard
Creative Writing
Story_BY_Genre(SciFi)_WITH_Length(Short)_FOR_YoungAdults
Poetry_BY_Style(Haiku)_WITH_Theme(Nature)_IN_Season(Spring)
Script_BY_Format(Dialogue)_WITH_Characters(2)_IN_Setting(Future)