Data Characteristics
Supplier audit documentation primarily consists of periodic assessment reports, quality system documents, production batch records, and inspection reports from biopharmaceutical companies collaborating with suppliers. These documents are typically in PDF, Word, or Excel formats. Some scanned documents or handwritten records require OCR. Data updates frequently, especially with new supplier introductions, product batch adjustments, or compliance updates. Document structures are complex, containing large amounts of unstructured text, tabular data, charts, and signature information. Key fields include supplier name, audit date, audit conclusion, non-conformance description, corrective actions, responsible person, completion date, and various test indicators (e.g., Microbial Limits, Heavy Metal Content) and their units (e.g., CFU/g, ppm).
Constraints Imposed by Data Characteristics on Database and Operations
The complex structure and high update frequency of supplier audit documents impose specific database and operations requirements. First, large amounts of unstructured text and nested tables require efficient text embedding and vector retrieval capabilities to support semantic search for critical information like audit conclusions and non-conformances. Second, OCR-identified data quality can be unstable, potentially containing character recognition errors or format deviations. This necessitates a flexible data model and version management capabilities in the database for subsequent manual review and correction. High update frequency means significant overhead for data synchronization and index rebuilding, requiring optimized indexing strategies and incremental update mechanisms. Additionally, sensitive information in audit reports (e.g., trade secrets, quality defects) demands strict data security and access control, requiring fine-grained permission management and audit logging. The various units of measurement in documents require data storage to accurately distinguish and support unit conversion.
Configuration Guidelines
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
UPLOAD_FILE_MAX_SIZE | 100 MB | Audit documents may contain many images and scanned pages, leading to large file sizes. |
PARSE_FILE_TIMEOUT_SECONDS | 600 seconds | OCR processing of complex scanned documents or large PDFs can be time-consuming. |
maxContext | 2000 characters | Ensures capture of complete descriptions of non-conformances and corrective actions in audit reports. |
Chunk size | 500 characters | Balances semantic completeness and vector embedding efficiency, preventing key information dilution in long texts. |
Similarity threshold | 0.75 | Improves recall precision, avoiding retrieval of irrelevant audit entries. |
max_connections | Calibrate based on actual measurements | Dynamically adjust based on the concurrent request volume for processing audit documents to prevent connection pool exhaustion. |
Common Pitfalls
- Local database connection errors, appearing as
MongoServerSelectionError: connection refused. This may be due to the local MongoDB service not running, or incorrecthostorportconfiguration in the connection string. - When testing concurrent requests on shared pages, some requests receive no response or time out. This appears as
HTTP 504 Gateway Timeout. This may be due to the FastGPT instance'sNODE_MAX_CONCURRENT_REQUESTSparameter being set too low, or the backend model service'smax_connectionsnot being adjusted for concurrency. - After document parsing, some tabular data is not extracted correctly, or the
审计结论field appears garbled. This may be due to insufficient OCR engine support for specific layouts or fonts, or inadequate document preprocessing (e.g., image clarification).
Verification Steps
- Upload a typical supplier audit PDF document. Check if key fields (e.g.,
不符合项描述,corrective actions) in the parsed result are complete and not garbled. - Perform concurrent upload and parsing tests. Monitor system logs to ensure no
connection refusedortimeouterrors, and check ifresponse_timeis within an acceptable range. - Randomly select 10 structured audit reports. Verify the
test indicatorsandunitfields to ensure data types and values match the original documents, and confirm that units are not incorrectly converted or lost.
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.