Supplier and Process Quality Audit for Active Pharmaceutical Ingredient and Pharmaceutical Intermediate Manufacturing: Citation Sources and Traceability

Data sources include registered process documents, raw material batch ledgers, DCS production data, weighing system records, LIMS test data

What data for this category looks like

Data sources include registered process documents, raw material batch ledgers, DCS production data, weighing system records, LIMS test data, chromatography data system reports, and QMS deviation and change documents. Updates are triggered once per production batch and each process step. Daily documents include batch production records, material balance sheets, reaction and purification records, cleaning validation records, impurity profile reports, and deviation and change application documents. Core fields include raw material batch numbers, reaction temperature and time, impurity content values, solvent residue levels, and yield data, with units including mg/kg, ppm, hours and other specialized chemical parameters.

Constraints on citation sources and traceability workflow

Dispersed multi-source data requires the traceability system to associate different types of specialized documents across systems, avoiding limitations from a single data source. High-frequency batch-based updates require traceability configurations to support real-time association with records from the latest production batches, ensuring the timeliness of audit basis. Structured and semi-structured document formats require traceability matching to accurately align with exclusive fields such as batch numbers and impurity parameters, preventing incorrect associations caused by generalized matching. Complex process steps and change associations require the traceability scope to cover associated documents across multiple links, ensuring the completeness of audit logic.

Configuration settings

The following configurations are formulated for FastGPT v4.17.0.

Configuration ItemRecommended SettingRationale
quoteMaxToken1500–2000 tokenMatches the full content length of a single impurity profile report or batch production record
responseDataIncludes source document ID, raw material batch number, reaction parametersAssociates core traceability fields for active pharmaceutical ingredient production audits
detailEnabledDisplays complete original test data and process record details
Single search limitTop 8 entriesCovers the number of associated documents for multi-step synthesis reactions
Maximum context4000–5000 charactersAccommodates the full content of material balance and deviation change documents

Three common configuration errors

  • Phenomenon: Returned audit answers are not associated with the cited knowledge base content, and the cited documents do not involve the impurity or process parameters of the current batch. Cause: No precise recall rule is configured for exclusive fields of pharmaceutical production such as batch numbers and impurity profiles, resulting in recalled documents that do not match the scenario.
  • Phenomenon: The citation source content for a specified query cannot be hidden, and all results force display of the original link. Cause: The global visibility configuration is mistakenly applied to the dedicated supplier audit workflow, without distinguishing visibility permissions for different scenarios.
  • Phenomenon: Some impurity profile reports and cleaning records are not converted into question-and-answer pairs, and are directly embedded into the knowledge base as original text. Cause: No dedicated splitting rule is enabled for structured specialized chemical documents, resulting in failed embedding matching.

How to confirm correct configuration

  • Initiate a query containing "XX batch impurity test results", and check whether the cited documents in the returned results include the impurity profile report for the corresponding batch.
  • View the details of the citation source, confirm that it includes exclusive fields such as raw material batch number and reaction parameters.
  • Test the configuration for hiding citation content, confirm that the original link button is not displayed on the result interface for the corresponding query.
  • Upload a simulated intermediate transfer record, verify that the system can generate the corresponding question-and-answer pair and correctly associate traceability information.

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