Quality Problem Traceability and Defect Analysis for Heat Treatment: Multi-turn Dialogue and Prompt Engineering

Data sources for heat treatment scenarios include material grades, customer technical requirements, temperature control instruments, furnace

What this category of data looks like

Data sources for heat treatment scenarios include material grades, customer technical requirements, temperature control instruments, furnace temperature uniformity testing equipment, hardness testers and metallographic equipment, and MES systems. Updates are performed per furnace charge and per batch. Daily documents cover heat treatment process cards, charging charts, furnace temperature curves, hardness and metallographic reports, equipment inspection forms, and exception handling sheets. Data fields include material grades, furnace temperature parameters, holding duration, hardness values, metallographic structure types, and similar items. Units involve temperature, duration, hardness levels, and other relevant categories.

Data is updated per furnace charge and batch. Multi-turn dialogue must bind a unique furnace batch ID to avoid mixing data across batches. Document types include charts and structured reports. Prompt engineering must guide recognition of text fields associated with charts. Defect analysis must link non-text data such as charging positions and furnace temperature curves. Multi-source data comes from equipment, MES systems, and customer requirements. Multi-turn dialogue must gradually align parameters from different sources to prevent data conflicts.

How to set the configurations

These configurations are based on FastGPT v4.17.0.

Configuration ItemRecommended ValueRationale
Chunk length800–1200 charactersAdapts to the text structure of heat treatment process cards and furnace temperature curves, avoiding splitting that disrupts parameter integrity
Overlap length150–200 charactersRetains cross-block associated information such as furnace numbers and batch IDs, ensuring data traceability continuity for multi-turn dialogue
Single search limitTop 6–10 entriesCovers multiple document types for a single furnace charge, ensuring full relevant data can be retrieved for defect analysis
Maximum context5000–7000 tokensAccommodates full document fragments for a single furnace charge and multi-turn dialogue history, avoiding context truncation
variables bindingBind furnace batch ID and equipment numberEnsures the dialogue only calls heat treatment data for the current batch, isolating interfering information across batches
Prompt optimizationCalibrate based on actual measurementsAdapts to heat treatment terminology, optimizing the question guidance logic for defect analysis

Three common mistakes

  • Symptom: The conversation details page only displays simplified question-and-answer content, and the application’s detailed internal processing steps cannot be viewed. Cause: The complete messages log storage configuration is not enabled, and only final interaction results are cached.
  • Symptom: After local deployment, when knowledge base files are uploaded, the data processing section displays empty content. Cause: The chunk length setting exceeds the document parsing adaptation range, or the variables-bound furnace batch parameters are not correctly bound, resulting in data failing to be associated and stored.
  • Symptom: Conversation history records cannot be queried in the MongoDB database. Cause: The chatId generation logic is incorrect or the storage path configuration is improper, resulting in conversation data not being written to the specified collection.

How to confirm the configuration is correct

  • Upload heat treatment process cards and furnace temperature curves for a single furnace charge. Initiate a dialogue to inquire about process parameters for the current batch. Verify returned results include complete fields from corresponding documents.
  • Initiate two consecutive dialogues. First ask for furnace temperature data, then ask for hardness test results. Verify both dialogues’ context associates with current furnace batch information.
  • View the application’s log module. Confirm variables-bound furnace batch parameters and chatId are correctly written to session storage.
  • Simulate an exception scenario to initiate a dialogue. Verify the system triggers defect analysis guidance logic without parameter mismatch errors.

The values provided are common starting points and should be evaluated against corresponding local samples.