Why aren’t my AI agent segments working with a custom user field?

Question

I created a custom user field to store each customer’s VIP level. In AI agents, at the conversation started level, I added an action to get user metadata, entered the custom field, and saved the value as a parameter. I then used that parameter in my segments, but the setup still doesn’t work as expected.

Why aren’t my segments working in AI agents when I’m using a custom user field for a customer’s VIP level?

Answer

Segments in AI agents work with session parameters, not directly with custom user fields. If the VIP value is stored only in a custom user field, the segment won’t match unless that value is first passed into the session.

To configure this correctly:

Capture the VIP level in chat metadata, widget metadata, or through an API integration

Use the Get User action to save that value as a session parameter

Verify that the session parameter exists and that its value matches the value your segment expects

In the AI agents workspace, create or edit the segment using that session parameter

If you’re using email AI agents, apply the segment at the use case level rather than inside a procedure

In short, the segment must evaluate a session parameter. Referencing a custom user field alone isn’t enough.

For more information, see Gathering and managing metadata for Sunshine Conversations and AI agents.