What the data for this use case looks like
Daily documents for campaign setup include structured content such as campaign plans, targeting settings, budget scheduling, and conversion tracking configuration. Fields include targeting tags, budget amounts, conversion event IDs, and more. Units include yuan, impressions, and days. Data sources include advertising platform APIs, internal budget sheets, user behavior profile databases, and attribution statistics tools. Updates occur daily or are triggered alongside campaign activities. Most data is structured configuration information, with no unstructured free text content.
Constraints on context and token handling
The multi-source data characteristics of campaign setup require context recall to associate configuration fragments from different sources, increasing required context window length. High update frequency means context recall must synchronize the latest configurations promptly to avoid expired data. Structured configuration fields require context to accurately match core configuration items. Additionally, campaign plan change reviews require association with historical versions, further increasing token consumption pressure. Reasonable allocation of context and token resources is needed.
Configuration settings
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
maxContext | 8000–12000 token | Covers the total length of multi-source campaign plan documents, including historical change records, current budget scheduling, targeting configuration, and other related content |
quoteMaxToken | 1500–2000 token | Prioritizes retaining context fragments of core campaign plan configuration fields, such as budget thresholds, targeting tags, and conversion event IDs |
| Context recall trigger interval | Every 12 hours | Aligns with the daily update rhythm of campaign plans, ensuring recalled data matches the latest configurations |
| Context matching threshold | Calibrated via actual testing | Matches structured campaign plan fields, preventing recall of irrelevant historical change records |
| Workflow context cache duration | 72 hours | Covers the full review cycle of a single campaign activity, supporting context association for follow-up questions |
This configuration guide applies to FastGPT v4.17.0.
Three common configuration mistakes
- Phenomenon: When calling the FastGPT workflow API, the second consecutive question is off-topic and cannot associate previous campaign plan configurations. Cause: The
maxContextparameter is not configured in the workflow, or the context cache duration is set too short, leading to incorrect context retention. - Phenomenon: The number of campaign plan documents retrieved by the knowledge base exceeds expectations, with a large number of irrelevant historical change records. Cause: No reasonable context matching threshold is set, resulting in retrieval of old version data outside the current review scope.
- Phenomenon: A single change review request triggers a token limit exceeded error. Cause: The value of
quoteMaxTokenis not restricted, causing core configuration fragments to occupy too many tokens and squeezing the token space for question processing.
How to verify correct configuration
- Submit three consecutive review requests for the same campaign plan, and check whether the returned results associate previous configuration information such as targeting and budget details.
- View FastGPT workflow logs to confirm that the context cache update frequency matches the set trigger interval.
- Test campaign plan documents of varying lengths, check for token limit exceeded errors, and adjust configuration item values to meet business requirements.
- Verify the number of retrieved documents, confirm it matches the set number of retrieved documents, with no redundant data.
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.