Streaming Knowledge Q&A service powered by large language models.
Knowledge Q&A combines a large language model with knowledge retrieval to fetch relevant content and generate a natural-language answer. It supports multi-Knowledge-Base binding, multi-turn dialogue, streaming output, and citation display.
Click the Settings icon to the right of the retrieval mode dropdown to configure advanced retrieval parameters.
Click the expand icon to the right of a Knowledge Base to configure its independent retrieval parameters:
Knowledge Q&A is invoked through the chat endpoint and returns an SSE stream:
The Q&A response streams these events in order:
The platform doesn't persist conversation state — pass the full
When a Flagship Knowledge Base with Wiki enabled is bound, Knowledge Q&A uses both regular retrieval and Wiki retrieval, and answers may cite original chunks and Wiki Pages. Verify against source documents. See Wiki and Ontology Knowledge Graph.
Capabilities
| Capability | Description |
|---|---|
| Intelligent Q&A | The LLM combines retrieval results with its own reasoning to produce cited answers. |
| Multi-Knowledge-Base binding | Bind up to 15 Knowledge Bases with per-source priorities and retrieval parameters. |
| Two retrieval modes | Fast Mode (single-pass retrieval) and Multi-turn Agentic Mode (Agentic multi-step planning). |
| In-chat file parsing | Enable file pre-parsing to upload images or documents in the debug pane for Q&A. |
| Generation controls | File pre-parsing, refusal policy, protection against direct leakage of Knowledge Base source text, multimodal replies, and citations. |
Create a Q&A service
1
Open Knowledge Q&A
Sign in to the console and go to Knowledge Services → Knowledge Q&A.
2
Create a service
Click Create in the top right and fill in:
- Service Name (required, up to 40 characters)
- Description (optional, up to 200 characters)
3
Configure model and prompt
After the service is created, you are redirected to its configuration page:
- Model: Select the model used to generate answers (qwen3.8-max by default; you can switch to another model). Click the Settings icon next to the model to configure
temperatureandenable_thinking. - Prompt (optional, up to 50000 characters): Guides the model's response style and behavior.
4
Pick a retrieval mode
Choose Fast Mode or Multi-turn Agentic Mode. See Retrieval modes below.
5
Bind Knowledge Bases
Click + Add to bind one or more Knowledge Bases (up to 15). Turn on the Priority switch to display a priority selector for each Knowledge Base, then select High / Medium / Low to set its retrieval priority.To configure independent parameters for a Knowledge Base, click the expand icon on its right to open its configuration panel. See Independent Knowledge Base configuration below.
6
Configure generation controls
Enable file pre-parsing, the refusal policy, leakage prevention, and other controls as needed. See Generation controls below.
7
Test Q&A
Enter a question in the debug pane on the right to view the generated answer, cited sources, and retrieval process. You can upload attachments after file pre-parsing is enabled.
8
Publish
After completing the configuration, click Publish in the top right. The Q&A service can then be called through the API.
- At least one Knowledge Base must exist and contain successfully parsed documents.
- For multi-Knowledge-Base Q&A, all bound Knowledge Bases must reside in the same workspace.
Retrieval modes
| Mode | How it works | Best for |
|---|---|---|
| Fast Mode | Generates an answer after a single round of retrieval; supports toggling Query Rewriting. | Simple, clear questions and latency-sensitive scenarios. |
| Multi-turn Agentic Mode | Uses LLM-powered multi-round planning (Agentic) for intent recognition, query rewriting, and Knowledge Base routing; supports configuring the maximum number of ReAct rounds. | Complex or ambiguous questions and answers synthesized across Knowledge Bases. |
Independent Knowledge Base configuration
Click the expand icon to the right of a Knowledge Base to configure its independent retrieval parameters:
| Parameter | Valid range | Description |
|---|---|---|
| Query Rewriting | On / Off | Optimizes user input to improve retrieval quality. Controlled by this toggle in Fast Mode; handled automatically by the agent in Multi-turn Agentic Mode. |
| Initial Vector Retrieval TopK | 1–100 | Number of chunks initially retrieved during vector search. |
| Initial Keyword Retrieval TopK | 1–100 | Number of chunks initially retrieved during keyword search. |
| Reranking Model | qwen3-rerank, etc. / No model | Independently reranks results retrieved from this Knowledge Base. Use the qwen3-rerank series for text-only Knowledge Bases and qwen3-vl-rerank for multimodal Knowledge Bases. |
| Reranking Mode | Q&A Mode / Similarity Mode | Q&A Mode ranks by question-answer relevance; Similarity Mode ranks by semantic similarity. Available only when a reranking model is selected. |
| Similarity Threshold | 0.01–1.0 | Filters out chunks with scores below this threshold after reranking. Higher values yield more precise results but may exclude relevant content. |
| Max Recall Count | 1–20 | Number of chunks returned from this Knowledge Base after reranking. |
| Tag Filtering | — | Filters retrieval by document tags. Enter a tag and press Enter, or select an existing tag from the dropdown list. |
Available parameters vary by Knowledge Base type. Document search and audio and video search Knowledge Bases display all parameters. Image Q&A Knowledge Bases do not display Query Rewriting and TopK parameters.
Generation controls
| Parameter | Description |
|---|---|
| Prompt | Optional, up to 50000 characters. Guides the model's response style and behavior — for example, "Answer only based on the Knowledge Base." |
| File pre-parsing | When enabled, you can upload files (including images and documents) using the attachment button in the debug pane. Two parsing modes are available: Full-text Reference, which parses the complete content as context, and Chunk-based Retrieval, which splits the file into chunks and combines them with Knowledge Base retrieval. |
| Refusal policy | When retrieval results are insufficient to answer the question, the model refuses to answer and returns a custom refusal message. |
| Leakage prevention | Prevents the original text of a Knowledge Base from being directly leaked in answers; this is not merely system-prompt protection. Returns a custom protection response when a potential leak is detected. |
| Citations | Displays source citations in the answer, indicating which document the answer content comes from. |
| Multimodal reply | Includes multimodal content from the Knowledge Base, such as images, in the answer. |
API calls
Knowledge Q&A is invoked through the chat endpoint and returns an SSE stream:
SSE event types
The Q&A response streams these events in order:
| Event | Description |
|---|---|
plan_start → planning → plan_end | Planning — the model plans the retrieval and answer strategy. |
tool_calling → tool_return | Tool calling — tool_calling emits the retrieval request; tool_return returns matched chunks. |
generation_start → generating → generation_end | Generation — streams the final answer; finish_reason is stop at generation_end. |
In Multi-turn Agentic Mode, the
plan → tool_calling → tool_return segment can repeat multiple times. See the chat endpoint for full event details.Multi-turn dialogue
The platform doesn't persist conversation state — pass the full messages history on every request. Recommendations:
- Cap history length (around the last 10 turns) to stay within the model's context window.
- Retrieve based on the most recent user message only — older messages add noise.