> For the complete documentation index, see [llms.txt](https://docs.aisera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aisera.com/aisera-platform/crafting-the-conversation/how-to-edit-conversation-key-messages/bot-conversation-variables.md).

# Bot Conversation Variables

<figure><img src="/files/mYwyIDWnmFv1caJRtpUZ" alt=""><figcaption></figcaption></figure>

**Conversation variables** act as dynamic placeholders in most chatbot, copilot, workflow messages, and prompt engineering contexts to dynamically insert specific user data (like names, timestamps, or session IDs) into live responses.&#x20;

{% hint style="info" %}
The Aisera Gen AI platform allows you to use these types of variables in Conversation Key Messages and Workflow Message Nodes. However, we have not tested every possible use case, so we recommend your use your variables on a test system before moving them to production.
{% endhint %}

### Common conversation variable syntaxes and purposes:

#### 1. Common Syntax & Examples

* **`$VARIABLE` (such as, `$USER`)**: Often used in conversational AI platforms to reference pre-defined system states or user-provided entities.&#x20;
* **`{variable}` (such as, `{user_name}`)**: Common in modern LLM frameworks and JSON/API payloads.&#x20;
* **`%s` (String Formatting)**: Traditional programming syntax used in Python (such as, `"Hello %s" % username`) or C to inject text programmatically before passing a prompt to an AI model.
* **`{{variable}}` (such as, `{{conversation.user_name}}`)**: Heavily used in web development, Jinja templating, and bot frameworks (like Botpress) to escape and render variables in text strings.&#x20;

#### 2. Common Scopes & Types

* **User Variables**: Store data tied directly to a specific user (such as, `name`, `email`, `timezone`) and persist across different chat sessions.
* **Conversation Variables**: Store temporary, short-term memory during a single, ongoing chat session (such as, a `cart_id`, `ticket_number`, or current state).
* **System Variables**: Built-in, read-only parameters provided by the platform (such as, `{$conversationId}`, `$current_time`).&#x20;

#### 3. Practical Applications

* **Personalization**: Dynamically greeting users by name: *"Welcome back, $USER!"*
* **Contextual Responses**: Citing previous answers: *"You previously selected %s as your preferred shipping address."*
* **State Management**: Passing memory into LLM instructions, such as injecting previous messages or a `conversation_id` into API payloads.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.aisera.com/aisera-platform/crafting-the-conversation/how-to-edit-conversation-key-messages/bot-conversation-variables.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
