EMPIEZA CON UNA PRUEBA GRATUITA DE 15 DIAS DEMO
  • LOG IN
MuseRelay
  • Home
  • Solutions
    • AI Assistants Intelligent conversational agents
    • Multichannel WhatsApp, Instagram, Messenger and more
    • White Label Your own customized platform
  • Pricing
  • About
  • Contact
LOG IN SIGN UP
Documentación
Getting Started
  • How MuseRelay works — Channels, Chatbots and AI Agents
AI Agents
  • AI Agent prompt variables
  • Configure CSP so the chatbot works on your website
Documentation / AI Agents / AI Agent prompt variables

AI Agent prompt variables

ES EN

When writing the prompt of an AI Agent under Prompt Configuration, you can use variables in double curly braces — e.g. {{today_formatted}} — that the system substitutes automatically with the real value in every conversation.

Works everywhere: variables are substituted both in the test playground (right panel in the agent edit view) and in real conversations from the embedded chatbot on your website and the Meta channels (WhatsApp, Instagram, Messenger).

🕐 Date and time variables

Useful when your agent has to reason about "today", "tomorrow" or time-slot availability.

VariableExampleWhen to use it
{{current_time}}15:47Current time (HH:MM)
{{current_date}}17/04/2026Today in short format
{{current_iso_date}}2026-04-17ISO date — ideal for API calls
{{current_day_name}}FridayDay-of-week name
{{today_formatted}}Friday April 17Human-readable date to say to customers
{{tomorrow_iso_date}}2026-04-18Tomorrow in ISO
{{tomorrow_formatted}}Saturday April 18Tomorrow human-readable
{{next_monday_iso_date}}2026-04-20Next Monday in ISO
{{agent_timezone}}Europe/MadridAgent timezone
{{workspace_timezone}}Europe/MadridWorkspace timezone

🏷️ Identity variables

VariableExampleWhen to use it
{{agent_name}}LauraAgent name, set when creating it
{{workspace_name}}La Espiga BakeryWorkspace name

📅 Calendar variables (Cal.com)

Substituted only if you have "Calendar Commands (Cal.com)" enabled in the agent config. They are not "values" — they are tools your agent can invoke during the conversation.

VariableWhat the agent does when invoking it
{{cal_check_availability}}Checks available calendar slots
{{cal_create_booking}}Creates a new booking
{{cal_modify_booking}}Moves an existing booking
{{cal_cancel_booking}}Cancels a booking
{{cal_list_bookings}}Lists bookings for a given email
Important: the "Calendar Commands (Cal.com)" toggle alone is not enough. For {{cal_*}} variables to work you need these 3 items:
  1. Cal.com API Key (Settings → Developer → API Keys in your Cal.com account).
  2. Event Type ID — the numeric ID of the event type bookings will be created for.
  3. Agent timezone (optional if it matches the workspace).

Without these, {{cal_*}} variables are silently removed from the prompt and the agent will ignore anything the prompt says about calendar actions.

With everything set, the typical flow is:

  1. User: "I'd like an appointment tomorrow morning"
  2. The model invokes cal_check_availability for tomorrow.
  3. Cal.com returns the actual free slots.
  4. Agent: "I have 09:00, 10:30 and 11:00. Which one do you prefer?"
  5. User picks → agent asks for name and email → invokes cal_create_booking → confirms.

🎨 Agent custom variables

The agent config has a Custom variables (JSON) field. You can define your own variables:

{
  "empresa": "La Espiga Bakery",
  "direccion": "12 Main Street, Madrid",
  "telefono_contacto": "+34 911 234 567",
  "horario_tienda": "Monday to Saturday, 7:00 to 20:00"
}

And use them in the prompt as {{empresa}}, {{direccion}}, etc. Useful for data that rarely changes but you want to edit without touching the whole prompt.

Good practice: if a piece of data appears 3+ times in the prompt, turn it into a custom variable. If it changes later (for example opening hours), you only edit it in one place.

⚠️ Unknown variables

If you use a variable that doesn't exist (for example {{featured_product}} when you haven't created such a custom variable), the system removes it before sending the prompt to the model. You will never see the literal variable in agent replies.

This is intentional: it protects the end customer from seeing technical placeholders like {{featured_product}} on screen.

🎯 Full example — La Espiga Bakery

Real prompt using all relevant variables, optimized for an order and booking agent:

# 🥖 AGENT INSTRUCTIONS — La Espiga Bakery

You are **Carla**, virtual assistant of **{{workspace_name}}**.
You are warm, cheerful and resourceful. Your mission: help the customer
place bread orders to pick up in-store, and book custom cakes.

---

## 1. AUTO CONTEXT
- TODAY: `{{current_iso_date}}` → **{{today_formatted}}**
- TOMORROW: `{{tomorrow_iso_date}}` → **{{tomorrow_formatted}}**
- TIMEZONE: `{{agent_timezone}}`
- CURRENT TIME: **{{current_time}}**

---

## 2. STORE DATA
- Address: **{{direccion}}**
- Phone: {{telefono_contacto}}
- Hours: {{horario_tienda}}
- Last order of the day: 19:30 (30 min before closing)

---

## 3. AVAILABLE FUNCTIONS
- `{{cal_check_availability}}` → check pickup slots
- `{{cal_create_booking}}` → book a pickup slot
- `{{cal_modify_booking}}` → change pickup time
- `{{cal_cancel_booking}}` → cancel booking
- `{{cal_list_bookings}}` → list a customer's bookings

---

## 4. PICKUP AVAILABILITY (⚠️ CRITICAL)
- **Always** use `cal_check_availability` before proposing a time.
- Run it whenever the customer says: today, tomorrow, a specific date,
  "what time can I pick up", "do you have slots".
- Never invent times: availability changes with every order.

---

## 5. DATE INTERPRETATION
- "today" = {{current_iso_date}}
- "tomorrow" = {{tomorrow_iso_date}}
- "day after tomorrow" = today + 2
- "Monday", "Friday"… → the next weekday
- "over the weekend" → offer Saturday (we don't open on Sundays)

---

## 6. STYLE
- ✅ Warm, friendly, subtle emojis (🥖 ☕ 🎂 without overdoing it).
- ✅ Bullet lists for multiple options.
- ✅ Always confirm with day + full date ("Saturday April 20").
- ❌ Never use technical jargon or internal codes.

---

## 7. CAKE BOOKING FLOW
1. Ask: what kind of cake?, for how many people?, any allergies?
2. Call `cal_check_availability` for the requested day.
3. Offer an available slot ("Saturday 20 at 10:30 works for me").
4. Ask for name + email + phone.
5. Execute `cal_create_booking`.
6. Confirm: day, time, booking reference, approximate total.

---

## 8. FINAL RULES
1. ❌ Never invent times or prices.
2. ❌ Never confirm without name and contact.
3. ✅ Always offer alternatives if no slot is available.
4. ✅ Always remember opening hours: {{horario_tienda}}.
5. ✅ If the customer gets difficult, offer a callback on {{telefono_contacto}}.

This prompt leverages:

  • Identity: {{workspace_name}}.
  • Time: {{current_iso_date}}, {{today_formatted}}, {{tomorrow_iso_date}}, {{tomorrow_formatted}}, {{agent_timezone}}, {{current_time}}.
  • Custom variables: {{direccion}}, {{telefono_contacto}}, {{horario_tienda}}.
  • Calendar: the 5 {{cal_*}} tools.

Practical tips

  • Use ISO for logic, human for speaking. Where the model must reason about dates (e.g. "check if there are slots tomorrow"), use {{tomorrow_iso_date}}. Where it has to say it to the customer, use {{tomorrow_formatted}}.
  • Don't rely solely on model memory. Even if it knows the date from context, variables ensure it's always current — especially useful in long or resumed conversations.
  • Put critical rules at the start and end. Models pay more attention to the beginning and the closing of the prompt.
  • Test in the playground before activating in production. The right panel of the agent edit page lets you test without consuming real conversations.
Siguiente →Configure CSP so the chatbot works on your website
En esta página
  • Cargando...

Company

  • About
  • Features
  • Pricing
  • Contact

Platform

  • AI Assistants
  • Multichannel
  • Automation
  • Documentation
  • Blog

Legal

  • Legal Notice
  • Privacy Policy
  • Terms & Conditions
  • Cookie Policy
  • DPA Agreement
  • Subprocessors

Contact

  • Email support@muserelay.com
  • Email legal@muserelay.com
  • Email privacy@muserelay.com

© 2026 MuseRelay. Todos los derechos reservados.

Cookies | ES | EN

LOG IN

Access your MuseRelay account

Forgot your password?
Don't have an account? Create new account

Create new account

Join the MuseRelay beta community

Contact us to get your code: webmaster@muserelay.com
Already have an account? LOG IN
We value your privacy

We use strictly necessary technical cookies for the platform to work. No advertising or third-party tracking cookies. Cookie Policy · Privacy