Deviation and CAPA in Pharmacovigilance: Citation and Traceability

Deviation and Corrective and Preventive Action (CAPA) documents are critical quality management records in pharmacovigilance. Data typically

Data Characteristics for This Category

Deviation and Corrective and Preventive Action (CAPA) documents are critical quality management records in pharmacovigilance. Data typically originates from abnormal event reports at production sites, laboratory test results, audit findings, analysis of patient adverse event reports, and risk assessment reports. Data update frequency is irregular, triggered by events, potentially multiple times daily or weekly. Document structure is highly standardized, usually including fields such as event description, root cause analysis, impact assessment, corrective actions, preventive actions, responsible parties, completion deadlines, and verification results. Event descriptions may contain free text, while root cause analysis and action descriptions often include standard terminology and classification codes. Key fields like deviation number, CAPA number, event date, close date, drug batch number, and adverse event codes (e.g., MedDRA) have clear formats and units.

Constraints Imposed by These Characteristics on Citation and Traceability

The standardized structure of deviation and CAPA documents requires precise referencing to specific sections or fields for traceability. Due to irregular updates, the knowledge base synchronization mechanism must capture incremental updates to ensure real-time citation content. The presence of free-text fields, such as event descriptions and root cause analysis, increases the complexity of semantic understanding, requiring more refined chunking strategies to improve recall accuracy. The inclusion of specific fields like drug batch numbers and adverse event codes necessitates that the knowledge base identifies and utilizes this structured information for efficient indexing and retrieval. Furthermore, due to the interconnectedness of CAPAs, traceability may need to extend beyond a single document to the deviation report that triggered the CAPA, forming multi-document citation chains.

Configuration Settings

Configuration ItemRecommended ValueRationale
Chunk size (Chunk Size)300–500 characters (characters)Balances semantic completeness and retrieval efficiency, preventing overly long paragraphs from introducing irrelevant information.
Recall count (Recall Count)Top 8 entries (top 8)Ensures coverage of sufficient potentially relevant information while controlling processing costs.
Similarity threshold (Similarity Threshold)0.75Improves the precision of recall results, filtering out low-relevance paragraphs, and reducing noise.
Rerank result count (Reranked Return Count)Top 3 entries (top 3)Selects the most relevant few results for display, enhancing the user reading experience.
maxContext4096 tokensAligns with mainstream large language model context window limits, ensuring effective information capacity.
File Processing Timeout600 seconds (seconds)Accommodates processing time for large PDFs or complex structured documents, preventing file upload failures.

Three Common Mistakes

  • Query results contain a large amount of irrelevant cited content. This occurs when the Similarity threshold (Similarity Threshold) is set too low, leading to the recall of low-relevance document segments.
  • After a document update, the system response does not reflect the latest information. This happens when the knowledge base synchronization strategy fails to timely capture and index new deviation or CAPA reports.
  • When querying for CAPAs related to a specific batch number, the results fail to precisely locate that batch. This may occur if the knowledge base did not process the batch number as an independently retrievable field during indexing.

How to Confirm Correct Configuration

  • Upload a test document containing a known deviation number and associated actions. Query for that deviation number and check if the returned results include the corresponding action descriptions and document links. Verify the precision of the returned segments.
  • Update a CAPA content item within the test document. After the knowledge base synchronizes, query again to confirm the system returns the latest version of the CAPA information.
  • Query a CAPA report containing multiple drug batch numbers. Check if the returned results can filter and locate specific CAPA records by batch number.
  • Simulate a query involving free-text descriptions. Check if the returned citation sources effectively support the answer and if the cited paragraphs do not contain excessive irrelevant information.

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-09-21.