Quality Problem Traceability and Defect Analysis for Cosmetics Manufacturing: Knowledge Base Retrieval and Recall

The data for this category comes from multiple types of business documents of skincare, haircare, makeup, and special cosmetics manufacturing

What the data for this category looks like

The data for this category comes from multiple types of business documents of skincare, haircare, makeup, and special cosmetics manufacturing enterprises, including formula process sheets, weighing and feeding records, emulsification and filling records, cleaning and site clearance records, semi-finished and finished product inspection reports, and label review documents. Data sources include registered and filed formulas, raw material safety materials, production equipment logs, ERP/MES systems, laboratory data, and packaging material version archives. Updates are made per production batch or each line change. Document fields include raw material names, restricted substance content, production parameters, batch numbers, packaging material models, and other fields. Core fields are strongly bound to production compliance processes.

Documents in this category are updated according to production batches and line change operations. A single quality traceability requires associating formula, inspection, and record data across multiple batches, and requires precise matching of batch numbers, raw materials, and filing compliance information. Frequently updated production data requires the retrieval system to support real-time or near-real-time synchronization to avoid retrieving expired data. Most document content involves compliance requirements, and strict matching of registered and filed information is required to avoid recall risks that do not meet compliance requirements. High-concurrency production traceability queries will generate a large number of retrieval requests, and token consumption for single-batch retrieval must be controlled to avoid exceeding the model's processing limits.

How to set the configurations

The following configurations are adapted for FastGPT v4.17.0.

Configuration ItemRecommended SettingRationale
similarity0.75–0.85Matches the precise compliance requirements for formulas and filing information in cosmetics manufacturing, and avoids retrieving irrelevant documents with low similarity
limitTop 8 entriesBalances the amount of retrieved information and model processing load, and aligns with the typical volume of documents for single-batch production data
usingReRankEnabledFor multi-dimensional production parameters and compliance fields, re-ranking improves the sorting priority of highly relevant documents
datasetSearchUsingExtensionQueryEnabledAutomatically expands the retrieval semantics of fields such as batch numbers and raw material names to match associated information in production records
searchModeembeddingAdapts to the semantic association requirements of matching formulas and inspection results in cosmetics manufacturing
collectionIdsKnowledge base collection IDs divided by production batchLimits the retrieval scope, avoids interference from irrelevant data across batches, and improves retrieval accuracy

Three common errors

  • Phenomenon: A fixed 50,000 token retrieval reference limit is set for single-batch retrieval, resulting in excessively high query latency. Cause: The token threshold is not dynamically adjusted based on the actual number of retrieved documents, and a large fixed token limit exceeds the model's actual processing capacity.
  • Phenomenon: Semantic retrieval returns multiple matching documents, but the model replies that no relevant answers are found. Cause: The retrieved documents do not match the core associated fields of the query (such as production batch numbers, filed formulas), or the model fails to correctly load all retrieved document content.
  • Phenomenon: The AI-generated reply content does not match the documents stored in the knowledge base. Cause: usingReRank or datasetSearchUsingExtensionQuery is not enabled, resulting in incorrect sorting of retrieved documents or deviations in semantic matching, and the model calls content from non-target knowledge bases.

How to confirm the configuration is properly set

  • View the retrieval log to confirm that all retrieved documents belong to the knowledge base collection of the current production batch, and verify that the collectionIds configuration is correct.
  • Test queries for different production batch numbers to confirm that the similarity of retrieval results meets the preset range, and verify that the similarity configuration is suitable for business needs.
  • Trigger high-concurrency retrieval requests to confirm that query latency meets business requirements, and verify that the token threshold setting matches business needs.
  • After enabling usingReRank, compare the document sorting before and after re-ranking to confirm that the re-ranking function is working properly.

The values provided are common starting points and should be measured against the reader's own samples.