Data Characteristics
Small molecule pharmaceutical quality documents include raw material inspection standards, intermediate control limits, finished product quality standards, batch production records, batch inspection records, stability study reports, deviation handling reports, change control documents, and annual product quality review reports. These documents are typically PDFs, Word files, or scanned images. They have a relatively fixed structure; for example, quality standards contain fixed fields like physical and chemical properties, identification, assay, and impurity checks. Data update frequency is low, occurring mainly during new drug registration, process changes, supplier audits, or regulatory updates. Documents often include specialized fields such as IUPAC names, CAS numbers, molecular weight, melting point, specific rotation, and absorption spectra, along with specific units like ug/mL, ppm, and % (w/w).
Constraints Imposed by These Characteristics on "Reference and Traceability"
The fixed structure and specific fields of small molecule pharmaceutical quality documents require precise referencing to specific sections or tables within a document. This avoids ambiguity from generalized references. Low update frequency means knowledge base content updates should not be too frequent. However, any update requires all associated references to refresh synchronously. The large number of specialized terms, chemical structures, and units in documents demands higher precision in text segmentation and embedding models. This ensures the model correctly understands and differentiates entities. High traceability requirements mean each reference must point to the original text and also trace back to the document's version number, revision date, and approval records for compliance audits.
Configuration Strategy
| Configuration Item | Suggested Value | Rationale |
|---|---|---|
Chunk size | 500–800 characters | Ensures sufficient contextual information while preventing overly long segments from imprecise recall. |
Recall count | Top 5 entries | Balances recall efficiency and relevance, reducing interference from irrelevant information. |
Similarity threshold | Calibrate by measurement | Small molecule pharmaceutical terminology is highly specialized. Test with actual corpus to ensure recall precision. |
Rerank result count | Top 3 entries | Further optimizes recall results through a reranking model, highlighting the most relevant content. |
maxContext | 3000 Tokens | Accommodates complex descriptions and multi-step experimental procedures that may appear in documents. |
PARSE_FILE_TIMEOUT_SECONDS | 600 seconds | Accounts for potentially long processing times for large PDF files or scanned OCR documents. |
Three Common Pitfalls
- The model does not answer the question, only quoting original text snippets. This may occur if
Similarity thresholdis set too high, leading to sparse recall results. The model cannot extract an effective answer and only reiterates the original text. - Some documents do not generate question-answer pairs and are stored directly as original text. This may occur if
Chunk sizeormaxContextare set incorrectly, preventing effective document content segmentation and understanding. Alternatively, the chosen embedding model may lack sufficient processing capability for specific formats like complex tables or text within images. - FastGPT shows an error when connecting to external applications but still runs in references. This typically results from external connector configuration issues, such as incorrect API keys, callback addresses, or permission settings. This causes system-level connection failure but does not affect FastGPT's internal referencing logic.
Verification Steps
- Select a batch of quality documents containing specific chemical structures, units, and compliance requirements. Ask relevant questions and check if the cited sources in the answers accurately point to specific paragraphs or tables in the original text.
- Check system logs or the debug interface to verify if
PARSE_FILE_TIMEOUT_SECONDStriggers a timeout when processing large files. Adjust as needed. - Manually verify specialized terms and data in model-generated answers. Ensure complete consistency with information in the original document, especially for critical data like molecular weight and purity percentages.
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.