Data Characteristics
Deviation and Corrective and Preventive Action (CAPA) records are critical documents in biopharmaceutical production and quality management. This data typically originates from enterprise Quality Management Systems (QMS), electronic batch record systems, or independent deviation management systems. Update frequency is relatively high, with new deviation reports and CAPA plans continuously generated and status updates (e.g., "submitted," "under investigation," "approved," "completed") occurring frequently.
Document structure usually includes standardized fields such as deviation number, occurrence time, affected product/batch, deviation description, root cause analysis, impact assessment, CAPA plan (including actions, responsible person, completion deadline), and verification results. Fields contain extensive specialized terminology, abbreviations, and specific codes. Some fields may include free-text descriptions covering process parameters, equipment models, reagent batch numbers, and diverse units, often precise to multiple decimal places.
Constraints on Knowledge Base Retrieval and Recall
The highly structured and specialized nature of deviation and CAPA data demands precise matching of key fields and specialized terminology in knowledge base retrieval. The rapid update frequency requires the knowledge base to support efficient incremental update mechanisms to avoid recalling outdated or incorrectly status-ed records.
Free-text descriptions within documents necessitate strong semantic understanding and contextual association capabilities; simple keyword matching may not capture deeper meanings. The mix of numerical, date, and text information in fields requires recall strategies to differentiate data types, such as querying deviations within a specific batch or time range.
Accuracy of recall results is paramount. Incorrect deviation or CAPA information can lead to severe production or compliance risks. Therefore, higher recall precision and relevance ranking capabilities are essential.
Configuration Settings
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
Chunk size (Chunk Size) | 300–500 characters | Paragraphs in Deviation and CAPA documents typically contain complete logical units; moderate chunking preserves context. |
Chunk overlap (Chunk Overlap) | 50 characters | Ensures critical information spanning across chunks, such as deviation numbers or root causes, can be effectively linked. |
Recall count (Recall Count) | Top 8–12 items | Deviation and CAPA queries often require multiple relevant records for comparative analysis, ensuring comprehensive coverage. |
Similarity threshold (Similarity Threshold) | 0.78–0.85 | Guarantees high relevance of recalled results, reducing interference from irrelevant deviation or CAPA records. |
Rerank result count (Rerank Return Count) | Top 5 items | Performs a secondary sort on initial recall results to further prioritize the most relevant information. |
PARSE_FILE_TIMEOUT_SECONDS | 300 seconds | Accounts for potentially large PDF or Word documents exported from QMS, preventing parsing timeouts. |
Common Pitfalls
- Incomplete deviation or CAPA records are returned, for example, only the deviation description is provided without the root cause or CAPA plan. This occurs when the knowledge base chunking strategy is too aggressive, splitting critical information across different chunks, leading to incomplete recall during retrieval.
- Queries about deviations for a specific batch or product name return irrelevant records. This may be due to the knowledge base not effectively tagging or entity-recognizing key fields like product names or batch numbers, resulting in inaccurate semantic matching.
- After configuring the knowledge base, importing documents results in
418 I'm a teapotor other HTTP status code errors. This typically indicates the file size exceeds theUPLOAD_FILE_MAX_SIZElimit of FastGPT or the proxy server, requiring inspection and adjustment of relevant configurations.
Verification of Configuration
- Select typical deviation and CAPA queries. Test whether recall results include all necessary fields (e.g., deviation number, root cause, CAPA actions) and check their completeness.
- Use queries containing specific products, batches, or time ranges. Verify that recall results accurately point to deviation or CAPA records under these specified conditions.
- Import a batch of deviation documents with different statuses (e.g., "under investigation," "completed"). Confirm the knowledge base correctly identifies and recalls records with the latest status.
- Check knowledge base logs to ensure no
PARSE_FILE_TIMEOUT_SECONDSor similar timeout or error messages occurred during file import and processing.
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.