Data Q&A intervention
This topic describes how to configure the system to use contextual information to understand a user's intent and provide more accurate replies.
Q&A configuration
Environment parameters
This feature lets you pass contextual constraints to the bot through an API. For example, you may have business information, such as addresses and office hours, for two different regions, A and B. This information is stored in two separate data tables, table a and table b. By configuring an environment parameter, you can ensure that when a user from region A asks a question, the system queries table a to find the answer, not table b.
You can pass this information using the VendorParam parameter in the streaming session API.
After navigating to the global intervention page for the desired table, click the environment parameter tab to open the configuration page.

Click the toggle switch next to environment parameter to enable the feature.
Click Add to configure an
environment parameter. When you call the dialogue API, include the configuredenvironment parameterin the request.Location value: A business-specific string that acts as a
sessionconstraint for selecting the data table.Environment parameter: A custom parameter name. You can configure multiple unique environment parameters for the same data table.
Operator: Includes
=andin.=: When asessionstarts, if theenvironment parameterfrom the API request matches the value configured here, the system selects this table.in: When asessionstarts, if the configured value is present in the list ofenvironment parametervalues from the API request, the system selects this table.
NoteIf you configure multiple environment parameters, the system selects this table if any one of them matches the parameter passed in the API request.
NoteIf you configure multiple environment parameters, the system selects this table if any one of them is present in the list of values passed in the API request.
Example:
Scenario:
Table data: You have two tables that store the addresses and business hours for administrative offices in two different districts.
Table 1: Xihu District office hours
Administrative entity
Business hours
Address
Civil Affairs Bureau
AM: 9:00–12:00
PM: 1:00–5:00
122 Xihu District
Environmental Bureau
AM: 8:00–12:00
PM: 1:00–5:00
221 Xihu District
Administrative Service Center
AM: 7:00–12:00
PM: 1:00–5:00
113 Xihu District
Table 2: Gongshu District office hours
Administrative entity
Business hours
Address
Civil Affairs Bureau
AM: 8:00–12:00
PM: 1:00–5:00
122 Gongshu District
Environmental Bureau
AM: 7:00–12:00
PM: 1:00–5:00
322 Gongshu District
Administrative Service Center
AM: 6:00–12:00
PM: 1:00–5:00
133 Gongshu District
Goal: When users from Xihu District ask for office information, you want the system to use "Table 1: Xihu District office hours" for the answer. When users from Gongshu District ask, the system should use "Table 2: Gongshu District office hours".
Configuration:
Pass the user's district information in the
VendorParamparameter of the streaming session API. For example:{"area": "Xihu District"}.In the Q&A configuration > environment parameter settings for "Table 1: Xihu District office hours", configure the following:
Location value:
areaOperator:
=Environment parameter:
Xihu District
In the Q&A configuration > environment parameter settings for "Table 2: Gongshu District office hours", configure the following:
Location value:
areaOperator:
=Environment parameter:
Gongshu District
Result:
A user from Xihu District asks: "Where is the Civil Affairs Bureau?"
The bot replies: "122 Xihu District."
A user from Gongshu District asks: "Where is the Civil Affairs Bureau?"
The bot replies: "122 Gongshu District."
Associated replies
When the bot's answer is a value from a specific field in the data table, you can configure the bot to display up to three additional fields. The bot then combines these fields into a single, more informative reply.
Go to Q&A configuration and select associated reply.
Configure the following settings:
Reply field: The field the user is asking about. This is the primary field for the reply.
Associated reply field: An additional field to include in the bot's reply along with the Reply Field.
Example:
In a financial scenario, when a user asks about a product's "return," they often also want to know its "risk level." You can configure this as shown in the following figure:

Q&A example:
User: "How was the return on Product A over the past year?"
Bot: "The return on Product A over the past year was XXXXXX, and its corresponding risk level is XXXXXX."
Header and value intervention
Overview and access
Overview: In
table-based Q&A,headersettings allow you to refine the bot's ability to recognize a specific header. The configuration affects only the selectedheader. This includesheader synonym,value synonym, andenvironment parametersettings.Access: In your bot's space, navigate to Knowledge Base > Table Management > data table management. Click Edit next to the desired table to open the table editor. Click the Q&A configuration button for the relevant
headerto start configuring its recognition behavior.
Header synonyms
Purpose: Configure synonyms for a table
header. When a user's query matches aheader synonym, the system maps it to the correspondingheader.Configuration: On the
headerrecognition settings page, select the header synonym tab. Enter synonyms in the Synonym input box and then click Save.
Value synonyms (text-based headers only)
Purpose: Configure synonyms for a cell value. When a user's query matches a
value synonym, the system maps it to the corresponding cell value.Configuration: On the
headerrecognition settings page, select the value synonym tab. First, select a value in the Value selection box, then add value synonyms in the Add synonym box. Click Add or press Enter to add the synonym.
Environment parameters
Purpose: Lets you pass contextual constraints to the
botvia an API. For example, in a product Q&A scenario, you can pass a product ID as anenvironment parameterwhen thesessionstarts. When a user asks about the price, the system automatically uses the product ID as a filter to retrieve the correct price.NoteYou can pass this information using the
VendorParamparameter in the streaming session API.environment parameterconfiguration is not suitable for the following field types, as they inherently represent a range or a set of values: text fields with a length exceeding 255 characters, array types, range types, calculated columns, and numeric fields configured forfuzzy query.
Configuration:

After navigating to the Header and value intervention page, select the environment parameter tab to open the configuration page.
Click the toggle switch next to environment parameter to enable the feature.
Add an
environment parameter.Unmatched variable policy: If you have configured an
environment parameterfor aheaderin theconsoleand passed a value for that parameter to thedialogue enginethrough an API, the system follows the policy selected here. The default is Ignore.Ignore: If a filtered query using the
environment parameterfinds no data but an unfiltered query does, the system ignores theenvironment parameterand returns the unfiltered result.Reject: If a query based on the
environment parameterfilter returns no data, the system willrejectthe user's query and indicate that no information was found.
Add environment variable:
Field name: The name of the current
header.Operator: Includes
=andin.=: The system uses the value of the API parameter whose name you specify here. It then filters for data where the currentheader's value is identical to that API parameter's value.in: The system uses the list of values from the API parameter whose name you specify here. It then filters for data where the currentheader's value is present in that list.
Environment parameter: The name of the parameter key passed in the API, such as
teacher.
Example:
Table configuration:

environment parameterconfiguration:Pass the
environment parametername and value through the API:teacher: Mait.consoleconfiguration:Field name: Advisor
Operator:
=Environment parameter:
teacher
User Q&A result:
unmatched variable policyset to IgnoreUser: "What is Xiao Wang's grade?"
Bot: "Fail."
NoteBecause the filter "Advisor = Mait" finds no grade for Xiao Wang, but a search without the filter does, the system ignores the
environment parametersetting and answers "Fail".
unmatched variable policyset to RejectUser 1: "What is Xiao Wang's grade?"
Bot 1: "Sorry, I can't find grade information for a student named Xiao Wang."
NoteBecause the filter "Advisor = Mait" finds no grade information for Xiao Wang, and the policy is set to
Reject, the system rejects the query.User 2: "What is Zhang San's grade?"
Bot 2: "Zhang San's grade is Fail, and the advisor is Mait."
NoteIn this example, the
environment parameterfilters the Advisorheaderby the value "Mait", which filters out other data. The example table contains two students named "Zhang San", but the one with student ID "430485" is filtered out because their advisor is not "Mait". Therefore, the bot's reply does not include that student's information.

