AI Agent Prompt Engineering

Prompt engineering plays a vital role in shaping the behavior and output of AI agents. It involves crafting precise and strategic instructions, or prompts, that guide the AI to provide relevant and useful responses. This guide will delve deep into the techniques and best practices specific to CloudCX AI agents, helping users understand how to formulate prompts that can unlock the full potential of these intelligent systems.


Writing Skills for AI prompts

Clarity

Use simple language, avoiding jargon and complex structures. Be specific in your request. For example, "Summarize this 500-word article into 100 words, highlighting the key points."

Context

Provide relevant background information and set the scene/domain. For example, in online customer service for a software product, mention the nature of the issue, such as “What are the common steps and potential pitfalls regarding user inquiries about the installation process for our software product?” or “What are the typical responses and solutions in handling customer complaints about software performance?”

Formatting

Use proper punctuation. Use bullet points or numbered lists for multiple items. Consider complex cues for headings/subheadings to improve organization.

Controlling the Scope of Responses

To ensure that the AI ​​agent's responses do not exceed the appropriate scope for an online customer service agent, be precise in your prompts. For example, you could say, "Provide brief responses (within 100 words) to customer questions about the compatibility of the software with their operating system. Focus only on the main compatibility points and do not include other technical details unless specifically requested." or "When answering customer questions about new features in the software, list the top 3 features and brief descriptions (no more than 50 words each) that customer service agents typically share. Avoid in-depth technical explanations or comparisons to other software." In this way, you can guide the AI ​​to provide focused and relevant responses that are appropriate for the online customer service environment without going beyond the scope or technicality of what the agent typically communicates.

AI Prompt Writing Specifications

The writing of prompts needs to include some necessary input and output formats. Incorrect input and output formats will lead to abnormal and non-compliant output content.

The recommended writing method by CloudCX is as follows:

  • (SHOULD) Write prompts in English and control the output of the AI Agent through language variables.

  • (MUST) The prompts must contain the necessary variables required for AI analysis. Otherwise, the AI Agent will work abnormally and cannot correctly reference the conversation context and documents.

System-defined variable formats cannot be modified. The following are the necessary variables applied to the AI function:

AI Agent Variables

Input format and parameters

  1. Knowledge base and context

Those variable and format are used to insert chat context and knowledge base information uploaded in the Dataset that the AI Agent uses to generate reply content in prompts.

<knowledge_base> {context} </knowledge_base>
  1. Language control

This variable used to insert in prompts to control the AI Agent to generate reply content in a specified language. The following are the variable and its possible values respectively:

{{language}}

Output format and parameters

The output content must be in the following format. The content replied by the AI Agent will be inserted into the <answer> node, and the status of the content replied by the AI Agent will be presented in <conversation_status>.

<response> <answer> [Your answer to the user's query] </answer> <conversation_status> [Indicate whether the conversation should continue or end, based on the criteria mentioned above] </conversation_status> </response>

AI Assist Variables

Input format and parameters

  1. Knowledge base and context

This variable and format are used to insert chat context and knowledge base information uploaded in the Dataset that the AI Assist uses to generate reply content in prompts.

  1. Language control

This is a variable used to insert in prompts to control the AI Assist to generate reply content in a specified language. The following are the variable and its possible values respectively:

Output format and parameters

The output content must be in the following format. The content replied by the AI Assist will be inserted into the <response> node.

AI Copilot Variables

Input format and parameters

This variable and format are used to insert chat context or original text that the AI Copilot uses to generate reply content in prompts.

Output format and parameters

The output content must be in the following format. The content replied by the AI Copilot will be inserted into the <response> node.

AI Default Prompts

Items

Prompt

Variable Description

Items

Prompt

Variable Description

AI Agent

 

AI Assist

AI Copilot -
Summarize
conversation

 

AI Copilot -
Expand text

AI Copilot -
Rephrase text

AI Copilot -
Enhance tone

  • friendly

AI Copilot -
Enhance tone

  • professional

AI Copilot -
Enhance tone

  • casual

AI Copilot -
Translate

AI Copilot -
Fix grammar & spelling