> ## 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.

# Share Metadata from AI for Service to Agent Platform

<Badge icon="arrow-left" color="gray">[Back to How-to Guides](/ai-for-service/automation/how-tos/guide)</Badge>

As users interact with AI for Service (XO), the platform collects contextual data such as user preferences, channel details, order information, and session data. You can pass this context to the Agent Platform so agents can use it for personalized, context-aware responses and tool execution.

## Use Cases

| Use Case                   | Example                                            |
| -------------------------- | -------------------------------------------------- |
| Priority handling          | Pass customer tier or status for routing.          |
| Channel-specific responses | Share channel type information.                    |
| Personalization            | Transfer user preferences.                         |
| Session continuity         | Include session context for ongoing conversations. |

## Prerequisites

* A variable defined in AI for Service. See [Using Variables](/ai-for-service/app-settings/variables/using-bot-variables).
* An Agentic app created in Agent Platform. See [Create an Agentic App](/agent-platform/agents/agentic-apps/create-an-app#create-an-agentic-app).
* The Agentic app integrated with AI for Service via the Automation node. See [Full Autonomy](/ai-for-service/flows/node-types/automation#full-autonomy).

## Setup

### Step 1: Create or Identify Variables

In AI for Service, create or use existing variables in the context object (for example, `context.userInfo.name` or `context.channel.type`). These capture runtime data to pass as metadata.

<img src="https://mintcdn.com/koreai/WO96SKE0qtZRC8Dw/ai-for-service/automation/how-tos/images/metadata1.png?fit=max&auto=format&n=WO96SKE0qtZRC8Dw&q=85&s=c9256f319fee4f18f24da7e7825584b7" alt="Metadata variables" width="620" height="654" data-path="ai-for-service/automation/how-tos/images/metadata1.png" />

### Step 2: Configure Metadata in the Automation Node

1. Go to **Flow & Channels** > **Automation Routing** > **Routing Modes**.
2. For any welcome flow, select **More options** (...) > **Automation Settings**.
3. Confirm that **Full Autonomy**, the Agentic app, and the environment are selected.
4. In the **Metadata** section, click **+ Add** and enter key-value pairs:

   * **Key**: A logical name (for example, `name`).
   * **Value**: The XO variable path (for example, `context.userInfo.name`).

   Changes are auto-saved.

<img src="https://mintcdn.com/koreai/WO96SKE0qtZRC8Dw/ai-for-service/automation/how-tos/images/metadata2.png?fit=max&auto=format&n=WO96SKE0qtZRC8Dw&q=85&s=4960ad50e6fbed546cf6182915bcee2a" alt="Metadata configuration" width="554" height="944" data-path="ai-for-service/automation/how-tos/images/metadata2.png" />

### Step 3: Access Metadata in Agent Platform

The metadata is automatically stored in the agent's memory under `sessionMeta.metadata`. Access it in agent prompts, supervisor prompts, or code tools:

```
{{memory.sessionMeta.metadata.keyname}}
```

**Examples**

| Location          | Example                                                                                  |
| ----------------- | ---------------------------------------------------------------------------------------- |
| Agent Prompt      | `The customer's current order is {{memory.sessionMeta.metadata.ordernumber}}.`           |
| Supervisor Prompt | `Assist the agent based on customer tier: {{memory.sessionMeta.metadata.customerTier}}.` |

For code tools, see [Memory Stores in Agentic Apps](/agent-platform/memory#memory-stores).

<img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/images/metadata3.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=3aac3e84258debabe8c5e6f472283264" alt="Metadata in Agent Platform" width="1072" height="316" data-path="ai-for-service/automation/how-tos/images/metadata3.png" />

***

## Debug Metadata

During execution, metadata variables are injected into the memory store and visible in the **Traces** tab.

1. Start a test conversation from AI for Service with metadata.
2. Navigate to the relevant session or trace in Agent Platform.
3. Verify that memory variables are resolved and values are correct.

<img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/images/metadata4.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=edc7e48ac0b2b2f46bd95fa4f4a1f8d8" alt="Metadata in Traces" width="1008" height="538" data-path="ai-for-service/automation/how-tos/images/metadata4.png" />

***
