InterleaveDocuments Parameters

Check the init and runtime parameters you can configure for the InterleaveDocuments node.

YAML Init Parameters

Here are the parameters you can configure for InterleaveDocuments in the pipeline YAML configuration:

ParameterTypePossible ValuesDescription
interleaving_modeLiteralteam_draft
random
balanced
optimized
probabilistic
pairwise_preference
Default: team_draft
The interleaving mode to use. You can choose one of the following modes:
- team_draft: Alternates between picking documents from each retriever in turn. For example, if you have RetrieverA and RetrieverB, this mode picks a document from RetrieverA, then a document from RetrieverB, then a document from RetrieverA, and so on.
- random: Randomly interleaves the documents the retrievers return.
- balanced: Works similarly to the team_draft mode with the difference that it ensures documents coming from each retriever have an equal chance of appearing in each position in the final list. This means that if a document from RetrieverA is chosen first for the top position, the next time (for a different query) a document from RetrieverB is chosen first for the top position. Can work with a maximum of two input lists.
- optimized: Interleaves documents so that the differences in the effectiveness of the retrievers are most evident, based on the Multileaved Comparisons for Fast Online Evaluation paper.
- probabilistic: Uses statistical probability when choosing a document from a particular retriever.
- pairwise_preference: Interleaves pairs of documents in a single list. Each pair consists of documents, each from a different retriever, that are similar or closely ranked.
Required.
top_k_joinIntegerDefault: NoneThe maximum number of documents to return in an interleaved list. If set to None, returns all documents.
Optional.
score_modeLiteralnone
keep
mock
Default: none
Sets the score of the documents. Possible modes:
- none: Sets the score to None.
- keep: Keeps the original score the document got from the retriever.
- mock: Sets the score to 1.
Required.
shortest_capBooleanTrue
False
Default: False
It's useful when the lists of documents coming from different retrievers significantly differ in length.
When set to True, it only interleaves as many items as the length of the shortest input list. This way, you can avoid a situation where one of the retrievers returns a longer list of documents, and then the interleaved list contains mostly documents from this retriever.
If the shortest list is empty, you get no results.
Required.

REST API Runtime Parameters

There are no runtime parameters you can pass to this node when making a request to the Search REST API endpoint.