Inspection and Process Record Audit for Pharmaceutical Dosage Form Manufacturing: Knowledge Base Retrieval and Recall

Relevant data for pharmaceutical dosage form manufacturing comes from approved formulation processes, material batches, MES systems, electronic batch

What Data Looks Like for This Category

Relevant data for pharmaceutical dosage form manufacturing comes from approved formulation processes, material batches, MES systems, electronic batch records, LIMS, and quality management systems. This data is maintained by production, quality assurance, quality control, and warehouse departments. Daily documents include master production files, batch production records, batch packaging records, cleaning records, inspection records, deviation/CAPA/change documents, and batch release review forms. Each document links to specific fields such as material batch numbers, process parameters, and inspection values. Update frequency follows per batch production, each critical process step, and as specified in monitoring plans. Single-batch documents contain fixed-format weighing, packaging, inspection data, and compliance audit records.

Documents in this category are linked to fixed fields by production batch and have high update frequency. Retrieval must accurately match core fields such as batch numbers and process parameters to avoid retrieving historical data unrelated to the current batch. Documents must also meet GMP compliance requirements. Retrieval results must prioritize high-priority content related to deviations and releases, and must not omit key compliance records. Additionally, the volume of retrieved documents for a single batch must be controlled within a reasonable range to avoid overly long contexts that exceed model processing limits. Incremental updates must be supported to accommodate frequent batch record submissions. Failure to meet these requirements may lead to excessive audit delays or compliance risks.

Configuration Settings

Configuration ItemSuggested ValueRationale
similarity0.75–0.85Accurately match core fields such as batch numbers and process parameters in pharmaceutical dosage form batch records, and filter low-relevance historical documents
limitTop 10 resultsCover all core documents linked to a single batch production, while controlling context length to meet model processing requirements
searchModemixedRecallCombine keyword retrieval and vector retrieval to match both fixed fields and free text descriptions in documents
usingReRankEnabledReorder retrieved results to ensure high-priority documents such as deviation and release reviews appear first
datasetSearchUsingExtensionQueryEnabledAutomatically expand search terms, for example, expanding "feeding" to "weighing and feeding values" to match professional compliance expressions in documents
collectionIdsBind collection IDs from production and QA departmentsOnly retrieve approved compliant documents and exclude unrelated non-production data

This configuration is based on FastGPT v4.17.0.

Three Common Mistakes

  • Phenomenon: An error occurs during vectorization tasks, with logs showing embedding rate limit exceeded. Cause: The number of concurrent vectorization threads is not restricted, and too many requests submitted in a short time exceed interface limits.
  • Phenomenon: Knowledge base retrieval takes too long, with performance lower than expected under the same model configuration. Cause: usingReRank is not enabled, searchMode is set to pure vector retrieval, and limit is set too large, resulting in a large number of irrelevant documents participating in the sorting process.
  • Phenomenon: Untriggered model call error logs appear during workflow operation. Cause: After enabling datasetSearchUsingExtensionQuery, the scope of used models is not restricted, triggering unconfigured model requests.

How to Confirm the Configuration Is Correct

  • A single batch of test documents is uploaded, a retrieval operation is executed, and the retrieved results are verified to include documents related to the batch’s linked materials and process parameters, with sorting aligned to business priority.
  • Vectorization task run logs are reviewed to confirm there are no rate limit exceeded errors, and that the number of concurrent requests meets the current interface’s restriction requirements.
  • Workflow operation is simulated, and logs are checked to confirm there are no untriggered model call abnormal records.
  • The similarity threshold is adjusted to verify that the compliance matching degree of the retrieved results meets the requirements of business audits.

The values provided are common starting points and should be measured against the samples used in the specific deployment.