Entities define structured data that the agent can collect from the user, such as a date of birth, phone number, or choice from a list.
Entities are used in flow steps to control what the agent should collect and what must be present before a condition can trigger. They can also be read in executed Python code.Location
Entities are defined in:entities key.
What an entity contains
Each entity has four main parts:Entity types
How entities are used
In flow prompts
Use
{{entity:entity_name}} to reference a collected value.In function steps
Read values using
conv.entities.entity_name.value.In default step conditions
Use
required_entities to gate a condition until the listed entities have been collected.In default steps
Use
extracted_entities to tell the agent which entities to collect in that step.In prompts
You can reference a collected entity value in prompts using:In code
In function steps or related Python code, entity values can be read like this:.value is always a str, even for numeric, date, and other non-text entity types — cast it explicitly (int(...), float(...)) before doing arithmetic or numeric comparison.
Before reading a value, check that the entity exists:
In flow conditions
Entities are important in default flow steps:extracted_entitiestells the agent what to collect in the current steprequired_entitiestells a condition what must already be available before it can trigger
Automatic ASR biasingWhen entities are requested in a default step, ASR biasing is automatically configured based on the entity types being collected.
Example
Validation
descriptionis required.- Each
configfield is type-checked against the entity’sentity_type— for examplemin/maxon anumericentity must be numbers, andhas_decimal,has_rangemust be booleans. A mismatched type raises an error on push. - Each entity
namemust be unique. - On a
numericentity,minis at least 0 andmaxis at most 1,000,000. - When
has_rangeistrue,maxcannot be less thanmin. - On an
alphanumericentity,regular_expressionmust be a valid regular expression. - Items in
optionsandcountry_codesmust be text.
Best practices
- use clear, descriptive snake_case names
- keep descriptions specific enough to guide extraction well
- choose the most precise entity type available
- use
required_entitiesto control when a step condition is allowed to fire - use
extracted_entitiesto make collection explicit in default steps
Related pages
Flows
Learn how entities fit into default steps, conditions, and step transitions.
Variables
Compare collected entities with state variables used elsewhere in the project.
Conversation object reference (platform)
Full reference for
conv.entities — accessing collected values, checking presence, and entity object shape.
