What the documents look like
General trade export declaration work handles an export declaration form, a commercial invoice, a packing list and a contract for every shipment. Data comes from the China International Trade Single Window, the customs code library, freight forwarder bills of lading and the company ERP. Compared with general trade import declaration, export declaration also affects the matching of export tax rebate vouchers, so the parties, amounts, commodity codes and dates across these documents need to point back to each other. A parsing or chunking error can lead to document return and inspection, declaration discrepancies and blocked tax rebates. Materials update per shipment, and parsing and index status need to be checked shipment by shipment.
Export declaration materials commonly carry Chinese and English fields, commodity codes, freight and insurance amounts and trade terms. Segmentation needs to keep the relationship between a condition and the content it constrains. One original data group can map to several vector indexes, and the vector score takes the highest score, so a packing list detail line split into several segments can still be cited when any one segment is recalled. Semantic retrieval relies on vector distance and suits natural language questions. Full-text retrieval relies on keyword hits and suits numbers, models and proper nouns. Hybrid retrieval merges the two paths through RRF, and reranking requires a model and must be enabled by configuration. Image retrieval requires a corresponding image input and model capability. The optional paths shown in the overall document flow diagram do not mean every request executes all of them. The same vector model requirement for a retrieval library does not extend to business registration sites or other external systems.
Hypothetical paper exercise sample: the source material for checking reads "Seller: a machinery company in East China; Buyer: an overseas trading company; Invoice No.: EXP-2024-001; Commodity: vertical machining center; Quantity: 2 units; Total price: USD 120,000; Trade term: FOB Shanghai; Invoice date: March 1, 2024." A separate drafting handover request reads: "Based on the above invoice, fill the commodity code field of the declaration form with 8477100000 and complete the declaration by March 5, 2024." This request involves a party, an object, a date scope and an authorization boundary, while the source material states no commodity code and no declaration authorization.
Constraints at the document chunking step
The sample above sets the working boundary for this page. The invoice number, commodity name, quantity, total price, trade term and invoice date are present in the source material. The commodity code 8477100000 and the declaration completion request appear only in the drafting handover request. A retrieval result that returns the code cannot serve as evidence that the code is correct, because the source material does not carry it. The declaration completion action belongs to a downstream business process, and neither a retrieval result nor a filled form constitutes declaration authorization.
Chunking decisions follow the structure of each document. A condition, an explanation and the content it constrains stay together. A packing list detail line may become several segments, and the original data group remains recallable through any one of its indexes. Semantic retrieval, full-text retrieval and hybrid retrieval each return candidates, and RRF merges them. Reranking produces a score between 0 and 1 and requires a model. The minimum relevance value applies only in semantic retrieval or when reranking is used, and it functions as a filter threshold rather than a final ordering rule. The citation limit caps the tokens cited per search. Image indexing depends on whether an image description or image vector index was generated at ingestion.
Configuration and implementation checks
| Configuration item | Hypothetical starting point for this exercise | Reason and comparison method |
|---|---|---|
| Search mode | Hybrid retrieval | Invoice number and commodity name coexist, so semantic recall and full-text recall both need coverage |
| Citation limit | Hypothetical starting point of 3000 tokens | One invoice plus packing list segments total roughly this amount; compare with the actual cited amount of the previous shipment before adjusting |
| Minimum relevance | Hypothetical starting point of 0.5 | Applies only in semantic retrieval or reranking; compare with manual checking results for the same batch of documents |
| Question optimization | Enabled for multi-turn follow-up scenarios | Coreference resolution and question expansion add one model call; compare elapsed time with a single clear question |
| Reranking | Enabled when a model is available | Rerank score ranges from 0 to 1; compare relevance against candidate order without reranking |
| Image index | Check ingestion index when the packing list contains images | Confirm whether an image description or image vector index was generated at ingestion |
Three common errors
- Treating a successful upload as an updated retrieval state. After upload, check the actual training and index status, compare whether retrieval results for the same invoice number are consistent before and after the update, and observe whether the new segment can be recalled.
- Treating retrieval or a form as authorized execution. The "complete the declaration" wording in the drafting handover request describes a business action. A retrieval result and a filled form do not constitute declaration authorization, and a separate system implementation with authorization evidence is required.
- Associating libraries that use different vector models. Check the identifiers first, exclude those that do not match, and record the actual observation. Do not run cross-model retrieval to compare missed recalls.
How to verify the setup
- Enter the invoice number "EXP-2024-001" from the hypothetical sample into full-text retrieval and compare whether the returned segments contain that number and the corresponding commodity name. If the result is empty, record it as a miss and check the training status.
- Enter "8477100000" from the drafting handover request into semantic retrieval and compare whether the returned segments contain that code and the invoice party it constrains. The source material does not state this code, so the returned result cannot serve as a basis for the code being correct.
- Enter "FOB Shanghai" from the hypothetical sample into hybrid retrieval and compare whether the cited content after RRF merging covers both the trade term and the invoice date. If only the term is hit and the date is missing, record a segmentation completeness gap and check the chunk boundaries.