autorag.retrieve

Vector-similarity retrieval over an ingested corpus.

Composes an Embedder (to encode the query) with a VectorStore (to do the nearest-neighbour lookup) so that the choice of embedding model and backing store can vary independently.

class autorag.retrieve.Retriever(store, embedder)[source]

Bases: object

Embed a question and pull the top_k most similar chunks.

Parameters:
retrieve(question, top_k)[source]

Return the top_k chunks most similar to question.

Parameters:
Return type:

list[Retrieved]