Streaming RAG 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.
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
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 | Upload a file mid-conversation; the system parses it on the fly without importing it into a Knowledge Base. |
| Generation controls | Refusal policy, prompt-leak protection, and citation rendering. |
Create a Q&A service
1
Open Knowledge Q&A
Sign in to the console and click Knowledge Q&A in the left navigation.
2
Create a service
Click New Q&A Service in the top right and fill in a name and description.
3
Configure model and prompt
- Pick a generation model (such as qwen3-plus or DeepSeek-R1).
- Optionally enter a prompt (up to 500 characters) to steer the model's tone.
4
Pick a retrieval mode
Choose Fast Mode or Multi-turn Agentic Mode.
5
Bind Knowledge Bases
Click Add to bind Knowledge Bases (up to 15) and configure per-source retrieval parameters.
6
Configure generation controls
Enable the refusal policy, prompt-leak protection, and other controls as needed.
7
Publish
Click Publish in the top right.
Retrieval modes
| Mode | How it works | Best for |
|---|---|---|
| Fast Mode | Single-pass retrieval with the lowest latency. | Simple factual questions. |
| Multi-turn Agentic Mode | The model plans the search strategy, rewrites the query multiple times, and merges results. | Complex questions, multi-step reasoning, information spread across documents. |
Generation controls
| Parameter | Description |
|---|---|
| Prompt | Steers the model's tone — for example, "Answer only based on the Knowledge Base." |
| Refusal policy | If nothing relevant is retrieved, the model declines instead of fabricating an answer. |
| Prompt-leak protection | Prevents the model from echoing the system prompt or internal instructions. |
| Citations | Adds citation markers in the answer that link back to the source Chunk. |
| Multimodal reply | Answers can include images, tables, and other rich media. |
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.