Bid Document and Quotation Preparation for Petroleum Refining: Multi-turn Dialogue and Prompt Engineering

Data sources for petroleum refining business cover DCS/APC control systems, LIMS laboratory information management systems, tank farm metering

What Data for This Category Looks Like

Data sources for petroleum refining business cover DCS/APC control systems, LIMS laboratory information management systems, tank farm metering systems, crude oil evaluation databases, equipment management systems, and energy management systems. Data update frequencies include real-time process parameters, shift handover records, daily production plans, and material balance reports. Daily documents include operating procedures, equipment interlock logs, distillate quality reports, change management documents, and more. These documents serve the usage needs of production operations, process, scheduling and other departments. Fields include parameters with clear units such as crude oil density, unit load, product distillation range, and tank farm liquid level.

Constraints Imposed on Multi-turn Dialogue and Prompt Engineering

Dispersed data sources and varied update rhythms require multi-turn dialogue to distinguish between real-time process parameters and historical archived log documents, to avoid mixing data of different cycles. Structural differences across multiple document types require prompt engineering to adapt to extraction rules for different fields. For example, different guiding logic is needed to extract density parameters from crude oil evaluation reports versus equipment numbers from interlock logs. The business characteristic of multiple units being coupled through logistics and energy networks requires dialogue context to continuously track material flow relationships between units, ensuring accurate load coordination and cost accounting in bid quotations. Daily updated production plans and change documents require the effective period of dialogue context to match the business update frequency, avoiding the use of expired data to generate bid content.

Configuration Settings

This configuration is based on FastGPT v4.17.0.

Configuration ItemRecommended SettingRationale
Maximum context length8000–12000 tokenAdapts to the total length of spliced refinery business documents, avoiding exceeding model input limits
Number of retained historical messagesFirst 20 conversation turnsMatches the update cycle of shift handover records, filtering redundant history to avoid interfering with current bid calculations
variables bindingBind real-time process parameters and tank farm metering fieldsEnsures that dynamic data such as latest crude oil properties and unit loads can be called during multi-turn dialogue
messages context filteringRetain only interaction records from the last 72 hoursMatches the effective period of daily updated production plans and change management documents
Attachment upload timeout120 secondsAdapts to the upload requirements of large files such as crude oil evaluation reports and interlock logs
Conversation reply formatEnforce JSON structureFacilitates automatic extraction of key parameters and cost data by bid quotation systems

Three Common Configuration Errors

  • Extra conversation history entry | Fixed session binding not correctly implemented using the chatId parameter. Independent context is generated for each API call, leading to repeated accumulation of historical records.
  • Conversation replies fail to return the required JSON format | Prompt engineering does not clearly specify field requirements for the JSON structure, or mandatory format validation is not enabled in the configuration, causing reply formats that do not comply with business system extraction rules.
  • Attachment upload prompt fail to create post presigned url | After upgrading from version 4.13.0 to 4.14.3, permission parameters for attachment storage were not reconfigured, or uploaded files such as crude oil evaluation reports exceed the current allowed size range.

How to Verify Successful Configuration

  • Initiate two consecutive API calls, check that the number of historical records returned by the messages parameter complies with the set retention rules, with no extra accumulated conversation content.
  • Upload a simulated crude oil evaluation report, confirm that there are no errors during attachment upload, and that parameters from the report can be correctly referenced in subsequent conversations.
  • Send an instruction requiring a JSON format reply, verify that the reply content conforms to the specified field structure and can be automatically parsed by the business system.
  • Click the like button on a conversation reply, check that the business system receives the corresponding feedback data and completes record synchronization.

The values provided here are common starting points, and should be evaluated against the reader's own samples.