Passage Retrieval (CPR) content requirements and best practices
Passage Retrieval (CPR) content requirements and best practices
Passage Retrieval (CPR) uses your enterprise content as the data from which to retrieve passages. The content that you choose to use for CPR, and the quality of that content, has a direct impact on the quality of the passages that are retrieved by CPR.
A CPR implementation requires you to create a CPR model. When creating the model, you must specify the indexed content that the model will use to retrieve passages.
This article describes the requirements and best practices with regards to the content that you choose to use for CPR.
Note
An optimal Passage Retrieval (CPR) implementation includes both a CPR model and a Semantic Encoder (SE) model. The same SE model can be used with multiple CPR models. For best results, both the CPR and SE models should be configured to use the same content. See CPR overview for information on how CPR and SE work together in the context of a user query to retrieve passages. |
How CPR uses your content
Before deciding on the content to use for CPR, it’s important to have a basic understanding of how your content is used to retrieve passages.
When an item is indexed, the item’s content is typically mapped to the body
field in the Coveo index.
The CPR model uses a pre-trained sentence transformer language model to convert your indexed content’s body text into mathematical representations (vectors) in a process called embedding.
When a user enters a query, the model uses the vector space to retrieve the most relevant content.
This retrieval is based on semantic similarity using embeddings, which are created using the text in your content’s body text.
In summary, the CPR model parses your content’s body text when creating the embeddings, and uses only that content to retrieve passages. An item’s body data, therefore, should be as clean, focused, and relevant as possible. The better the data, the better the embeddings. For best results, you should adhere to the requirements and best practices detailed in this article when choosing the content to use for CPR.
For more information on how your content is used to retrieve passages, see CPR processes.
The CPR model uses only the content in an item’s |
Requirements
-
The content you want to use must be indexed in your Coveo organization before creating the model.
You don’t have to use all the content in your index. In fact, best practices dictate that you should choose a reasonably sized dataset to keep the content focused and relevant. When creating the model, you can choose to use a subset of your indexed content by selecting the sources that contain the items, and then further filtering the source dataset. For more information, see Choose your content.
NoteIf the indexed items you want to use aren’t optimized for use with the model, re-index the items with the proper configuration.
-
An indexed item must contain a unique value in the
permanentid
field in order for the item’s content to be embedded and used by the model.NoteBy default, an item indexed using a standard Coveo source automatically contains a value in its
permanentid
field that Coveo uses as the item’s unique identifier. However, if you’re using a custom source, such as Push API, you must make sure that the items that you want to use contain a unique value in thepermanentid
field. If not, you must map unique metadata to the item’spermanentid
field.To verify if an item contains a unique value in the
permanentid
field, you can use the Content Browser (platform-ca | platform-eu | platform-au) page of the Coveo Administration Console to check the item’s properties. -
The indexed item’s
language
field is English.NoteTo verify an item’s
language
field, you can use the Content Browser (platform-ca | platform-eu | platform-au) page of the Coveo Administration Console to check the item’s properties.
Supported file types
Coveo has tested and supports the following file types for use with the model:
-
HTML
-
PDF
Notes
|
Best practices
This section describes best practices when it comes to choosing the content to use for the model and how to optimize the content for best results.
Choose your content
When deciding on the content to use, consider the following:
-
Prioritize content that’s designed to answer questions such as knowledge base articles, support documents, FAQs, community answers, and product documentation.
-
Prioritize content that’s written in a conversational tone.
-
Prioritize shorter documents that are focused on a single topic.
NoteAvoid using very long documents that cover multiple topics. This may result in text being embedded as semantically similar, even though the context or topic is different.
-
Content should be written using a single language (English).
-
Avoid multiple documents with similar content.
-
Choose a reasonably sized dataset to keep the content focused and current.
Keep the model embedding limits in mind when choosing the content for your model. |
Optimize your content
To optimize your content for the model, follow these best practices:
Notes
|
When is an answer not generated?
Adhering to the requirements and best practices outlined in this article greatly improves the relevancy of the passages that are exposed to your LLM. In certain cases, however, an answer can’t be generated for a given user query. This can be caused by insufficient relevant content.
Insufficient relevant content
The passages (chunks) that are used in the passage retrieval flow must meet a minimum relevancy threshold with the user query. A verification is made by the CPR model when retrieving the most relevant passages during second-stage content retrieval. If all of the passages identified during second-stage content retrieval don’t meet CPR's minimum relevancy threshold with the user query, no passages will be made available to the LLM application.
Model embedding limits
The CPR model converts your content’s body text into numerical representations (vectors) in a process called embedding. It does this by breaking the text up into smaller segments called chunks, and each chunk is mapped as a distinct vector. For more information, see Embeddings.
Due to the amount of processing required for embeddings, the model is subject to the following embedding limits:
Note
The same chunking strategy is used for all sources and item types. |
-
Up to 1 million items or 10 million chunks
Notes-
The maximum number of items depends on the item allocation of your product plan.
-
Coveo strongly recommends that you add a Semantic Encoder (SE) model as part of your CPR implementation. If you have more than one CPR model in your Coveo organization, for best results each CPR model should use only the items that are used by the SE model.
-
-
1000 chunks per item
This means that for a given item, there can be a maximum of 1000 chunks. So if an item is long with a lot of text, such as more than 200,000 words or 250 pages, the model will embed the item’s text until the 1000-chunk limit is reached. The remaining text won’t be embedded and therefore won’t be used by the model.
-
250 words per chunk
NoteThere can be an overlap of up to 10% between chunks. In other words, the last 10% of the previous chunk can be the first 10% of the next chunk.