The Q&A Test page in the OpenSearch LLM-Based Conversational Search Edition console verifies how your knowledge base answers questions. After you enter a question, the model matches relevant results and returns an answer. Set the parameters for your scenario and expected results, test Q&A outcomes, and then select the optimal parameter values.
Prerequisites
An OpenSearch LLM-Based Conversational Search Edition instance. For instructions, see Create an instance.
Data configuration completed for the instance. For instructions, see Configure data.
Procedure
This procedure uses a video file as an example. You upload the video to the knowledge base, wait for automatic parsing, and then run a Q&A test based on the video content to return relevant results.
Import the file into the knowledge base
Import the video file so that the knowledge base can parse its content.
Log on to the OpenSearch console and select LLM-Based Conversational Search Edition.
In the left-side navigation pane, click Instance Management.
In the Actions column of the target instance, click Manage. The Instance Details page appears.
Click Configuration Center and open Data Configuration.
Click File Import and select the file to upload.
Click Upload File. The file is imported into the knowledge base.
Wait for the file upload to finish. Do not continue until the data query status is complete.
Run a Q&A test
After the file is parsed, ask the model a question and adjust the parameters until the answers match your expectations.
In the left-side navigation pane, click Q&A Test.
In the upper-right corner, click Model Configuration and set the parameters that your search scenario requires.
Enter the question in the dialog box and click Send.
View the Q&A test results. The model matches relevant results from the content in the uploaded knowledge base and returns an answer.
Depending on the parameters that you set, the response can also include the retrieved documents (search_hits) and the sources of the referenced content.
Parameters
Configure the following parameters in Model Configuration on the Q&A Test page. The parameters are grouped by category.
Q&A parameters
| Parameter | Type | Required | Default value | Valid values | Description |
| options.chat.model | String | Yes | opensearch-qwen | Selects the large language model (LLM). The supported context length and the maximum input and output token counts vary by model. | |
| Prompt | String | No | System default template | - | The prompt used for this search. For available prompts, see Available prompts. |
| question.session | Boolean | No | true | true, false |
|
| options.chat.enable_deep_search | Boolean | No | false | true, false | Enables Deep search.
|
| options.retrieve.web_search.enable | Boolean | No | false | true, false | Enables web search.
|
| options.chat.stream | Boolean | No | true | true, false | Enables streaming responses.
|
Prompt parameters
| Parameter | Type | Required | Default value | Valid values | Description |
| options.chat.prompt_config.attitude | String | No | normal | normal, polite, patience | A parameter of the system-built template that controls the tone of the conversation.
|
| options.chat.prompt_config.rule | String | No | detailed | detailed, stepbystep | The level of detail in the conversation.
|
| options.chat.prompt_config.noanswer | String | No | sorry | sorry, uncertain | The response when a question cannot be answered.
|
| options.chat.prompt_config.language | String | No | Chinese | Chinese, English, Thai, Korean | The language used to answer questions. |
| options.chat.prompt_config.role | Boolean | No | - | - | Specifies whether to enable an answer role. When enabled, the answer role is customized. |
| options.chat.prompt_config.role_name | String | No | - | - | The customized answer role. For example: AI Assistant. |
| options.chat.prompt_config.out_format | String | No | text | text, table, list, markdown | The format of the output content. |
Document recall parameters
| Parameter | Type | Required | Default value | Valid values | Description |
| options.retrieve.doc.filter | String | No | Empty | - | When retrieving data that meets filter conditions from the knowledge base, explicitly specify the field and conditions. For filter examples, see Filter examples. Supported fields:
|
| options.retrieve.doc.top_n | Integer | No | 5 | (0, 50] | The number of documents retrieved. |
| options.retrieve.doc.sf | Float | No | 1.3 when sparse vectors are disabled 0.35 when sparse vectors are enabled | [0, 2.0] when sparse vectors are disabled | Controls the vector-score threshold for document retrieval.
|
| options.retrieve.doc.dense_weight | Float | No | 0.7 | (0.0, 1.0) | When sparse vectors are enabled, controls the weight of dense vectors during document retrieval. |
| options.retrieve.doc.formula | String | No | - | - | Specifies the formula for ranking documents during retrieval. For the syntax, see Ranking formula syntax. The features Algorithm relevance and Geographical relevance are not supported. |
| options.retrieve.doc.operator | String | No | AND | AND, OR | Specifies the relationship between terms after
|
The following examples show the format of options.retrieve.doc.filter:
"filter" : "raw_pk=\"123\"" # Retrieve data only from the document whose ID is 123
"filter" : "category=\"value1\"" # Retrieve data only from documents whose category is value1
"filter" : "category=\"value1\" OR category=\"value2\"" # Retrieve data only from documents whose category is value1 or value2
"filter" : "score>1.0" # Retrieve data only from documents whose score is greater than 1.0
"filter" : "timestamp>1356969600" # Retrieve data only from documents whose timestamp is later than 2013-1-1Reference image parameters
| Parameter | Type | Required | Default value | Valid values | Description |
| options.retrieve.image.sf | Float | No | 1 when sparse vectors are disabled 0.5 when sparse vectors are enabled | [0, 2.0] when sparse vectors are disabled | Controls the vector-score threshold for image retrieval.
|
| options.retrieve.image.dense_weight | Float | No | 0.7 | (0.0, 1.0) | When sparse vectors are enabled, controls the weight of dense vectors during image retrieval. |
Query understanding parameters
| Parameter | Type | Required | Default value | Valid values | Description |
| options.retrieve.qp.query_extend | Boolean | No | false | true, false | Specifies whether to expand the user query. Expanded queries are used to retrieve document chunks from the engine.
|
| options.retrieve.qp.query_extend_num | Integer | No | 5 | (0,+∞) | The maximum number of queries to expand when similar-query expansion is enabled. |
Manual intervention parameters
| Parameter | Type | Required | Default value | Valid values | Description |
| options.retrieve.entry.sf | Float | No | 0.3 | [0, 2.0] | Controls the vector-score threshold for retrieval of manual intervention entries. A smaller value makes results more relevant but returns fewer results. Conversely, less relevant entries might be retrieved. |
Deep search parameters
| Parameter | Type | Required | Default value | Valid values | Description |
| options.chat.agent.think_process | Boolean | No | - | - | Specifies whether to return the thinking process. |
| options.chat.agent.max_think_round | Integer | No | - | - | The number of thinking rounds. The maximum value is 20. |
| options.chat.agent.language | String | No | - | AUTO, CN, EN | The language for the thinking process and answers.
|
Other parameters
| Parameter | Type | Required | Default value | Valid values | Description |
| options.retrieve.return_hits | Boolean | No | - | - | Specifies whether to return document retrieval results, which are search_hits in the response. |
| options.chat.history_max | Integer | No | 1 | - | The maximum number of multi-turn conversation history rounds. The maximum value is 20. |
| options.chat.link | Boolean | No | false | true, false | Specifies whether to return links. Controls whether the content generated by the model identifies the sources of content references.
|
| options.chat.rich_text_strategy | String | No | Empty | inside_response, extend_response | Specifies the post-processing method for rich-text LLM output. If this configuration does not exist or is empty, rich text is not enabled, which is the default behavior:
|
| options.retrieve.graph | Boolean | No | - | - | Uses graph relationships for query association and retrieval. This parameter takes effect only after GraphRAG is enabled in data configuration. |
| options.chat.enable_llm_knowledge | Boolean | No | - | true, false | When enabled, the LLM provides a fallback answer if no search results are returned. |
When options.chat.link is set to true, an example response that includes sources is as follows:
An ECS cloud disk can be expanded online or offline[^1^]. Online expansion does not require restarting the instance, whereas offline expansion does[^1^]. To expand the disk, select the disk to expand in the ECS console, choose Expand in the Actions column, and then select an expansion method as needed[^1^]. If partitions and file systems also need to be expanded, use the console or use the console[^2^]. After the disk capacity is expanded, the new capacity cannot be reduced after it takes effect. Plan storage space appropriately[^3^].The number enclosed in [^ and ^] indicates the ordinal number of the document in the reference results. For example, [^1^] indicates the first document in reference.