Agent Instructions - syntax

CharmQuark

Premier Customer
Joined
Jan 12, 2025
Messages
27
Reaction score
4
Hi everyone,

This question may look dumb. What are meanings of next syntax in an agent instructions shipped with the phone system:
{{/......}}
{{#.....}}
{{^.....}}
Also how to interpret the following.
{{#first_message}}
> {{ first_message }}
{{/first_message}}
{{^first_message}}
> Welcome, you've reached {{ company_name }} - this is {{ agent_name }}. How may I help you reach the right person or department?
{{/first_message}}

What is the logic? If there is a logic where does it come from? I believe it is something simple.
I looked through blogs, forum and found nothing.
I would appreciate assistance.

Thank you
VK
 
Hi,

Those syntax markers in the Agent Instructions are from the Mustache templating language. This is a logic-less template system commonly used for populating text with variables and some basic conditional logic.

Common syntax seen with 3CX AI Agent Instructions::
  • {{ variable }} displays the variable's content.
  • {{#variable}}...{{/variable}} displays the inner content if variable is present or evaluates true.
  • {{^variable}}...{{/variable}} displays the inner content if variable is NOT present or evaluates false.
  • {{/variable}} closes the {{#...}} or {{^...}} block.
 
Thank you very much Kyriacos for the confirmation.

At first I would like to confirm that supplied out-of-the-box Agent Instructions are working excellent in common.
They need to be brushed up and tuned for the purpose of taking calls from returning clients which are the most callers in my case.

Some questions:
1. Is an Admin able to add Admin's own variables?
2. Where to find all supplied variable contents; examples below
  • {{ company_profile }}. Is it the "Company Description"? Or it should be placed in KB text file?
  • {{ allow_voicemail }}. Is it an individual flag set in User->Voicemail->Enable Voicemail?
  • {{ allow_chat }}. Is it an individual flag set in User->3CX Talk->Enable 3CX Talk... ?
  • {{ allow_email }}. Where is it?
  • {{ handoff_instructions }}. Is content of it hidden somewhere? We have a variable. Where is its content?
Thank you.
With kindest of regards
VK
 
Hello,

Some of those variables are populated from the Agent configs (such as the {{ company_profile }} ) and you can directly edit their values. Others are generated from the AI Agents "backend" and you cannot manipulate directly - and some config options are not reflected with variables for template use.

The variables available at this time are only the ones you can see on the Agent prompt config panel, you cannot create you own. As new releases with additional functionality come, it will probably be the case that more variables will be created/exposed.
 
Excellent! Thank you Kyriacos.

Let's say there is an internal 3CX interpreter of "Mustache like" code. Some variables are accessible, some are logical structures I cannot manipulate directly.
As an Admin I instruct the 3CX interpreter how to build instructions for OpenAI. Once again supplied built-in instructions work excellent! I cannot just throw them out and create instructions for OpenAI from the scratch. I tried it. It is a suicidal mission :)

There is question.

All is nearly clear with all of the built-in variables. Except of one:
{{ is_internal }}
What is the logical meaning of it? It is understandable that {{ is_internal }} is TRUE or FALSE. When it is TRUE?
Internal user?
Frequent caller?
A customer known to our phone system because of it exists in our client's KB database?
A client with clearly visible first and last name?
A caller with clearly readable company name?
Something different?

I would appreciate the explanations.

With kindest of regards
VK
 
  • Like
Reactions: KyriacosS_3CX
Hi,

{{ is_internal }} = the call originator is an extension on the same PBX - so for example skipping mentioning the company name in the greeting.
 

Forum statistics

Threads
112,351
Messages
592,043
Members
165,516
Latest member
Zexus