Code and Change Review Assistance for Data Cleaning and Quality Inspection: Context and Token

Daily documents for data cleaning and quality inspection include cleaning rules, quality inspection sampling sheets, anomaly data lists, and delivery

What this type of data looks like

Daily documents for data cleaning and quality inspection include cleaning rules, quality inspection sampling sheets, anomaly data lists, and delivery reports. Cleaning rules are text files with field validation logic. Quality inspection sampling sheets include sampling batch numbers, data entry counts, and anomaly flag fields. Anomaly data lists record anomaly types and their corresponding original data IDs. Delivery reports include quality inspection pass rates and anomaly proportions. Data sources cover raw datasets, ETL logs, exported results from annotation platforms, and sampling results. Update frequency is daily or per data delivery batch.

Daily documents are mostly structured text and list-style data. Context must link cleaning rules, sampling results, and anomaly data from the same batch. This avoids cross-batch context contamination. Data sources are dispersed, leading to diverse context fragment sources. The batch range of context must be limited. This prevents mixing content from non-current processing datasets. Data updates occur daily or per batch. Context must be isolated per batch. This avoids confusing cross-batch ETL logs and sampling results. Anomaly data lists have many entries. Token consumption must be controlled. This prevents content truncation when exceeding model context limits, which disrupts correct parsing of cleaning rules and quality inspection logic.

Configuration guidelines

These configurations apply to FastGPT v4.17.0.

Configuration ItemRecommended ValueRationale
maxContext10–20 entriesContext for data cleaning and quality inspection must be isolated per batch. 10–20 entries can cover cleaning rules, sampling results, and anomaly data for a single batch, avoiding cross-batch contamination
quoteMaxToken8000–12000 tokenTotal token count for anomaly data lists and ETL log fragments from a single batch typically falls within this range, allowing full loading of core context without exceeding model limits
Context batch isolation switchEnabledData updates daily or per batch. Enabling this automatically filters non-current batch context content to avoid contamination
Maximum context retention duration24 hoursData updates daily or per batch. 24 hours covers all associated documents for a single day or batch, preventing expired context from interfering
Context trigger thresholdCalibrated via actual testingData volume varies widely between batches. Adjust based on token consumption of actual single-batch data to ensure complete context without exceeding limits

Three common configuration mistakes

  • Symptom: Relative paths of uploaded files include tokens, and a 404 error is returned when submitting via HTTP request to Flask for processing. Cause: The relative path generated by FastGPT includes a token parameter. Directly concatenating the request causes path parsing errors. The token must be stripped before concatenating the file path.
  • Symptom: The number of context entries is set to 30, but only 2 context entries are displayed in conversation details, and replies cannot link to context. Cause: The batch isolation switch is not enabled, so context is overwritten by non-current batch content, or configured context filtering rules do not take effect correctly.
  • Symptom: The AI reply contains improperly formatted JSON content, or anomaly data recognition results are chaotic. Cause: Context token count exceeds model limits, leading to truncation of some cleaning rules or anomaly data lists, preventing the model from correctly parsing context logic.

How to confirm configurations are correct

  • View FastGPT context logs to confirm only current batch cleaning rules, sampling results, and anomaly data are displayed, with no cross-batch unrelated content.
  • Submit test batch data, verify that the AI's returned anomaly data recognition results match the local anomaly data list, with no missing or extraneous entries.
  • Adjust the quoteMaxToken parameter, observe context loading status, and confirm no context truncation or token limit exceeded errors occur.
  • Test data submission for different batches, confirm that context does not link across batches, and processing results for different batches do not interfere with each other.

The values provided 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-10-19.