NebiusRetriever
enables efficient similarity search using embeddings from Nebius AI Studio. It leverages high-quality embedding models to enable semantic search over documents.
This retriever is optimized for scenarios where you need to perform similarity search over a collection of documents, but don’t need to persist the vectors to a vector database. It performs vector similarity search in-memory using matrix operations, making it efficient for medium-sized document collections.
api_key
or set as the environment variable NEBIUS_API_KEY
. You can obtain an API key by creating an account on Nebius AI Studio.
NebiusRetriever
requires a NebiusEmbeddings
instance and a list of documents. Here’s how to initialize it:
get_relevant_documents
method directly (though invoke
is the preferred interface):
k
as a parameter:
NebiusRetrievalTool
to create a tool for agents:
invoke
or get_relevant_documents
):