What the data for this category looks like
Refinery and chemical production documents and materials mainly originate from internal business documents such as process specifications, equipment ledgers, safety operation procedures, maintenance records, and material balance sheets. The update rhythm of documents varies significantly by type: process specifications are updated every six months to one year, equipment ledgers are updated monthly, and maintenance records are generated in real time alongside on-site operations. Document structures include fixed fields and dynamic parameters. Fixed fields include equipment number and process sequence number. Dynamic parameters include operating pressure, temperature, and feed flow rate. Units cover industrial standard units such as MPa, ℃, t/h, and m³. Some documents include structured content such as process flow diagrams and parameter tables.
What constraints these characteristics impose on multi-turn dialogue and prompt engineering
Refinery and chemical production document data includes a large number of precise parameters with units, structured tables, and image-based documents. Multi-turn dialogue needs to track users’ continuous questions about specific equipment or processes, so a stable context isolation mechanism is required. For parameter fields, prompts must clearly specify validation rules to avoid returning results without units or with incorrect units. Image-based documents cannot return complete content directly through plain text retrieval, so additional image parsing adaptation logic must be configured. At the same time, the differences in update frequencies of different documents require dialogue to obtain the latest maintenance records and ledger data in real time, to avoid generating compliance documents using expired information.
How to set the configurations
| Configuration Item | Recommended Setting | Rationale |
|---|---|---|
chatId | Unique session identifier, generated per business scenario | Isolates dialogue contexts across different users or scenarios, avoids request queuing and context confusion, and complies with FastGPT v4.17.0 session management rules |
messages | Retain the first 10 turns of dialogue, with each turn’s content not exceeding 800 characters | Balances context completeness and response speed, and adapts to the long-text content characteristics of refinery and chemical documents |
variables | Preset business variables such as equipment numbers and process sequences, calibrated via actual testing | Quickly locates exclusive documents for this category, reducing ineffective retrieval scope |
| Similarity threshold | 0.75–0.85 | Refinery and chemical documents have high requirements for parameter accuracy, avoiding irrelevant entries with low matching degrees from interfering with results |
| Single search limit | Top 6 entries | Valid matching entries for refinery and chemical related documents are concentrated; too many entries will increase context processing load |
| Maximum context | 4000 token | Adapts to the context storage requirements of multi-turn dialogue, avoiding exceeding the model’s context window limits |
Three common mistakes
- Phenomenon: When using a strict question-and-answer template to initiate a query, if the knowledge base contains image address entries, the interface returns "No answer found". Cause: The strict question-and-answer template only matches text-based knowledge base entries, and cannot parse structured content corresponding to image addresses.
- Phenomenon: Sending consecutive dialogue requests in a short period of time causes subsequent requests to fail to respond immediately. Cause: Different session contexts are not isolated via
chatId, resulting in requests queuing to wait for context resource release. - Phenomenon: The API returns "No permission to operate this conversation record". Cause: The legal permission scope of the session is not correctly associated, or the
chatIdparameter is not bound to a valid session identifier.
How to confirm the configuration is correct
- Initiate a single-turn dialogue request, enter a question related to refinery and chemical process parameters, and check whether the returned result matches the preset knowledge base entries.
- Send three consecutive questions targeting different refinery and chemical equipment, check whether
chatIdcan correctly retain the context information of each turn of dialogue, and realize logical association for continuous questioning. - Upload a refinery and chemical process flow diagram image to the knowledge base, initiate a query using a non-strict question-and-answer template, and check whether the image address or related parsed content can be returned correctly.
- Call the API with valid session permission parameters, and check that no permission error prompt is returned.
The values listed above are common starting points, and should be evaluated 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-28.