What the data for this category looks like
Data for this category comes primarily from domestic commodity futures exchanges and industry spot trade databases. Futures data updates in real time during trading hours, and once per day during a fixed window on non-trading days. Spot data updates once per day after market close.
Data is stored in structured format, with each record corresponding to market data for a single variety and single delivery month. Fields include variety name, delivery month, latest price, settlement price, price change amount, position volume, and trading volume. Price units are yuan/ton, while trading and position volume units are lots.
What constraints do these data characteristics impose on deployment and upgrade
These data characteristics create three core constraints for deployment and upgrade:
- Real-time market data requires configuring high-frequency pull or real-time push tasks during deployment. Avoid low-frequency scheduled synchronization logic, as this will cause data lag.
- The structured format with multiple fields including delivery month requires strict adherence to field mapping rules during knowledge base import. This prevents broadcast content errors caused by field misalignment.
- Minor differences in update rhythms across varieties require adjusting synchronization cycle configurations for corresponding varieties during upgrades. This ensures data timeliness and accuracy.
How to set configurations
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
DATA_SYNC_INTERVAL | 5 minutes (futures varieties), 24 hours (spot varieties) | Matches the update rhythm of this category: futures data updates in real time, spot data updates daily |
FIELD_MAPPING_RULES | Map in the order of variety name, delivery month, latest price, settlement price, price change amount, position volume, trading volume | Matches the structured field order of the data source to avoid parsing misalignment |
RECALL_TOP_K | Top 10 entries | Covers most mainstream contracts and popular spot varieties that users pay attention to |
RECALL_DUPLICATE_FILTER | Enable and set to deduplicate for the same variety and delivery month | Avoids repeated recall of the same market data, optimizes broadcast content conciseness |
VECTOR_DB_REFRESH_THRESHOLD | 100 new data entries | Balances data timeliness and vector database write performance |
PARSE_FILE_TIMEOUT_SECONDS | 300 seconds | Structured data documents are usually small in size, this duration covers bulk import scenarios |
MAX_RESPONSE_LENGTH | 800–1200 characters | Yield rate broadcast content needs to be concise and clear, avoids exceeding display limits |
The parameter values provided on this page are common starting points for configuration. Actual values are affected by material form, data volume and business rules. Specific issues require case-by-case analysis, and it is recommended to test on your own samples before finalizing.
Three common configuration mistakes
- Symptom: The yield rate broadcast interface returns duplicate market content twice, with duplicate
rag_retrievelog entries in the logs. Cause: TheRECALL_DUPLICATE_FILTERparameter is not configured, leading to repeated recall of market data for the same delivery month of the same variety. - Symptom: A
parse_field_errorerror occurs after importing market data documents, with some fields empty. Cause: When using version V4.8.10-fix2, structured data parsing mode is not enabled, resulting in incomplete mapping of multi-field market data documents. - Symptom: The broadcast page fails to load normally on the browser side, with the console showing
CORS_BLOCKEDstatus code. Cause: The platform's cross-origin whitelist is not configured, restricting access permissions for the specified browser domain.
How to confirm the configuration is correct
- Run a manual synchronization task, check if all configured fields are included in the synchronization logs, and verify that the field mapping matches the data source.
- Initiate a yield rate broadcast request, check the field completeness and unit matching of the returned content, and adjust the corresponding parameters until the content display meets expectations.
- Simulate synchronization cycles for different varieties, verify that the update interval of futures variety data meets real-time requirements, and the update interval of spot variety data meets daily update requirements.
- Check the cross-origin configuration page, confirm that the required access domains have been added, to avoid cross-origin related errors.
Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-09-14.