Prompt Engineering is the most important part of your agent, it can make or break your agent. This guide will share our findings on how to write prompts that agents can follow more reliably.

This guide is a work in progress and will be updated as we learn more. If you have any suggestions or feedback, please let us know.

To check some of the prompts we have created, you can look at templates in Dashboard (create a new agent and select a template to start). ​

Using Ask Co-Pilot

If you’re unsure how to craft an effective prompt, don’t worry. Ask Co-Pilot can guide you through the process. It will ask you a series of relevant questions, step-by-step, to help you formulate a clear and concise prompt. This interactive approach ensures you cover all necessary details and get the best possible response from the AI Agent.

Existing Context

The AI Agent already has information from the profile and can access certain known details:

  • You do not need to restate the AI Agent’s name or characteristics.
  • You do not need to provide the current time.
  • If the person the AI is interacting with is already in its contact database, there’s no need to reintroduce their details.

Sectional Prompts

When writing prompts, it is important to break down the system prompts into smaller sections, where each section has its focus, like identity, style, guideline, task & goals. This has a couple of benefits:

  • reusable
  • easier to maintain
  • easier for LLM to understand

The AI Agent can understand all languages specified in the profile. Feel free to write the prompt in any of these languages to get the most natural and contextually rich response.


## Identify
You are a friendly AI assistant for OneInbox AI. ....

## Style Guardrails
Be concise: ...
Be conversational: ...
...

## Response Guideline
Return dates in their spoken forms: ...
Ask up to one question at a time: ...
...

## Task
1. Greet the user
...

Write Task as Steps

During a call, if you want agent to follow a specific procedure to lead the conversation, we recommend writing the task as steps. This will help LLM understand what to ask at each step and how to proceed. You can have some logic in the steps as well. This also ensures agent does not pack all questions in one go.

## Task
1. Ask for user's name.
2. Ask if user needs a refund, need a replacement, or just retriving information.
  - if user needs a refund, transition to refund state.
  - if user needs a replacement, transition to replacement state.
3. If user is just retriving information, ask for the order number.
...

If you noticed that the agent is still not stopping at the right time, or you need to go through some steps and not stop at each step, you can write it like the following by adding wait for user response to be more explicit:

## Task
1. Inform user why you are calling.
2. Ask for user's name.

wait for user response

3. Ask if user needs a refund, need a replacement, or just retriving information.

wait for user response
  - if user needs a refund, transition to refund state.
  - if user needs a replacement, transition to replacement state.


4. Ask for the order number.

wait for user response
...

Using Infobase

If you’re using Infobase, you can attach a specific document folder for the AI Agent to reference when generating responses. This ensures that the AI Agent draws information from the most relevant and updated documents at all times.

Slash Commands

Use slash commands to add dynamic elements to your prompts and instruct to when trigger any during call action:

  1. Core Commands

    • /Customer Name - Inserts customer/contact’s name stored in contacts module
    • /Customer Email - Inserts customer/contact’s email stored in contacts module
    • /Customer Number - Inserts customer/contact’s number stored in contacts module
    • /Date - Current Date and Time as per Agent’s TimeZone
    • /To Number - To Number while making or receiving call
    • /From Number - From Number while making or receiving call
    • /Call Direction - Direction of the call, Inbound or Outbound
  2. Action Commands

Any Action which can be triggered during call will be visible here e.g sending SMS, emails, finding slots in calendar or booking slots etc..This helps AI agents to understand the exact moment when an action needs to be performed based on the ongoing conversation, ensuring relevance and timeliness. For example, You have enabled Send SMS during call with the action name “Send Notification” then action will be shown here as /Send Notification

Best Practices

  1. Prompt Writing

    • Keep instructions clear and specific
    • Use natural language
    • Include example dialogues
    • Define boundaries and limitations
    • Specify error handling
  2. Template Usage

    • Start with templates as base
    • Customize to match brand voice
    • Test thoroughly before deployment
    • Document modifications
  3. Command Integration

    • Use slash commands strategically
    • Combine commands for complex workflows
    • Test variable resolution
    • Plan fallback responses
  4. Testing and Iteration

    • Test prompts with various scenarios
    • Review and refine responses
    • Gather user feedback
    • Update prompts regularly

Management Tips

  1. Version Control

    • Save different versions of prompts
    • Document changes and updates
    • Keep backup of working prompts
  2. Performance Monitoring

    • Track successful interactions
    • Monitor command usage
    • Identify common issues
    • Analyze user satisfaction
  3. Maintenance

    • Regular prompt reviews
    • Update business information
    • Refresh templates
    • Optimize based on analytics

FAQs