Skip to content

EnsembleRetriever

The Ensemble Retriever lets you pull information from several sources at once.
You give it a search query and a list of retrievers, and it returns a single set of documents that blends the best results from each retriever.

How it Works

When you run the component, it first builds an EnsembleRetriever object.
If you only supplied one retriever, that one is used directly.
If you supplied two or more, the component gives each retriever the same weight and asks each one for the top documents.
It then merges those lists into one combined list and returns it.
All of this happens inside your Nappai dashboard—no external API calls are made.

Inputs

  • Retrievers: The retrievers you want to combine.
    Connect the outputs of other retriever components to this field.

  • Number of Results: How many documents you want in the final list.
    The default is 20, but you can adjust it to fit your needs.

  • Search Query: The text you want to search for.
    Type the query directly or connect it from another component.

Outputs

  • Retriever: The built EnsembleRetriever object.
    You can use this output to feed into other components that accept a retriever.

  • Search Results: A list of documents that match the query, merged from all the retrievers.
    Each item contains the document content and metadata, ready to be displayed or processed further.

Usage Example

  1. Add the Ensemble Retriever to your workflow.
  2. Connect two retrievers (e.g., a keyword retriever and a vector retriever) to the Retrievers input.
  3. Set the Search Query to “Quarterly sales report”.
  4. Choose Number of Results as 15.
  5. Run the workflow.
  6. The Search Results output will show a combined list of the best 15 documents from both retrievers, which you can then display in a table or feed into a summarization component.
  • Simple Retriever – Pulls documents from a single source.
  • Vector Retriever – Uses embeddings to find similar documents.
  • Keyword Retriever – Searches for exact keyword matches.

Tips and Best Practices

  • Mix retriever types: Combining a vector retriever with a keyword retriever often gives the most comprehensive results.
  • Keep the number of results reasonable: Too many results can overwhelm the user; start with 10–20 and adjust as needed.
  • Check retriever quality: If one retriever consistently returns low‑quality documents, consider removing it or adjusting its weight manually.
  • Use the Retriever output: If you need to reuse the same ensemble in another part of your workflow, connect the Retriever output to that component.

Security Considerations

  • All data processing happens locally within your Nappai instance; no external calls are made.
  • Ensure that the retrievers you connect are secure and that any sensitive documents are handled according to your organization’s data‑privacy policies.