This document is written for FastGPT v4.17.0, and provides guidance on knowledge base retrieval and recall configuration for database operations scenarios.
What the Data for This Use Case Looks Like
Data for this use case primarily comes from database monitoring, audit logs, SQL execution plans, and internal ticket systems. Daily generated documents include database change orders, slow SQL reports, backup records, and permission application forms. Data is updated daily or synced with individual database changes. Document fields include instance ID, execution duration, rows scanned, backup size, permission request scope, and some fields have clear units: duration is measured in milliseconds, backup size is measured in MB.
Constraints for Knowledge Base Retrieval and Recall
Data sources are scattered and linked via instance IDs. Retrieval must precisely match instance-level context to avoid recalling irrelevant cross-instance content. Document update frequencies are uneven, and documents generated from single changes are highly time-sensitive. Appropriate recall mechanisms must be configured. Fields with units must retain unit information during vector encoding, otherwise semantic matching errors will occur. Professional operations documents have strong technical terminology. Matching accuracy must be optimized for scenarios such as slow SQL and permission applications to avoid recalling low-relevance general content.
Configuration Settings
| Configuration Item | Recommended Setting | Rationale |
|---|---|---|
similarity | 0.75–0.85 | Matches semantic precision for database operations professional documents, filters low-relevance general operations content |
limit | Top 8 entries | Balances recall count and context length, fits the single content length of database operations documents |
searchMode | hybrid | Combines keyword and vector retrieval, adapts to matching needs for professional terminology and structured fields |
usingReRank | Enabled | Reranks the top 10 recalled results, filters low-relevance historical records in slow SQL reports |
datasetSearchUsingExtensionQuery | Enabled | Automatically expands search terms, adds synonyms for database professional terminology, improves recall rate of slow SQL related content |
collectionIds | Bind to the database operations knowledge base collection for the current instance | Precisely limits retrieval scope to avoid cross-instance irrelevant data |
Three Common Configuration Errors
- Phenomenon: Database operations knowledge base recall results are automatically included in regular conversations. Cause: Global knowledge base binding is not disabled in conversation configuration, or the database operations collection is incorrectly mounted to a general conversation node.
- Phenomenon: A global variable configured for knowledge base selection type cannot be read in a judge node. Cause: The global variable scope does not cover the node chain where the judge node is located, or the variable type is not correctly set to knowledge base selection.
- Phenomenon: When searching for slow SQL related queries, recalled results do not include structured tables and screenshot content in reports. Cause: The multimodal parsing switch for the knowledge base is not enabled, or the vector model does not support vector encoding of multimodal content.
How to Verify Correct Configuration
- Initiate a slow SQL query test for a single database instance, check if recalled results only include documents related to that instance.
- View retrieval logs, confirm
searchModeis set to hybrid andusingReRankis enabled. - Configure a test field with units, verify that retrieval accurately matches query terms with units.
- Trigger a regular conversation, confirm no automatic inclusion of database operations knowledge base recall content, and retrieval is only enabled in specified knowledge base nodes.
The values provided are common starting points and should be measured against the reader's own samples.
Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-10-19.