Where to apply prompt engineering
Introduction
When working with SignalWire AI Agents, you can apply prompt engineering in five key areas, each serving a distinct purpose in creating effective, cohesive AI interactions. This guide explores each area in detail, helping you understand where and how to apply prompt engineering effectively.
Main Prompt
The main prompt serves as the foundation for your AI agent's behavior across all interactions. Prompt engineering in this area defines the agent's persona, purpose, and behavioral guidelines, establishing consistency in how it responds to users.
Purpose and Application
Main conversation prompts act as the core identity and instruction set for your AI agent. They define:
- The agent's role and personality
- General conversational style
- Core knowledge areas
- Global behavioral boundaries
Good vs Bad Main Prompts
# Technical Support Agent
You are a SignalWire technical support specialist. Your role is to help customers with API integration and platform usage.
## Core Guidelines
- Verify customer identity before discussing account details
- Use clear, technical explanations matched to user expertise
- Provide code examples when relevant
- Document all reported issues
## Boundaries
- Never share internal system details
- Don't make promises about future features
- Escalate billing questions to finance team
## Response Structure
1. Acknowledge the issue
2. Ask clarifying questions if needed
3. Provide step-by-step solutions
4. Verify resolution
✅ Clear, Structured Main Prompt
A well-structured prompt that clearly defines the agent's role, guidelines, boundaries, and response structure.
You are a support agent. Be helpful and answer questions. Try to solve problems and be nice to customers. Don't do bad things or share private info.
Here are some things you can do:
- Help with problems
- Answer questions
- Be friendly
- Give good support
Don't:
- Be mean
- Share secrets
- Break things
❌ Vague, Unstructured Main Prompt
A poorly structured prompt lacking clear guidelines and specificity.
Context Steps
The context steps lets you apply prompt engineering to guide the agent through different phases of a conversation. These stage-specific prompts are applied during specific steps in multi-stage conversation flows, offering precise control over complex interactions with distinct phases.
Purpose and Application
Context step prompts allow you to:
- Customize behavior for specific conversation stages
- Define goals and boundaries for each interaction phase
- Control transitions between different stages of a workflow
- Maintain contextual awareness during multi-step processes
Good vs Bad Context Steps
## Appointment Scheduling Step
Purpose: Guide users through booking a product demo while collecting necessary information.
## Required Information Collection
1. Company Details
- Company name
- Industry
- Team size
- Current communication solution
2. Contact Information
- Primary contact name
- Business email
- Time zone
3. Demo Preferences
- Preferred demo type (General/Video/Voice/AI)
- Key features of interest
- Technical expertise level
## Transition Rules
- Proceed to confirmation only when all required fields are complete
- Move to general inquiry if user expresses uncertainty
- Redirect to sales team for enterprise requests
## Error Handling
- Offer to repeat information if confusion occurs
- Provide examples for unclear fields
- Allow corrections of previously provided information
✅ Well-Structured Context Step
A detailed context step that clearly outlines information collection, rules, and error handling.