The Knowledge Base node enables Retrieval-Augmented Generation (RAG) by retrieving relevant information snippets from a specified knowledge base and passing the retrieved results as context to downstream Large Language Model (LLM) nodes. This helps address common LLM limitations such as outdated knowledge, inability to access private data, and tendency to hallucinate.
Defines the basis for retrieval from the knowledge base.
The Knowledge Base node supports two ways to select knowledge bases:
Defines the logic for triggering the knowledge base. Default: Always Invoke.
Specifies which types of knowledge base your application needs to search. Three types supported:
Supported only in Always Invoke and Smart Invoke modes. Click the debug button next to Document, Table, or Image to test retrieval performance for that type—and iteratively refine your knowledge base configuration strategy based on returned results. Once verified, click Save (top-right corner) to apply changes to the current application.
Disabled by default. When enabled, the system leverages an LLM to perform secondary intelligent filtering on retrieved document and table results—improving final output quality. Recommended for applications requiring high answer precision or needing to filter out irrelevant content.
The Knowledge Base node outputs a structured object containing a
Empty results may stem from:
Adding the Node
Method 1: Add via Plus Button
- Click the plus (+) button at the end of any node on the canvas.
- Select the Knowledge Base node from the pop-up list.
- The node is automatically added to the canvas and connected to the upstream node.
Method 2: Drag & Drop from Node Library
- Locate the Knowledge Base node in the left-side node management panel.
- Drag it onto the desired position on the canvas.
- Manually connect it to upstream and downstream nodes.
Core Configuration
Input Configuration
Defines the basis for retrieval from the knowledge base.
| Parameter | Description |
|---|---|
content | Text to be searched. You can enter plain text directly, or type / or trigger variable selection in the editor to reference output variables from upstream nodes. |
imageList | Images to be searched. Accepts publicly accessible image URLs (e.g., https://xxx.xxx.com/xxx/xxx.jpeg) or variable references via / or variable selection in the editor. |
Knowledge Base Selection Method
The Knowledge Base node supports two ways to select knowledge bases:
| Selection Method | Use Case | Configuration Notes |
|---|---|---|
| Select Fixed Knowledge Base | Knowledge base is static—same one used on every invocation. | Choose a specific knowledge base from the dropdown menu. Supports documents, tables, and images. |
| Dynamic Import | Knowledge base(s) used are determined dynamically based on upstream node outputs. | Configure a CodeList variable—specify the knowledge base list either by referencing a variable or entering it directly. |
Knowledge Base Invocation Mode
Defines the logic for triggering the knowledge base. Default: Always Invoke.
| Mode | Description | Required Parameters |
|---|---|---|
| Always Invoke | Every user input triggers knowledge base retrieval—ideal for high-frequency Q&A scenarios. | None required. |
| Smart Invoke | The agent decides whether to retrieve, based on user input and the provided Knowledge Base Description—ideal for flexible conversational flows. | Knowledge Base Description (required) |
| Legacy Invoke | Retrieves mixed results across document/table/image knowledge bases, using topK to globally cap total retrieved items. Does not support per-type debugging. | topK (range: 1–50; default: 10) |
| Parameter Notes: | - Knowledge Base Description: Describes the content covered in the knowledge base and specifies under what conditions its data should be used for responses. Accepts plain text or variable insertion. | - topK: Maximum number of text chunks retrieved per knowledge base. Actual count may be lower depending on match quality. |
Knowledge Base Type
Specifies which types of knowledge base your application needs to search. Three types supported:
| Type | Description |
|---|---|
| Document | Built from document-style data. The model can cite text snippets to answer questions. |
| Table | Built from tabular or database-style data. The model can cite query results to answer questions. |
| Image | Built from image data. The model can retrieve images and reference associated image descriptions to answer questions. |
Debugging Retrieval Results
Supported only in Always Invoke and Smart Invoke modes. Click the debug button next to Document, Table, or Image to test retrieval performance for that type—and iteratively refine your knowledge base configuration strategy based on returned results. Once verified, click Save (top-right corner) to apply changes to the current application.
Knowledge Base Filtering
Disabled by default. When enabled, the system leverages an LLM to perform secondary intelligent filtering on retrieved document and table results—improving final output quality. Recommended for applications requiring high answer precision or needing to filter out irrelevant content.
Node Output
The Knowledge Base node outputs a structured object containing a result field:
| Field | Type | Description |
|---|---|---|
result | Object | Overall output containing all retrieval results. |
result.chunkList | Array<Object> | List of retrieved knowledge base chunks. Empty if none found. |
result.chunkList[ ].content | String | Raw content of the retrieved chunk. |
result.chunkList[ ].title | String | Title of the document the chunk belongs to. |
result.chunkList[ ].documentName | String | Name of the knowledge base containing the chunk. |
result.chunkList[ ].score | Number | Similarity score of the chunk—higher values indicate stronger relevance. |
result.chunkList[ ].id | String | Chunk ID. |
result.chunkList[ ].dataId | String | Document ID. |
result.chunkList[ ].docUrl | String | Source file download URL. |
result.chunkList[ ].knowledgeBaseId | String | Knowledge base ID. |
result.chunkList[ ].nid | String | Original source identifier. |
result.chunkList[ ].images | Array<String> | List of associated image URLs. |
result.chunkList[ ].pageNumber | Array<Number> | Page numbers where the chunk appears. |
result.rewriteQuery | String | Rewritten version of the user's original query. |
Common Usage Patterns
| Paired Node | Typical Use Case |
|---|---|
| Knowledge Base → LLM Node | Pass retrieved knowledge as context to the LLM for knowledge-grounded response generation. |
| Intent Classification → Knowledge Base Node | First classify user intent, then decide whether to invoke the knowledge base—or which knowledge base to use. |
| Knowledge Base → Conditional Node | Route subsequent logic based on whether retrieval returned results—or on chunk score thresholds. |
| Knowledge Base → Variable Processing → LLM Node | Transform or extract key content from retrieval results before feeding them to the LLM. |
Frequently Asked Questions
Why is the retrieval result empty?
Empty results may stem from:
- Query content being unrelated to knowledge base content
- Incorrect knowledge base configuration or incomplete indexing
- Failure to meet invocation conditions in Smart Invoke mode
How can I improve retrieval accuracy?
- Optimize document chunking strategies in your knowledge base.
- Enable Knowledge Base Filtering, and customize the filtering prompt for secondary refinement.
- In Smart Invoke mode, refine your Knowledge Base Description and invocation conditions.