Data Characteristics for This Category
Deviation and Corrective and Preventive Action (CAPA) documents are central to biopharmaceutical manufacturing and quality management. These documents typically originate from production anomalies, audit findings, or quality system reviews. Data update frequencies vary; deviation reports can appear at any time, while CAPA execution and closure cycles may span weeks to months. Document structures usually include event descriptions, root cause analyses, impact assessments, corrective actions, preventive actions, verification results, and closure approvals. Fields include, but are not limited to: Deviation ID, CAPA ID, occurrence date, discoverer, affected product, batch number, deviation type, root cause, action plan, responsible person, planned completion date, actual completion date, and verification results. Time fields are dates or timestamps. Quantity fields include specific units like milliliters, grams, or batches.
Constraints Imposed by These Characteristics on Citation and Traceability
The dynamic and interconnected nature of Deviation and CAPA documents demands robust citation and traceability capabilities. CAPAs often follow specific deviations. Therefore, retrieval or question-answering systems must trace from a CAPA to its associated deviation report, and vice versa. The highly structured content, especially key fields like IDs, dates, and responsible persons, requires precise matching during RAG system recall to avoid semantic ambiguity. Uncertain update frequencies mean the knowledge base needs incremental updates and version management to ensure information cited is current. Furthermore, these documents may contain sensitive quality data. Traceability must point to the original document and specify the exact document passage for specific information in the answer, supporting audits and compliance reviews.
Configuration Settings
| Configuration Item | Suggested Value | Rationale for This Value |
|---|---|---|
Chunk size (Chunk Size) | 500–800 characters (characters) | Deviation and CAPA documents often contain detailed event descriptions and analyses. Longer chunks help preserve contextual completeness and prevent critical information truncation. |
Overlap Length | 50 characters (characters) | Appropriate overlap helps maintain contextual coherence at chunk boundaries, improving recall accuracy, especially for causal relationships spanning across paragraphs. |
Recall count (Recall Count) | Top 5–7 entries (top 5–7 items) | Given the strong interconnections between Deviation and CAPA documents, increasing the recall count helps cover a wider range of relevant documents, enhancing the comprehensiveness of answers. |
Similarity threshold (Similarity Threshold) | 0.75–0.85 | The biopharmaceutical sector demands high accuracy. A higher similarity threshold ensures recalled documents are highly relevant to the user's query, reducing interference from irrelevant information. |
Max Tokens | 4096 | Allows for a longer context window to accommodate complex descriptions, multi-step actions, and detailed verification reports that may appear in Deviation and CAPA documents. |
Citation Return Count | 3 entries (3 items) | Providing a moderate number of citations in the final answer supports information traceability without excessive redundancy that could affect user readability. |
Three Common Mistakes
- The response provides only citation links but no specific answer content. This usually occurs when the
Similarity threshold(similarity threshold) is set too high, preventing the model from extracting enough information from recalled passages to generate an answer. - Citation sources display "cannot be activated" or the original document cannot be viewed. This may be because the
ParseFileTimeoutSecondsparameter was set too short when the knowledge base processed the file, failing to fully parse large deviation or CAPA documents, leading to the loss of original file paths or metadata. - In multi-turn conversations, the system fails to cite deviation or CAPA information mentioned in previous turns. This usually happens when the
maxContextparameter is insufficiently configured, failing to retain enough historical conversation context.
How to Confirm Correct Configuration
- For typical deviation or CAPA queries, check if the answer includes key information from relevant documents and accurately links to specific passages in the original documents.
- Perform a series of cross-reference queries. Verify the system can trace from CAPA documents to their associated deviation reports, and from deviation reports to corresponding CAPA actions.
- Simulate an audit scenario. Ask compliance questions about a specific deviation or CAPA. Check if the system provides detailed answers with clear citation sources, and can further pinpoint fields like responsible persons and dates within the document.
The values given 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.