conv.variant examples need Python familiarity. The UI-based setup (creating variants, adding attributes, CSV imports) does not require code.
Variant management is for agents that serve multiple locations, brands, or configurations. Each variant stores attributes like phone numbers, addresses, and hours, so one agent can give the right answer for each site. Without variants, you would need a separate agent per location – multiplying maintenance and increasing the risk of inconsistencies.
Variant management is found under Build > Variant management in Agent Studio.
Use variant management when your agent needs location- or site-specific responses (hours, addresses, phone numbers). If your agent serves a single location, you do not need variants – use Managed Topics and functions directly.

Prerequisites
- Ensure you have admin access to Build > Variant management in your PolyAI agent.
- Set up Managed Topics aligned with your multi-site configuration goals.
- Understand how to use functions in your agent.
Key capabilities
Multi-site configurations
Use variant management to manage multiple locations in the same agent. Attributes such as phone numbers and opening hours are stored per variant, so the agent gives location-specific answers.Knowledge integration
Attributes defined in variant management are accessible in your Managed Topics rules, templates, and actions. For example, use${variant_foo} to populate responses dynamically with location-specific information.
Flexible routing
Set up routing in the start function to direct users to the appropriate variant. For voice, route based on phone numbers or SIP headers; for webchat, use URL parameters or session data. Variants can also tailor SMS messages dynamically.Advanced functions
Use theconv.variant object to retrieve variant attributes during conversations or make decisions based on variant data.
Testing and troubleshooting
You can select a specific variant when making in-app test calls. The variant selector appears in the Call configuration section when variants exist for your project, letting you test variant-specific behavior directly in Agent Studio without manual function workarounds.Real-life use case
A hotel chain with multiple branches worldwide uses Variant Management to manage its agent. Each branch (e.g., “London” and “New York”) has a variant configured with attributes like phone numbers, addresses, and check-in hours. When a guest contacts the agent, the branch is identified based on the user’s context–phone number for voice, URL parameters for webchat–and the response is tailored accordingly.Variants and attributes
Think of the variant management table like a spreadsheet:- Add variant (with the Add variant button) adds a new row. Each variant represents a distinct location or site, such as “London” or “Tokyo.” It is the who – a new instance of the configuration.
- Add attribute (with the + plus sign) adds a new column. Each attribute is a data field that exists across all variants, such as phone number, address, or operating hours. It is the what – a new piece of information that every variant can hold a value for.

Setting up a new variant

- Open Build > Variant management in the sidebar.
- Add a new variant and provide a name, such as “London” or “Tokyo.”
- Save your configuration.

Setting up a new attribute

- Phone numbers
- Address
- Operating hours
- Menu
- Accessibility

Default variant handling
By default, the first variant in the list is used unless otherwise specified. If a variant needs to be changed programmatically, use theconv.set_variant() method in your start function.
Example:
Using variants in SMS templates
Main article: SMS To include variants dynamically in SMS messages, use the syntax${variant_attribute}. For example:
${variant_phone_number}dynamically includes the phone number associated with the active variant.
Testing variants
In-app calling
When making test calls from Agent Studio, you can select a specific variant from the Call configuration section. The variant selector only appears when variants exist for your project. Call settings are grouped in a collapsible panel for easier navigation.In chat
For webchat testing, you can set variants manually in the start function:set_variant1, set_variant2 to switch variants during testing.
Advanced: Accessing variants in functions
This example shows how to assign variants dynamically based on user context. Theconv.variant object lets you retrieve and set the appropriate variant so responses match the user’s location or context.
Voice example (phone number-based)
Match the dialled number against a variant attribute to set the active variant. The attribute name (e.g.,phone_number, callee) must match a column you defined in Build > Variant management.
callee), replace variant.phone_number with variant.callee:
Webchat example (URL parameter-based)
For webchat interactions, you can use URL parameters or session data to determine the variant:Flow activation per variant
Variants control which flows are available during a conversation. Each variant supports two fields:active_flows– a list of flow names that are enabled for this variantinactive_flows– a list of flow names that are disabled for this variant
active_flows are available to the agent. Any flows listed in inactive_flows are skipped during processing — this lets you enable or disable specific conversation paths per location or configuration without duplicating flow logic.
Automate with the Agents API
If your variants live in a source of truth outside Agent Studio — a locations database, a CRM, a spreadsheet — you can sync them directly rather than editing by hand.Manage variants via the Agents API
Manage variants via the Agents API
The Agents API exposes full CRUD for both attributes (the dimensions) and variants (the per-site combinations).
Related pages
CSV imports
Bulk create or update variants using CSV files.
Managed Topics
Use variant attributes in topic responses with $ syntax.
Functions
Access variant data programmatically with conv.variant.
Start tool
Route callers to the correct variant based on phone number or metadata.
Variants endpoints
CRUD for variants and attributes in the Agents API.

