Retriever

Concept

Retrievers are responsible for fetching the most relevant context given a user query (or chat message).

It can be built on top of Indices, but can also be defined independently. It is used as a key building block in Query Engines (and Chat Engines) for retrieving relevant context.

Tip

Confused about where retriever fits in the pipeline? Read about high-level concepts

Usage Pattern

Get started with:

retriever = index.as_retriever()
nodes = retriever.retrieve("Who is Paul Graham?")