# Agent

Configure an agent to perform a specific part of the flow, based on the system prompt. The flow continues through one of the configured goals. If that goal contains one or more slots the agent collects these and adds them to the variable context for further use in the flow.

<figure><img src="https://4187494610-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFe4cpY1jy0FJ4kgC7wSx%2Fuploads%2Fs9JffAZP1kEU9rrOjlRn%2Fagent-node.png?alt=media&#x26;token=38a615d3-fafa-4e73-a624-f8db52e0f296" alt=""><figcaption></figcaption></figure>

## Parameters

<table><thead><tr><th width="141">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>The meaningful name for the agent.</td></tr><tr><td>System prompt</td><td><p>Specific instructions that describe the job of this agent. E.g. <code>Ask caller for zip code</code></p><p>Allows variable substitution by placing a variable name between curly brackets e.g. <code>{{currentTime}}</code>.</p></td></tr><tr><td>Memory identifier</td><td>The meaningful name to store the interaction between this agent and the user. The interaction is shared with subsequent agents that have a matching memory identifier.</td></tr><tr><td>Iteration limit</td><td>Number of times the user can interact with the agent. If the iteration limit is met before the agent reaches a goal the <code>fallback</code> exit is chosen.</td></tr><tr><td>Single turn</td><td>If checked, the agent is forced to reach a goal within a single turn.</td></tr><tr><td>Take initiative</td><td>If checked, the agent will start the conversation instead of waiting for user input.</td></tr><tr><td>Goal</td><td>The next step the agent takes when the instructions from the <code>goal description</code> are met.</td></tr><tr><td>Slot</td><td><p>Contains a meaningful name of the slot for this goal, e.g. <code>zipcode</code> and a description for instructions about the slot. E.g. <code>format the input to 4 numbers and 2 capital letters joined</code></p><p>Configured <code>slots</code> are returned by the agent and added to the variable context</p></td></tr><tr><td>Fallback</td><td>It is the default safety exit of an Agent node. It is the path the agent takes when it cannot confidently or safely fulfill a request.</td></tr><tr><td>Error</td><td>Error path is triggered when the platform or a component fails unexpectedly, not by agent reasoning.</td></tr></tbody></table>

Learn how the agent node works in the [simple flow](https://docs.ixhello.com/ixhc2/general/tutorials/build-validate-and-test-a-simple-flow) tutorial.

{% hint style="info" %}
By design, Agents can always collect **slots** of type **Number** with **Dual-Tone Multi-Frequency (DTMF)** input when a flow is executed on the **voice channel**. This allows users to fallback on DTMF input when they're in a loud environment but need to provide a numeric value, like an order number.
{% endhint %}

## Guidelines for effective system prompts&#x20;

Using effective system prompts in the agent is crucial for creating user friendly and consistent flows. When writing these system prompts it's important to use the following structure&#x20;

1. Describe the **type of agent** you're looking for, this gives the agent context and character. The behavior of the agent differs based on this information. There's a difference between talking to **Captain Jack Sparrow** or **Professor Snape**.&#x20;
   * You are a receptionist assistant for Concentrix Airlines.&#x20;
   * You are a weather agent for Concentrix Meteo who can interpret and answer question about a weather forecast.
2. Describe **what the agent has to do**. This gives the agent the information it needs to perform the task.  Be concise and descriptive and keep the amount of tasks low. If the number of tasks becomes to high the agent will not perform at its best, it's best to split the agent at this point to improve the consistency of the flow.&#x20;
   * You need to determine the intent of the user and direct them to the next step.
   * Start by providing tomorrow's maximum and minimum temperature and ask if the user wants more information.
3. Add **boundaries to the agent**. This ensures the agent sticks to the task that is described above. Not including this section results in unwanted behavior.&#x20;
   * you can't answer any other questions.
   * you can only use the provided data.
   * you always respond in English.

{% hint style="success" %}

1. You are a weather agent who can interpret and answer question about a weather forecast.
2. Start by providing tomorrow's maximum and minimum temperature and ask if the user wants more information.
3. You can't answer any other questions and can only use the provided data. You always respond in English.
   {% endhint %}

Learn more about the agent node in the [Simple flow](https://docs.ixhello.com/ixhc2/general/tutorials/build-validate-and-test-a-simple-flow) tutorial.&#x20;

### Template Interpolation

Text fields (Say, Agent, Menu prompts) use {{expression}} interpolation:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Syntax</td><td valign="top">Purpose</td><td valign="top">Example</td></tr><tr><td valign="top">{{expression}}</td><td valign="top">Variable lookup or expression</td><td valign="top">Hello {{name}}, you have {{items.length}} items</td></tr></tbody></table>

* {{expression}} — evaluated by the Expression Engine, matches the next }}
* Simple variable names like {{name}} resolve to a variable lookup
* Complex expressions like {{items.filter(x => x.active).length}} are fully evaluated
* The double-brace delimiter avoids collision with JSON content in system prompts
* Non-printable results (objects, arrays) are JSON-stringified; null/undefined produce empty\
  string
* Errors preserve the original text and log a warning

#### What Template Interpolation Means in an Agent Node and Say Node

* Configure an **Agent Node**&#x20;
* Inside the **System Prompt** field, you typed:\
  `Testing {{`
* As soon as `{{` is typed, a **template helper dropdown** appears
* The dropdown lists:
  * **Variables** (`var boolean`, `var number`, `var userEndpoint`, etc.)
  * **Slots from Test (agent node)** (example tooltip: *Variable – boolean*)
  * **Built‑in functions** (`fn $addDays`, `fn $format`, `fn $now`, etc.)
  * **JS native objects/functions** (`Date`, `Math`, `parseInt`, `String`, etc.)

This confirms that **the System Prompt supports template interpolation using `{{ }}` syntax**, with access to typed variables and runtime helpers.

<figure><img src="https://4187494610-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFe4cpY1jy0FJ4kgC7wSx%2Fuploads%2F46honyH4apVjTLZehS8Q%2FAgent%20Node.png?alt=media&#x26;token=213f0ed7-e0e9-4b19-a9e8-23d7b86dcebe" alt=""><figcaption></figcaption></figure>

## Using the memory identifier

The memory identifier allows the flow to **maintain context between agents**, to provide a more streamlined and personalized experience.

Configure the **same memory identifier** name in all agent nodes where the interaction between this agent node and the user needs to be shared with subsequent agent nodes to provide a more streamlined experience.

{% hint style="info" %}
The example below shows the difference in flow experience when maintaining **context** between agents with a **memory identifier**.
{% endhint %}

<figure><img src="https://4187494610-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFe4cpY1jy0FJ4kgC7wSx%2Fuploads%2F78E1vCW3ReEo95JS8ekC%2Fmi.png?alt=media&#x26;token=f97b9d63-b992-4e66-a14f-a62696fefd0d" alt=""><figcaption></figcaption></figure>
