Documentation Index
Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Events are predefined triggers that fire automatically at specific points in a conversation — such as session start, agent handoff, or session end. Each event has a description field that defines the conditions under which it fires. The platform evaluates these conditions during the conversation and invokes the event when they are met.
Once triggered, events execute the actions configured for them — such as sending a message, collecting parameters, or running an event processor. Each event can be configured independently with its own actions, parameters, and session behavior.
The platform supports three events. The table below describes the default trigger condition and typical use for each.
| Event | Trigger | Typical Use |
|---|
| Welcome Event | Triggered at the start of a session | Send greetings and initialize context |
| Agent Handoff Event | Triggered when a handoff is requested | Transfer conversation to a human agent with context |
| End of Conversation Event | Triggered when a session ends | Send closing messages and capture summaries |
Common Event Configuration
Event Name and Description
Provide a detailed explanation of what this event does. This is for the language models to understand when to use this event. Vague descriptions can cause the event to fire at unintended points in the conversation.
Event Status
Enable the event to allow it to take actions. A disabled event is never invoked, even if its trigger conditions are met. Events can be enabled or disabled at any time without affecting other configurations.
Event Processor
The Event Processor runs custom code before the platform responds to the user. Use it to transform data, enrich context, apply business logic, or tag sessions before the event’s actions execute. It runs after the event fires but before the response is delivered.
To configure, enable the Event Processor toggle and click Edit Processor.
| Field | Description |
|---|
| Namespace | Select an existing namespace or create a new one. Namespaces scope the processor’s variable access. |
| Pre-Processing Script | Custom JavaScript or Python code that runs before the agent executes. Use this to transform event context, manipulate memory data, or prepare content. The script editor supports both JavaScript and Python. |
Testing the Processor : The right panel of the Edit Processor screen provides a test environment. Click Test Execution to run the script against sample data and verify the output before deploying. This lets you catch errors and validate logic without affecting live sessions.
Once configured, click Update to save the processor.
Example
The following script captures conversation summary and user tier before handoff.
// Capture conversation summary and user details before handoff
const sessionMeta = await memory.get_content("sessionMeta");
const summary = generateSummary(); //method to generate summary
// Access metadata passed
const userId = sessionMeta.metadata.userId;
const channel = sessionMeta.metadata.channel;
return {
summary: summary,
userId: userId
};
When to Use the Event Processor
- Enriching session context before the welcome message is sent
- Tagging users or sessions based on conversation data at handoff
- Transforming or validating parameters before they are passed to a receiving agent
- Logging or capturing data at the end of a conversation before the session closes
Specific configurations
Welcome Event
By default, it is triggered at the start of a session.
Configurations:
Under Actions, configure Send Message to User:
- Select AI-generated to let the model compose the message, or
- Enter a Custom message. You can include memory store variables in the message.
Agent Handoff Event
Triggered when an agent handoff is requested. By default, the handoff fires when the user explicitly requests one or when the system cannot fulfill the request.
Agent handoff is supported only via the AI for Service Platform. When triggered, the Platform sends session data to the specified automation node, which processes the transfer according to its configured connection rules.
Configurations:
| Field | Description |
|---|
| Description | Conditions that trigger this event. Edit to customize handoff detection logic. |
| LLM Collected Event Parameters | Fields the LLM extracts from the conversation when the event fires. Provide a parameter name and describe the expected content. Example: an interaction summary passed to the receiving agent. |
| System Defined Parameters | Fields populated directly from context or memory—not inferred by the LLM. Provide a key (field name) and a value: a static string or a memory/context variable such as {{user.country}}. The Platform resolves these values at runtime. |
| Send Message to User | Message shown when the handoff occurs. Use the toggle to enable or disable this message. When enabled, select AI-generated to let the model compose the message — optionally provide instructions to guide the output — or enter a Custom message. Memory store variables can be included in custom messages. |
| Session Management | Keep Alive — Maintains the session after the event. Terminate Session — Ends the session when the event fires. |
End of Conversation Event
Triggered when a session ends. Use this event to send a closing message or collect summary data.
Configurations:
| Field | Description |
|---|
| Description | Conditions that identify the end of conversation. Edit to update trigger logic. |
| LLM Collected Event Parameters | Fields the LLM extracts from the conversation when the event fires. Provide a parameter name and describe the expected content. |
| System Defined Parameters | Fields populated directly from context or memory. Provide a key and a value: a static string or a memory/context variable such as {{user.country}}. |
| Send Message to User | Message shown when the end of conversation event occurs. Use the toggle to enable or disable this message. When enabled, select AI-generated to let the model compose the message — optionally provide instructions to guide the output — or enter a Custom message. Memory store variables can be included in custom messages. |
| Session Management | Keep Alive — Maintains the session after the event. Terminate Session — Ends the session when the event fires. |