What the documents look like
Near-expiry markdown handling follows the shelf-stock lifecycle, which differs from per-item weighing and sorting. Store walkthroughs, POS stock-age data, ERP inventory, and quality-inspection records form the working papers, refreshed across daily and shift-level rhythms. Operating reviews and anomaly debriefs draw on near-expiry lists, markdown approvals, write-off forms, and promotional price tags. In these materials, batch identifiers, store identifiers, date ranges, approval status, and price-tag status often sit in separate fields, so a retrieval pass can surface one sentence while missing the surrounding context. The retrieval and recall step organizes these documents by knowledge base so that a review question can locate the specific source text, while any authorization state not stated in the source stays marked as pending verification.
Constraints at the retrieval step
A knowledge base consists of library, collection, and data. The smallest search unit is the library; collections only classify data and do not affect search results. Vectors are stored through the PostgresSQL PG Vector plugin with an HNSW index, while MongoDB's dataset.datas table holds the original data and an indexes field, so one data entry can map to multiple vectors. During retrieval, vectors are recalled first, then the original data is fetched from MongoDB by vector ID; entries mapping to the same original data are merged and the highest score is kept. A search node can associate one or more knowledge bases that use the same vector model; libraries with different vector models cannot be associated together. Hybrid retrieval merges multiple result paths through RRF, Rerank performs a second ordering, and the minimum relevance value applies only in semantic retrieval or when result reranking is used. The citation limit is measured in tokens. Question optimization handles coreference resolution and question expansion. Image retrieval requires image input and the corresponding model capability, and reranking requires a model and is enabled according to configuration. Retrieval itself does not perform authorization judgment.
Configuration and implementation checks
Hypothetical drill sample: the source text reads "March 10, 2026, Store A walkthrough record: batch A-0310, near-expiry list registered as pending markdown approval, markdown approval form not yet signed, promotional price tag not printed." The draft sentence to be assessed reads "Store A batch A-0310 completed markdown approval and went on promotion on March 10, 2026." This sentence turns pending approval into completed approval and is unsupported.
| Configuration item | Hypothetical trial starting point for this page | What it is compared against |
|---|---|---|
| Search mode | Run semantic retrieval and full-text retrieval once each | Compare how the two paths hit batch number A-0310 |
| Citation limit | Start with a relatively small value | Compare against the full paragraph length of the source text to see whether truncation occurs |
| Minimum relevance | Start with a middle value | Compare against manually labeled relevant and irrelevant samples |
| Question optimization | Start with it off | Compare against direct retrieval of the original question to see whether the subject is altered |
| Associated knowledge base | Associate only libraries using the same vector model | Check whether library identifiers and vector models match |
These values are hypothetical trial starting points for this page and do not come from official default values.
Three common errors
- Reading pending markdown approval as completed approval. Input is the source text "markdown approval form not yet signed," compared with the draft sentence "completed markdown approval." The observable result is that the two states do not match, and the draft sentence is unsupported.
- Treating a retrieval hit as authorization to proceed. Input is the near-expiry list fragment returned by retrieval, compared with whether downstream steps execute a markdown or shelf action based on it. The observable result is that retrieval produces no authorization and a separate approval system must be connected.
- Associating knowledge bases across different vector models. Input is two library identifiers with different vector models, compared with the node association requirement. The observable result is that joint association is not permitted; exclude the non-conforming library and record the actual observation.
How to verify the setup
- Use the sample source text "March 10, 2026, Store A walkthrough record: batch A-0310, near-expiry list registered as pending markdown approval, markdown approval form not yet signed, promotional price tag not printed" together with the draft sentence "Store A batch A-0310 completed markdown approval and went on promotion on March 10, 2026." Enter them into retrieval, compare whether the hit fragment contains "not yet signed," and observe whether the hit is present and the draft sentence is judged unsupported. The condition is satisfied when both hold.
- Use an empty citation input [] to check the downstream chain, compare whether the output chain still runs through, and observe whether the citation length is 0 while the chain continues. The condition is satisfied when both hold.
- Use two library identifiers with different vector models, compare against the node association condition, and observe whether cross-model retrieval is not executed and the identifier mismatch is recorded. The condition is satisfied when both hold.