Code and Change Review Assistance for Delivery Effect Optimization: Context and Token

This document is compatible with FastGPT v4.17.0. Data for this category primarily comes from ad platform backends, attribution systems, CRM lead

What the data for this category looks like

This document is compatible with FastGPT v4.17.0. Data for this category primarily comes from ad platform backends, attribution systems, CRM lead databases, and landing page analytics tools. Update rhythms are mostly daily or real-time. Daily associated documents include ad delivery daily and weekly reports, daily adjustment records, asset AB test logs, and optimization review reports. Document fields typically include impressions, clicks, conversions, budget consumption amounts, and similar metrics. Units are usually counts, yuan, entries. Each ad campaign has independent data entries.

What constraints do these characteristics impose on the context and token workflow?

The update rhythm of multi-source real-time data requires context to cover recent adjustment and asset test results. Without this coverage, it cannot support abnormal indicator positioning and budget allocation. Document structures vary and are associated with multiple business fields. Context must match the format and core indicators of different documents. Token consumption increases with the number of documents and update frequency. Real-time updated data can cause context cache expiration. It is necessary to control the context time range and token limit to avoid exceeding model restrictions. At the same time, the core of delivery effect optimization is to associate multi-source data. Context must prioritize retaining segments of core indicators such as ad impressions, conversions, and budget consumption. Invalid content occupying tokens can reduce the accuracy of core analysis.

How to configure settings

Configuration ItemRecommended ValueRationale
maxContext12000–15000 tokenMatches total token consumption of multi-source delivery optimization data, covers core business content of daily adjustment records, asset AB test logs, and optimization review reports
quoteMaxToken1800–2200 tokenPrioritizes retaining context segments of core delivery indicators such as ad impressions, conversions, and budget consumption, avoids irrelevant business content occupying token resources
Maximum context refresh interval1 hourAdapts to daily and real-time data update rhythms, prevents context from being disconnected from current delivery data due to cache expiration
Associated document filtering thresholdTop 3 entriesMatches average number of daily documents, focuses on latest adjustment and asset test records, reduces token consumption from non-core content
Context filtering ruleRetain only data from the past 7 daysAligns with standard time ranges for delivery optimization reviews, filters expired data to reduce total token usage

Three common configuration mistakes

  • Phenomenon: Answer mismatches occur in subsequent questions when calling the API for continuous questioning. Cause: The maxContext parameter is not configured correctly, and the associated context between historical conversations and current questions is not included in the token range.
  • Phenomenon: Context settings are enabled in the workflow, but context cannot be retained during API calls. Cause: No associated identifier for historical context is carried in the API request, or the context configuration of the corresponding knowledge base is not bound.
  • Phenomenon: Context segments are truncated or missing core indicators after loading. Cause: The quoteMaxToken parameter is set too small, causing core ad data segments to be truncated.

How to verify correct configuration

Submit a test question that includes historical adjustment records and current delivery issues. Verify whether the reply associates historical data with the logic of the current question. Review API request logs, confirm that the request parameters include the configured values for maxContext and quoteMaxToken, and that the values meet preset standards. Submit more than 3 consecutive related questions. Verify that each reply consistently associates delivery-related historical data without answer mismatches. Compare the total context token count with the configured maxContext value, ensure it does not exceed the model's token limit.

The values provided are common starting points and should be evaluated against local 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.