Data Characteristics
Quality documents for high-value consumables are highly structured and versioned. Data originates from production batch records, inspection reports, sterilization validations, supplier qualifications, and regulatory approval documents. These documents typically use PDF, Word, or Excel formats. They include structured metadata such as batch number, production date, expiry date, serial number, supplier code, and registration certificate number. Updates align with batch production; each batch or quality system change generates new or revised documents. Fields and units strictly follow industry standards. For example, sterilization parameters use "Gy" or "kGy," and inspection results often include units like "%," "mm," or "ppm."
Constraints Imposed by HTTP API and External Systems
The structured and versioned nature of high-value consumable quality documents requires HTTP APIs to support precise metadata retrieval. This ensures accurate linking to documents using key information like batch numbers or registration certificate numbers. Diverse file formats mean the API must support various file types for upload and parsing, extracting text content. Frequent batch updates and document revisions demand real-time synchronization from external systems. Webhooks or polling mechanisms are necessary to keep the knowledge base consistent with actual document states. Strict unit and field specifications require the API to accurately identify and preserve this information during data transfer and parsing. This prevents quality judgment errors due to missing units or conversion mistakes. The need for historical version traceability means API design must include version management and historical record query functions.
Configuration Settings
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
maxContext | 4000 characters | Ensures complete inclusion of critical information from a single inspection report or batch record, preventing semantic loss from truncation. |
Segment Length | 800–1000 characters | Balances retrieval accuracy and model processing efficiency, accommodating multi-paragraph and multi-table structures in high-value consumable documents. |
Recall Count | Top 8 | Covers multiple relevant batches or different dimensions of quality control points, improving recall comprehensiveness. |
Similarity Threshold | Calibrate by measurement, suggested 0.75-0.85 | Distinguishes subtle quality differences between batches or suppliers, reducing incorrect recalls. |
PARSE_FILE_TIMEOUT_SECONDS | 300 seconds | Handles large PDF batch records or inspection reports, ensuring file parsing completes. |
UPLOAD_FILE_MAX_SIZE | 100 MB | Accommodates quality documents containing multi-page scans or high-resolution images. |
Common Mistakes
- HTTP API returns 404 or 500 errors, preventing the knowledge base from obtaining document content. This occurs due to external system authentication failure or incorrect API path configuration, blocking FastGPT from accessing target resources.
- Uploaded HTML format API documents parse to empty content or garbled formatting. This happens because FastGPT's default parser has insufficient support for complex HTML structures generated by tools like Javadoc or Swagger, failing to extract text correctly.
- Knowledge base query results do not accurately answer questions involving specific batch numbers. This results from failure to extract or correctly map key metadata fields like batch numbers during document upload, preventing effective scope limitation during RAG retrieval.
Verification Steps
- Manually upload a typical batch inspection report PDF file via the FastGPT management interface. Observe if the parsing result is complete and free of garbled characters.
- After configuring the HTTP API, use FastGPT's knowledge base testing tool to simulate requests. Check if the system successfully retrieves the external system's document list or specific file content.
- Create an Agent in FastGPT based on this knowledge base. Ask quality-related questions involving specific batch numbers, production dates, or suppliers. Verify if the returned answers accurately cite relevant document information.
- Regularly check the knowledge base synchronization logs. Confirm that documents updated in the external system are fetched and indexed at the expected frequency. Check for any synchronization failure records.
The values provided are common starting points. Measure them against your 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.