Data Characteristics
Deviation and CAPA (Corrective and Preventive Action) system data originates from internal quality management systems. Data exists as structured or semi-structured documents. These documents include deviation reports, investigation records, root cause analyses (RCA), CAPA plans, implementation records, and effectiveness verification reports. Data update frequency aligns with deviation event occurrence and processing cycles, ranging from days to months. Document structures typically contain fields such as event ID, department, deviation type, description, impact assessment, root cause, corrective actions, preventive actions, responsible person, completion date, and verification status. Time fields often use ISO 8601 format. Quantity or percentage units appear in impact assessments and verification reports.
Constraints on Multi-turn Conversation and Prompts
The highly structured and process-oriented nature of deviation and CAPA data imposes specific requirements on multi-turn conversation accuracy and prompt guidance. Strict compliance and quality standards necessitate precise understanding of user intent and avoidance of ambiguous responses. For example, when a user asks for "the root cause of a specific deviation," the system must accurately extract relevant information from numerous fields. Document update frequency determines knowledge base synchronization timeliness. Outdated information may result from untimely knowledge base updates. Complex processes and interconnected documents (e.g., links between deviations and CAPA plans) require prompt design to guide users effectively through cross-document and cross-field traceability queries, preventing information silos.
Configuration Settings
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
maxContext | 800–1200 characters | Ensures a single recall covers key deviation report information. |
Recall Count | Top 5 | Balances information completeness and processing efficiency, covering related documents. |
Similarity Threshold | 0.75–0.85 | Improves recall result precision, reducing interference from irrelevant information. |
Rerank Return Count | 3 | Focuses on core information, optimizing multi-turn conversation response quality. |
Segment Length | 300 characters | Accommodates the average paragraph length in deviation and CAPA reports. |
Prompt Template | Calibrate by measurement | Must include role definition, instructions, and output format requirements. |
Common Pitfalls
- Irrelevant CAPA information appears in conversations about a current deviation. This occurs because the knowledge base segmentation strategy is too broad, leading to the recall of unrelated documents.
- The system fails to accurately answer "list all incomplete corrective actions." This happens because the prompt design does not explicitly guide the AI to focus on specific field status filtering.
- The system still displays an old title after a user changes the page title. This indicates an issue with front-end component lifecycle management or state synchronization mechanisms.
Verification Steps
- Simulate multi-turn conversations for typical deviation reports. Verify the system's ability to accurately extract and link deviation IDs, root causes, and CAPA plans.
- Test CAPA status queries (e.g., "query all closed CAPAs"). Cross-reference the system's returned action list with actual records.
- Check if the system effectively uses contextual information during user inquiries, avoiding repetitive questions or generic responses.
Note: The values provided are common starting points and should be measured against specific 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.