# Conversation Context
Every chat—whether handled entirely by the moinAI bot or escalated to a live-chat agent—shares a single context. Think of the context as the chat’s short-term memory: it stores key-value pairs that the bot (and your integrations) can read, update, or delete during the session so replies stay accurate and personalised.
You can add data programmatically via the Widget API’s addContext
method:
window.moin.addContext({ user_name: 'Florian' });
Once added, the value is available everywhere.
# Templates
moinAI Hub supports templating throughout the platform—static answers, form labels, follow-up messages, webhook payloads, and more. The syntax is a lightweight variant of Handlebars (opens new window); any variable present in the conversation context is available for interpolation.
- Data from
addContext
- User input captured in forms
- Response bodies from successful webhooks
Usage:
With the variable added in the Context above.
Output:
Hello Florian, welcome to the moinAI experience!
# Webhooks
Configure webhooks under Integrations → Webhooks. With the exception of Context Name and Method, every field accepts template syntax, letting you pass context data to external services or insert response data back into the chat.
Field | Templating Supported? |
---|---|
URL | ✔ |
Headers | ✔ |
Body | ✔ |
Context Name | ✖ (plain text) |
Method | ✖ (dropdown) |
The Context Name acts as the key under which a successful (HTTP 2xx
) response body is stored. Afterwards you can reference it anywhere with dot notation—just like any other context variable.
# Example
- Webhook configuration
- Using the result later in the flow