Cross-Review of Technical Documentation for Active Pharmaceutical Ingredient and Pharmaceutical Intermediate Manufacturing: Knowledge Base Retrieval and Recall

Data for this category comes from registered process documents, raw material batch ledgers, DCS control systems, weighing systems, LIMS laboratory

This page is based on FastGPT v4.17.0 configuration guidelines.

What Data Looks Like for This Category

Data for this category comes from registered process documents, raw material batch ledgers, DCS control systems, weighing systems, LIMS laboratory information management systems, chromatography data systems, and QMS quality management systems. Daily documents include batch production records, material balance sheets, reaction and purification step records, cleaning validation records, impurity profile reports, deviation and change documents. Updates are triggered per production batch or process step. Document fields include batch number, reaction temperature, yield percentage, impurity content, solvent residue amount, with corresponding units such as ℃, %, and mg/L.

Constraints on Knowledge Base Retrieval and Recall

Multiple heterogeneous data sources require the retrieval link to support unified indexing and recall of cross-system documents. This avoids retrieval omissions caused by data silos. High-frequency updates triggered per batch or step require the retrieval pipeline to support incremental updates and rapid synchronization. This prevents retrieval results from lagging behind the latest process data. The field and unit characteristics of specialized chemical documents require the retrieval model to adapt to semantic understanding of chemical terminology. This avoids recall deviations caused by terminology mismatches. High detail density in single-batch documents requires the retrieval link to properly control the length of recall results. This avoids exceeding context window limits.

Configuration Settings

Configuration ItemRecommended SettingRationale
similarity0.75–0.85Meets the terminology semantic matching requirements for specialized chemical documents, filters low-relevance process records
limitTop 8–12 entriesBalances the detail density of single-batch documents and context window limits, avoids redundant or insufficient recall results
usingReRankEnabledSecondary sorting filters semantic deviation results from initial recall, improves recall accuracy for key documents such as impurity profiles and change files
searchModeembeddingAdapts to the semantic association characteristics of process documents, replaces retrieval modes that only rely on keyword matching
datasetSearchUsingExtensionQueryEnabledExpands the retrieval scope for specialized terms, covers process data described in multiple ways such as "yield" and "solvent residue"

Three Common Errors

  • Phenomenon: After retrieval results are passed to an HTTP request, the AI chat cannot correctly reference document content, and returns empty fields. Cause: Document metadata required for knowledge base reference (such as batch number, document type) is not passed, so the context cannot associate with the corresponding process record.
  • Phenomenon: The number of retrieval results is far lower than the set limit value, or no results are returned at all. Cause: datasetSearchUsingExtensionQuery is not enabled, so the retrieval coverage of specialized terms is insufficient, and documents containing impurity profiles or change records cannot be recalled.
  • Phenomenon: After using the question optimization node, the retrieval results do not change as expected. Cause: The trigger logic between the built-in question optimization of the knowledge base node and the independent question optimization node is confused, and the term expansion rule is not correctly configured in the retrieval pipeline.

How to Confirm Proper Configuration

  • Run a retrieval test, verify that the document types of the recall results include target documents such as impurity profile reports and batch production records, and adjust the similarity range to meet business requirements.
  • View the logs of the retrieval pipeline, confirm that the document metadata fields passed to the HTTP request are complete, with no missing key information such as batch number or reaction temperature.
  • Test the question optimization configuration, compare the retrieval result differences before and after enabling datasetSearchUsingExtensionQuery, and confirm that term expansion takes effect.
  • Check the collectionIds configuration, confirm that all document collections to be retrieved are included, with no missing system data sources.

The values provided are common starting points, and should be evaluated against the reader's own samples.