What the documents look like
Supermarket supplier onboarding and settlement centres on four document families: procurement contracts, delivery acceptance notes, rebate agreements and statements of account. The data originates in ERP purchasing, supplier portals, POS sales and finance systems, and it refreshes weekly or monthly. The distinguishing feature of this category, compared with concession counters in large stores, is that settlement usually involves purchase-and-sale or consignment receivables, and the supplier does not necessarily operate on site. Cross-border material therefore commonly carries overseas entity names, foreign-currency amounts and multilingual clauses. Those traits shape vector model and index design directly. Multilingual clauses require a vector model with cross-language semantic matching, while precise fields such as contract numbers, acceptance note numbers and rebate percentages depend on full-text or hybrid retrieval.
Constraints at the vector indexes step
A knowledge base consists of libraries, collections and data. The smallest search unit is the library; collections only classify data and do not affect search results. FastGPT uses the PostgresSQL PG Vector plugin as its vector retriever, with HNSW as the index. PostgresSQL handles vector retrieval only and can be replaced by another engine, while MongoDB stores other data. In the MongoDB dataset.datas table, vector source data is stored alongside an indexes field that records the corresponding vector IDs as an array, so one data item can map to multiple vectors. Beyond the default text index, and where model capability allows, image content can also produce an image description index or an image vector index.
Knowledge bases associated for retrieval must share the same vector model. The actual model and input type need checking first, and libraries built on different vector models cannot be associated together. Image retrieval also depends on whether an image description or image vector was generated at ingestion time, so the query side alone is not sufficient. RRF is the fusion step that combines multiple result paths in hybrid retrieval, not a standalone switch. The retrieval step does not perform permission or entity isolation.
Hypothetical paper exercise sample: a supplier portal exports a statement of account whose source text reads: "Supplier: Northwind Foods Ltd.; reconciliation period: 1 March 2025 to 31 March 2025; settlement method: consignment; rebate percentage: calculated at 2% of tax-inclusive sales; return difference: acceptance note DN-0312 dated 12 March 2025 records a return of 120 units, amount pending finance confirmation." A draft sentence awaits judgement: "This supplier's March 2025 rebate has been settled in full at 2%." The subject, object and period needed for the judgement all appear in the source text, but whether settlement is complete is not stated there.
Configuration and implementation checks
| Configuration item | Hypothetical starting value for this exercise | Reason and comparison method |
|---|---|---|
| Vector model | One model supporting both Chinese and English | Multilingual clauses need cross-language semantic matching; compare recall of the same source text across models using one set of Chinese and English questions |
| Index type | HNSW | The documented PG Vector plugin index is HNSW; compare recalled content for the same query before and after enabling |
| Search mode | Hybrid retrieval | Contract numbers and natural-language questions coexist; compare semantic retrieval and full-text retrieval hit sets separately |
| Reference limit | Set to 3000 tokens as a hypothetical starting value for this exercise | Statement paragraphs are long; compare whether referenced source text covers key fields at different values |
| Minimum relevance | Set to 0.3 as a hypothetical starting value for this exercise | This value applies only in semantic retrieval or with result reranking; compare candidate content before and after filtering |
| Question optimisation | Enabled for multi-turn follow-up scenarios | Coreference resolution in continuous dialogue can improve recall; compare recalled source text for the same follow-up with it on and off |
Three common errors
- Extending the same-vector-model requirement for associated retrieval libraries into a claim that business registration sites or other external systems must also use the same model. The erroneous input is two knowledge bases with different vector models selected together; the comparison object is the model identifier actually registered for each library; the observable result is that when identifiers differ, joint association should not proceed, and the identifiers are recorded while non-matching libraries are excluded.
- Treating retrieval or form submission as authorised execution. The erroneous input is a rebate settlement request awaiting review; the comparison object is whether the source text states an approval status and authorisation scope; the observable result is that a pending-review status does not demonstrate absence of operating authority and does not equal approval, so it is recorded as pending verification.
- Treating image retrieval as necessarily executed on every request. The erroneous input is a plain-text question with no uploaded image; the comparison object is whether this request contains image input and whether model capability supports it; the observable result is that without image input, neither the image description path nor the image vector path runs, and recall proceeds on the text side only.
How to verify the setup
- Input the statement source text from the hypothetical sample together with the draft sentence "This supplier's March 2025 rebate has been settled in full at 2%". Compare "settled in full" in the draft against "amount pending finance confirmation" in the source text. The observable result is that the source text does not state settlement completion, so the draft sentence is unsupported and the evidence gap is recorded.
- Input the same set of Chinese and English questions, and compare the vector model identifiers registered for each knowledge base. The observable result is that joint association may proceed only when identifiers match; when they differ, non-matching libraries are excluded and the actual observation is recorded, without running cross-model retrieval to compare missed recall.
- Input one query with clearly no corresponding material and compare the returned reference content array. The observable result is that when the array length is 0, the downstream path still completes. This checks downstream design and does not assert that a fictional rule search always returns an empty array.