Skip to content

Scorer Retriever

The Scorer Retriever helps you find the most relevant documents from a collection.
You give it a search phrase, tell it how many results you want, and set a score cut‑off.
Only documents that score above the cut‑off are returned, so you get cleaner, more useful results.

How it Works

When you run the component, it creates a ScorerRetriever object.
This object looks up the search phrase in the vector store you provide, ranks the documents by similarity, and keeps only the top N results that have a similarity score higher than the threshold you set.
The component then returns two things:

  1. The retriever object itself (so you can use it elsewhere).
  2. The list of matching documents.

No external APIs are called; everything happens inside Nappai.

Inputs

  • Parent document vectorstore: The collection of documents you want to search.
  • Number of Results: How many top documents to return.
  • Score threshold: Minimum similarity score a document must have to be included.
  • Search Query: The text you want to search for.

Outputs

  • Retriever: A ready‑to‑use retriever object that can be connected to other components.
  • Search Results: A list of documents that matched the query and met the score threshold. These can be displayed, processed further, or fed into another workflow step.

Usage Example

  1. Add a Vector Store component and load your documents.
  2. Add a Scorer Retriever component.
    • Connect the Vector Store output to Parent document vectorstore.
    • Set Search Query to “Quarterly sales report”.
    • Set Score threshold to 0.75 (only documents with at least 75 % similarity will appear).
    • Set Number of Results to 5.
  3. Connect the Search Results output to a Display component to show the documents to the user.
  • Vector Store – Stores and indexes your documents for fast retrieval.
  • Retriever – A generic component that can be used for any type of search.
  • Search – Displays search results in a table or list format.

Tips and Best Practices

  • Choose a sensible threshold: A very high threshold may return no results; a very low threshold may return too many irrelevant documents.
  • Limit the number of results to keep the output manageable and improve performance.
  • Combine with filters: If your vector store supports metadata filtering, use it to narrow results before scoring.
  • Test with sample queries to fine‑tune the threshold and number of results.

Security Considerations

  • All data stays within your Nappai environment; no external calls are made.
  • Ensure the vector store is stored on a secure, access‑controlled server.
  • If the documents contain sensitive information, apply appropriate data‑handling policies before indexing.