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.
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.
Main conversation prompts act as the core identity and instruction set for your AI agent. They define:
A well-structured prompt that clearly defines the agent’s role, guidelines, boundaries, and response structure.
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.
Context step prompts allow you to:
A detailed context step that clearly outlines information collection, rules, and error handling.
When using SWAIG Functions with your SignalWire AI Agents, prompt engineering can be applied directly in the function properties themselves. Rather than embedding guidance in your main prompt text, you provide this context through descriptive function names and clear descriptions.
The function definition itself contains the prompting information the AI needs:
check_appointment_availability is better than function_1)Below is a side-by-side comparison of a well-defined versus a poorly defined SWAIG function:
The post-prompt is where prompt engineering can be applied to process conversation data after an interaction has completely ended. Unlike other areas that affect the live conversation, post-processing prompts guide activities to extract valuable insights and structured data from completed interactions.
Post-prompts enable:
A comprehensive post-processing prompt with clear data requirements and output format.
The conscience is where prompt engineering establishes fundamental ethical boundaries that bind the agent to its core purpose and values. Applied continuously across all interactions as core principles, prompts in this area ensure the agent maintains alignment with essential values regardless of other instructions it might receive.
Conscience prompts provide:
Well-structured ethical guidelines with clear boundaries and protocols.