What the Data for This Category Looks Like
Data for this category primarily comes from Git repositories, CI pipelines, static scan reports, and defect databases. Update frequency is daily or on each code commit. Daily generated documents include merge requests, code review comments, commit records, and branch strategy descriptions. Fields include changed file lists, reviewer identifiers, conflict flags, associated defect numbers, and more. Changed file paths and review status are core retrieval fields. Most data uses structured text formats. Some documents include code snippets and image-based review annotations.
Constraints Imposed by These Characteristics on Knowledge Base Retrieval and Recall
Dispersed data sources and frequent updates require the knowledge base to support incremental synchronization and private data source access. This prevents recall from lagging behind the latest code changes. Documents include code snippets and structured fields. Retrieval must balance semantic matching and precise field association. For example, match changed file paths to associated review history. Merge request review context is usually short. Retrieval results must be kept within a reasonable range to avoid exceeding the large model's context processing window. Documents such as branch strategy descriptions have relatively fixed structures. Complete context blocks must be retained to ensure coherent retrieval semantics.
Configuration Settings
| Configuration Item | Recommended Setting | Rationale |
|---|---|---|
similarity | 0.72–0.80 | Matches semantic similarity between code changes and review comments, filters low-relevance results, and adapts to semantic matching accuracy for code review scenarios |
limit | Top 10 entries | Adapts to the context length of a single review, avoiding exceeding the large model's context window limit |
searchMode | Semantic retrieval | Matches business semantics of code changes, covering cross-file change association scenarios |
usingReRank | Enabled | Re-ranks initial recall results, prioritizes changed files associated with the current merge request, and improves the priority of review-related results |
datasetSearchUsingExtensionQuery | Enabled | Automatically expands retrieval terms, covers associated documents such as branch strategies and CI configurations, and solves the problem of incomplete coverage with single retrieval terms |
collectionIds | Bound to knowledge base collections associated with the Git repository | Limits retrieval scope, excludes irrelevant business documents, and ensures recall results are only related to the current R&D project |
Three Common Misconfigurations
- Phenomenon: A large number of general business documents unrelated to the current merge request appear in retrieval results. Cause: The
collectionIdsconfiguration is not used to limit the retrieval scope, so retrieval covers knowledge base data from non-current projects. - Phenomenon: Image text content in PDF-format code review reports cannot be retrieved. Cause: Document image text recognition configuration is not enabled. Only plain text document parsing is supported, so image annotations in code review scenarios cannot be recalled.
- Phenomenon: The same merge request issues are retrieved multiple times repeatedly. Cause:
datasetSearchUsingExtensionQueryis not enabled. Semantic expansion is not performed for historical review issues, so potential user retrieval intentions are not covered, and similar retrievals are triggered repeatedly.
How to Verify Successful Configuration
- View the knowledge base synchronization logs for FastGPT v4.17.0. Confirm that the latest code commit records and merge requests have been incrementally synced to the target knowledge base collection.
- Enter the changed file path of the current merge request as a retrieval term. Verify that associated historical review comments and conflict resolution records can be recalled.
- Test whether retrieval results prioritize content directly related to the current change after
usingReRankis enabled. - Check the
collectionIdsconfiguration. Confirm that only the knowledge base collection corresponding to the current Git repository is bound, and no cross-project data is mixed in.
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.