Optimize for key metrics

Identify what are the key metrics/ dispositions being tracked that make the conversation successful. Every turn some % of users will inevitably drop off, so it is optimal to ensure that the key objective of the conversation is satisfied in as few turns as possible. Additional or secondary information can be moved to later in the conversation flow.

Handle partial information

In case a user provider partial information, a human agent typically will ask the user to continue or to share the remaining information. e.g. if asking for someone’s DOB, if they say 15th March, ask them for the year only, don’t just ask for DOB again. Design your conversation flow keeping this approach in mind.
Using jinja liberally can significantly shorten prompts and make them more reliable. https://jinja.palletsprojects.com/en/stable/templates/
Reinforcing critical instructions (e.g. don’t talk about competitors), is better to do in Guidelines than in Global Instruction. The model will pay more attention to guidelines.
  • Ensure that the fallback for such a case is very clearly defined to ensure a reliable experience.

Instruction order for highest reliability

In any step, ensure that the order of instructions is the following for highest reliability
  1. Condition / Hook to trigger the instruction
  2. Retrieve from KB
  3. Update Variable
  4. State Transition
  5. End Interaction
  6. Tool Call
  7. Audio (or Text)
e.g “If user says yes, update variable:Disposition to “Agreed” and tell the user “Thank you for agreeing to accept the delivery”.

Prompting Tips

If required to update variables and speak audio within same turn, structure the prompt to keep variable updates towards the start of the prompt, and audio to be spoken towards the end. Follow this convention for even ending conversation e.g update variable:Disposition to “true”, then say: “audio to be spoken” e.g update variable:Disposition_first to “first”, update variable:Disposition_second to “second”, then say: “audio to be spoken” The phrase to add in the prompt for ending conversation reliably is ‘end interaction’ e.g if the user agrees to send the message, then end interaction. e.g Update @Disposition to ‘value’, then end interaction and then say: “thank you for your time, have a nice day.” Note that in this example, the prompt is structured to keep variable updates and end interaction towards the start and the audio to be spoken while ending the interaction towards the end. If Else conditions within prompts (not using jinja). structure the if and else parts as multiple if statements with context e.g if the user agrees to send the message, then say: “Thank you for agreeing to send the message” if the user disagrees to send the message, then say: “I understand, but I strongly recommend to send the message”