Regional dealer stock: retrieval for document comparison

Review retrieval for document comparison in Regional dealer stock. Check document scope, failure paths and source evidence through controlled tests.

What the documents look like

Regional dealer stock replenishment runs on everyday rolling orders. Replenishment requests, inventory turnover tables, outbound notes and payment collection plans are updated weekly or monthly, and the same dealer's request, outbound note and collection plan need to line up document by document and period by period on their field definitions. For contract and transaction material comparison, retrieval results must be able to locate the subject, object, period and status of a specific document. A retrieval score does not carry authorization weight.

Contract and transaction material comparison covers four document types in this category: replenishment requests, inventory turnover tables, outbound notes and payment collection plans. The comparison task needs the material text itself, because approval status on a replenishment request, whether an outbound note has been executed, and whether a collection plan has been received all have to be checked against the retrieved source text.

Hypothetical paper exercise sample: a regional dealer submits a replenishment request whose source text reads "Applicant: East China sample dealer; replenishment object: Model A, 200 units; request period: March 2025; status is awaiting review by the brand channel manager." A separate outbound note reads "Outbound object: Model A, 200 units; outbound date: 18 March 2025; status: outbound completed." The draft sentence to be checked is "This replenishment request completed outbound in March 2025." The comparison conclusion is that the request is awaiting review, the outbound note shows outbound completed, the subject and object match, and the completion status asserted by the draft sentence is not supported and remains to be verified.

Constraints at the retrieval step

The knowledge base search node can associate one or more knowledge bases that use the same vector model. Retrieval recalls by semantic, full-text or hybrid mode; hybrid retrieval merges multiple result paths through RRF, and the ReRank model reorders candidate text. Minimum relevance takes effect only in semantic retrieval or when result reordering is used. The citation limit is measured in tokens. Retrieval returns only cited content, whose length can be 0, and the empty-result path still runs through. Retrieval does not constitute authorization and does not perform entity isolation.

Full-text retrieval behaves differently by vector store. When the vector store is Milvus (version 2.5.16 or above), full-text retrieval uses Milvus BM25, with vectors and full text stored together in the single table modeldata_v2, and language identification defaults to lingua, switchable to whatlang through MILVUS_LANGUAGE_IDENTIFIER. Other vector stores (PG, OceanBase, SeekDB, openGauss) route full-text retrieval through MongoDB $text with jieba tokenization. Vector storage uses the PG Vector extension of PostgresSQL with an HNSW index; PostgresSQL serves vector retrieval only, while MongoDB stores other data. In the dataset.datas table of MongoDB, an indexes field records the corresponding vector IDs as an array, so one group of data can map to multiple vectors. The smallest search unit is the knowledge base; collections only classify data and do not affect search results.

Question optimization performs coreference resolution and question expansion before retrieval. It adds one model call before formal retrieval, which usually improves retrieval in continuous dialogue and also adds overall latency. Image retrieval requires an image input and matching model capability: image description retrieval needs a usable vision model, and image vector retrieval needs a vector model that supports image input. Whether an image can be retrieved also depends on whether a corresponding index was built at ingestion time. RRF is a fusion process for hybrid results, not a switch. The optional paths in the overall flow diagram do not all execute on every request.

Configuration and implementation checks

Configuration itemSetting or check on this pageExplanation
Associated knowledge basesAssociate only replenishment material bases using the same vector modelCross-model bases cannot be associated together; verify identifiers first and exclude non-matching ones
Search modeTest semantic retrieval and full-text retrieval separatelyUse full text for numbers and model codes, semantic for natural language questions
Citation limitSet 3000 tokens as the starting point for this hypothetical exerciseCompare content completeness using replenishment requests and outbound notes of different lengths
Minimum relevanceLabel relevant and irrelevant samples before adjusting the thresholdTakes effect only in semantic retrieval or with result reordering
Question optimizationCompare the original question with the optimized questionCheck whether the subject was altered; enable in short-question scenarios
Result reorderingAvailable when a model exists and is enabled by configurationThe reordering score is used for filtering, not as a basis for authorization

The 3000-token starting point is chosen for this hypothetical exercise so that a short replenishment request and a longer outbound note can both be compared for content completeness; it is not an official default. Adjust it after comparing returned content against the source documents.

Three common errors

  1. Treating a retrieval score as a permission or entity filter, on the assumption that a high similarity means the dealer is entitled to view that document. Retrieval returns cited content only; authorization requires checking the subject and status in the source material separately.
  2. Writing an awaiting-review replenishment request as outbound completed. Awaiting review does not demonstrate a lack of operating authority. Signing, reaching cooperation and contract effectiveness are three distinct facts.
  3. Associating knowledge bases with different vector models and then inferring missed recalls or redundant returns. Cross-model bases cannot be associated together; verify identifiers, exclude non-matching ones and record actual observations.

How to verify the setup

  1. Input the replenishment request source text from the hypothetical sample and the draft sentence to be checked. Compare the request status field "awaiting review by the brand channel manager" with the draft sentence "completed outbound." The condition is met when the retrieval result returns that request source text and does not rewrite awaiting review as completed.
  2. Input the outbound note source text and the same draft sentence. Compare whether the outbound date and the request period both fall in March 2025. The condition is met when the retrieval result returns both materials and preserves their respective status fields without merging them into a single conclusion.
  3. Input a short question lacking a subject and period. Compare the retrieval terms before and after question optimization. The condition is met when the optimized question supplies the subject and does not introduce authorization or effectiveness clauses absent from the source. If retrieval returns an empty array, check the downstream design against the empty-result path using an explicit paper input of []; do not claim that a fictional rule necessarily returns an empty array.