What the documents look like
Order fulfilment and after-sales answering in supermarket checkout and membership promotion draws on the POS system, the membership CRM, payment platforms and the price-tag system. The documents handled day to day are promotional price tags, membership points rules, checkout daily reports and exception refund slips. This category centres on prices and membership entitlements, and it does not handle short-shelf-life stock. The consequences of error concentrate in price complaints, cash and account shortfalls or overages, and membership entitlement disputes. Material updates run on a daily or per-shift rhythm, so a retrieval check has to be tied to a specific date and shift range. A price tag for one day is not a long-term rule.
A hypothetical paper exercise sample is used below for illustration only. The material text supplied for checking reads: "From 1 March 2025 to 7 March 2025, members of this store buying Brand A milk receive the member price of 49.9 yuan per case; from 8 March the original price of 59.9 yuan per case resumes. Membership points accrue at 1 point per yuan of amount actually paid." A handover request awaiting a decision reads: "Please refund the 10 March return slip at the member price of 49.9 yuan and restore the corresponding points." The date in that request falls after the original price resumed, and the material does not state the rule for refunds and points reversal on returns.
Constraints at the retrieval step
In FastGPT the knowledge base consists of library, collection and data. The smallest search unit is the library; a search runs across the whole library, and collections serve only to classify and manage data, with no effect on search results. The knowledge bases associated with a search must use the same vector model. Libraries using different vector models cannot be associated together; the identifier must be checked first and non-matching libraries excluded.
FastGPT uses the PostgresSQL PG Vector plugin as the vector retriever, with an HNSW index. PostgresSQL is used only for vector retrieval, and MongoDB holds other data. In the MongoDB dataset.datas table the original vector data is stored, together with an indexes field recording the corresponding vector IDs as an array, so one group of data can map to several vectors. At retrieval time vectors are recalled first, then the original content is looked up in MongoDB by vector ID; entries corresponding to the same original data are merged and the vector score takes the highest value.
A single retrieval is not simply user question to vector store to returned result. Depending on the input and the search parameters, FastGPT combines text, images, semantic recall, full-text recall, question optimisation and reranking, then fuses the multiple result paths into reference content. Hybrid search uses the RRF formula to merge the two search results; because the scope after hybrid search is large and similarity filtering cannot be applied directly, a rerank model is usually needed to reorder once and to filter using the rerank score. The ReRank model produces a score from 0 to 1 representing the relevance of the searched content to the question. The minimum relevance value takes effect only in semantic search or when result reranking is used; it is a filtering threshold, not the final ordering rule. The reference content is output as an array and its length may be 0, meaning that even when nothing is found the output path still completes. Retrieval and similarity scores do not carry permission or entity isolation.
Configuration and implementation checks
| Configuration item | Hypothetical starting point for this exercise | Reason for the choice and comparison method |
|---|---|---|
| Associated knowledge bases | Associate only libraries holding promotional price tags and membership points rules that share one vector model | Check each library's vector model identifier first, exclude those with a different model, and do not run cross-model retrieval |
| Search mode | Test semantic search and full-text search separately on the same question | Compare how the two modes recall dates and amounts; do not presume one mode suits all material |
| Reference cap | Set to a token amount covering one complete price-tag clause | Test with actual material of differing length to see whether content stays complete, then adjust the cap |
| Minimum relevance | Label relevant and irrelevant samples first, then tune the threshold | The value takes effect only in semantic search or with result reranking; compare candidates before and after filtering |
| Question optimisation | Enable for follow-up questions containing "it" or "this price" | Compare the original question with the optimised one and check whether subject and date were altered |
| Result reranking | Enable when candidates are numerous and the question has a complete subject and predicate | Compare the 0-1 score ordering before and after reranking, and confirm the ReRank model is available |
Three common errors
- Treating a retrieval hit as authorisation. Given the input "refund the 10 March return slip at 49.9 yuan", retrieval may recall the member-price clause for 1 to 7 March, but that clause's effective range has ended. The retrieval result does not constitute a refund authorisation; the date range and whether a returns rule exists must be checked.
- Associating libraries that use different vector models. When two libraries with different vector models are associated together, no inference about missed recall or redundancy follows. The identifiers must be checked first, non-matching libraries excluded, and the actual observation recorded.
- Treating minimum relevance as a permission filter. Given the input "check membership points exceptions at other stores", a high similarity score does not mean the setting excludes unauthorised records. Permission has to be implemented by a downstream system.
How to verify the setup
- Enter the hypothetical material text above and the request awaiting a decision. Compare the request date of 10 March with the material's effective range of 1 to 7 March, and observe whether retrieval recalls that price-tag clause and whether the clause states a returns refund and points reversal rule. When the clause does not state a returns rule, the conclusion is unsupported and the evidence gap is retained.
- Enter "how much does Brand A milk cost for members on 5 March". Compare whether the recalled content contains subject, object, date and amount, and observe whether the reference content array is non-empty with consistent fields. A first-item hit or complete recall cannot be guaranteed.
- Enter an explicit paper input of an empty array []. Check whether the downstream design completes the output path, and observe whether the empty reference is treated as any conclusion other than "no such rule". A search for a fabricated rule is not guaranteed to return []; the actual observation and the failure branch must be recorded.