Supplier and Process Quality Audit for Finished Pharmaceutical Dosage Forms Production: Knowledge Base Retrieval and Recall

Data related to finished pharmaceutical dosage forms production mainly comes from approved formulation processes, material batches, MES electronic

What data for this category looks like

Data related to finished pharmaceutical dosage forms production mainly comes from approved formulation processes, material batches, MES electronic batch records, equipment and environmental monitoring data, LIMS systems, and quality management systems. Daily documents include master production documents, batch production records, batch packaging records, cleaning validation records, inspection records, deviation CAPA change documents, and batch release approval forms. Data is updated with each batch production, execution of key process steps, and progress of monitoring plans. Documents from each link must be generated synchronously with production operations, including fields such as material batch numbers, process parameters, test results, and deviation situations. Units correspond to actual production indicators based on document type.

Data for this category is updated with each batch production, execution of key steps, and monitoring plans, and must be synchronized with production operations. This requires the knowledge base retrieval to support precise filtering and recall of content by batch dimension, to avoid mixing data across batches. Documents contain precise fields such as process parameters, material batch numbers, and deviation records. Retrieval must ensure that recalled content fully matches the production scenario of the current audit batch, and must not include unassociated batch data. At the same time, the audit link needs to quickly retrieve corresponding batch records and compliance documents. Retrieval response must match production rhythm, and recalled content must not involve unapproved deviations or change records, otherwise this may lead to failure of batch release or regulatory penalties.

How to set the configurations

The following configurations are based on FastGPT v4.17.0.

Configuration ItemRecommended SettingRationale
similarity0.75–0.85Meets the precision requirements for matching process parameters and material information in finished pharmaceutical dosage forms production, to avoid recalling low-relevance content from unrelated batches
limitTop 8 entriesCovers the number of core audit documents such as single-batch batch records, inspection records, and deviation documents, to ensure sufficient context without redundancy
searchModeembeddingSupports precise semantic matching of unstructured content such as process descriptions and deviation handling workflows, suitable for compliance document retrieval
usingReRankEnabledRe-sorts recalled results by relevance to the current audit task, to prioritize content directly related to the current batch’s process and materials
datasetSearchUsingExtensionQueryEnabledAutomatically expands associated terms for audit questions, such as associating "feeding" with scenario terms like "weighing ratio" and "material verification", to adapt to professional terminology in the pharmaceutical industry
collectionIdsConfigured by department and document typeOnly recalls compliance documents from production and QA departments, to avoid mixing irrelevant content from warehouse or equipment management, which aligns with the document permission requirements of this category

Three common mistakes

  • The issue is that retrieval results fail to match uploaded batch release approval form content. The cause is that the corresponding documents were not added to the specified collectionIds set, or the similarity threshold was set too high, filtering out valid content.
  • The issue is that retrieval results cannot match documents corresponding to professional terms such as "CAPA" and "batch release". The cause is that datasetSearchUsingExtensionQuery was not enabled, and industry professional terms were not automatically expanded, leading to failure to associate with corresponding compliance documents.
  • The issue is that process flow chart images from external documents are not displayed in retrieval results. The cause is that document image recall configuration was not enabled, and only text content was extracted.

How to confirm the configurations are set correctly

  • Upload batch production records and inspection records for a single batch, initiate retrieval for the corresponding audit question, and check whether the recalled results include exclusive documents for this batch.
  • Check the sorting of retrieval results, confirm that high-relevance process parameters and deviation handling content are displayed first, to verify the effect of the usingReRank configuration.
  • Initiate a retrieval request containing professional terms, confirm whether associated compliance documents can be recalled, to verify the effect of the datasetSearchUsingExtensionQuery configuration.
  • Check whether the number of retrieval results meets the document quantity requirements for business audits, to verify the rationality of the limit configuration.

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