retrievers#

Retriever class returns Documents given a text query.

It is more general than a vector store. A retriever does not need to be able to store documents, only to return (or retrieve) it. Vector stores can be used as the backbone of a retriever, but there are other types of retrievers as well.

Class hierarchy:

BaseRetriever --> <name>Retriever  # Examples: ArxivRetriever, MergerRetriever

Main helpers:

Document, Serializable, Callbacks,
CallbackManagerForRetrieverRun, AsyncCallbackManagerForRetrieverRun

Classes

retrievers.arcee.ArceeRetriever

Arcee Domain Adapted Language Models (DALMs) retriever.

retrievers.arxiv.ArxivRetriever

Arxiv retriever.

retrievers.asknews.AskNewsRetriever

AskNews retriever.

retrievers.azure_ai_search.AzureAISearchRetriever

Azure AI Search service retriever.

retrievers.azure_ai_search.AzureCognitiveSearchRetriever

Azure Cognitive Search service retriever.

retrievers.bedrock.AmazonKnowledgeBasesRetriever

Amazon Bedrock Knowledge Bases retriever.

retrievers.bedrock.RetrievalConfig

Configuration for retrieval.

retrievers.bedrock.VectorSearchConfig

Configuration for vector search.

retrievers.bm25.BM25Retriever

BM25 retriever without Elasticsearch.

retrievers.breebs.BreebsRetriever

A retriever class for Breebs.

retrievers.chaindesk.ChaindeskRetriever

Chaindesk API retriever.

retrievers.chatgpt_plugin_retriever.ChatGPTPluginRetriever

ChatGPT plugin retriever.

retrievers.databerry.DataberryRetriever

Databerry API retriever.

retrievers.docarray.DocArrayRetriever

DocArray Document Indices retriever.

retrievers.docarray.SearchType(value[, ...])

Enumerator of the types of search to perform.

retrievers.dria_index.DriaRetriever

Dria retriever using the DriaAPIWrapper.

retrievers.elastic_search_bm25.ElasticSearchBM25Retriever

Elasticsearch retriever that uses BM25.

retrievers.embedchain.EmbedchainRetriever

Embedchain retriever.

retrievers.google_vertex_ai_search.GoogleCloudEnterpriseSearchRetriever

Google Vertex Search API retriever alias for backwards compatibility.

retrievers.kay.KayAiRetriever

Retriever for Kay.ai datasets.

retrievers.kendra.AdditionalResultAttribute

Additional result attribute.

retrievers.kendra.AdditionalResultAttributeValue

Value of an additional result attribute.

retrievers.kendra.AmazonKendraRetriever

Amazon Kendra Index retriever.

retrievers.kendra.DocumentAttribute

Document attribute.

retrievers.kendra.DocumentAttributeValue

Value of a document attribute.

retrievers.kendra.Highlight

Information that highlights the keywords in the excerpt.

retrievers.kendra.QueryResult

Amazon Kendra Query API search result.

retrievers.kendra.QueryResultItem

Query API result item.

retrievers.kendra.ResultItem

Base class of a result item.

retrievers.kendra.RetrieveResult

Amazon Kendra Retrieve API search result.

retrievers.kendra.RetrieveResultItem

Retrieve API result item.

retrievers.kendra.TextWithHighLights

Text with highlights.

retrievers.knn.KNNRetriever

KNN retriever.

retrievers.llama_index.LlamaIndexGraphRetriever

LlamaIndex graph data structure retriever.

retrievers.llama_index.LlamaIndexRetriever

LlamaIndex retriever.

retrievers.metal.MetalRetriever

Metal API retriever.

retrievers.milvus.MilvusRetriever

Milvus API retriever.

retrievers.nanopq.NanoPQRetriever

`NanoPQ retriever.

retrievers.outline.OutlineRetriever

Retriever for Outline API.

retrievers.pinecone_hybrid_search.PineconeHybridSearchRetriever

Pinecone Hybrid Search retriever.

retrievers.pubmed.PubMedRetriever

PubMed API retriever.

retrievers.rememberizer.RememberizerRetriever

Rememberizer retriever.

retrievers.remote_retriever.RemoteLangChainRetriever

LangChain API retriever.

retrievers.svm.SVMRetriever

SVM retriever.

retrievers.tavily_search_api.SearchDepth(value)

Search depth as enumerator.

retrievers.tavily_search_api.TavilySearchAPIRetriever

Tavily Search API retriever.

retrievers.tfidf.TFIDFRetriever

TF-IDF retriever.

retrievers.thirdai_neuraldb.NeuralDBRetriever

Document retriever that uses ThirdAI's NeuralDB.

retrievers.vespa_retriever.VespaRetriever

Vespa retriever.

retrievers.weaviate_hybrid_search.WeaviateHybridSearchRetriever

Weaviate hybrid search retriever.

retrievers.web_research.QuestionListOutputParser

Output parser for a list of numbered questions.

retrievers.web_research.SearchQueries

Search queries to research for the user's goal.

retrievers.web_research.WebResearchRetriever

Google Search API retriever.

retrievers.wikipedia.WikipediaRetriever

Wikipedia API retriever.

retrievers.you.YouRetriever

You.com Search API retriever.

retrievers.zep.SearchScope(value[, names, ...])

Which documents to search.

retrievers.zep.SearchType(value[, names, ...])

Enumerator of the types of search to perform.

retrievers.zep.ZepRetriever

Zep MemoryStore Retriever.

retrievers.zep_cloud.ZepCloudRetriever

Zep Cloud MemoryStore Retriever.

retrievers.zilliz.ZillizRetriever

Zilliz API retriever.

Functions

retrievers.bm25.default_preprocessing_func(text)

retrievers.kendra.clean_excerpt(excerpt)

Clean an excerpt from Kendra.

retrievers.kendra.combined_text(item)

Combine a ResultItem title and excerpt into a single string.

retrievers.knn.create_index(contexts, embeddings)

Create an index of embeddings for a list of contexts.

retrievers.milvus.MilvusRetreiver(*args, ...)

Deprecated MilvusRetreiver.

retrievers.nanopq.create_index(contexts, ...)

Create an index of embeddings for a list of contexts.

retrievers.pinecone_hybrid_search.create_index(...)

Create an index from a list of contexts.

retrievers.pinecone_hybrid_search.hash_text(text)

Hash a text using SHA256.

retrievers.svm.create_index(contexts, embeddings)

Create an index of embeddings for a list of contexts.

retrievers.zilliz.ZillizRetreiver(*args, ...)

Deprecated ZillizRetreiver.

Deprecated classes

retrievers.cohere_rag_retriever.CohereRagRetriever

Deprecated since version 0.0.30: Use langchain_cohere.CohereRagRetriever instead.

retrievers.google_cloud_documentai_warehouse.GoogleDocumentAIWarehouseRetriever

Deprecated since version 0.0.32: Use langchain_google_community.DocumentAIWarehouseRetriever instead.

retrievers.google_vertex_ai_search.GoogleVertexAIMultiTurnSearchRetriever

Deprecated since version 0.0.33: Use langchain_google_community.VertexAIMultiTurnSearchRetriever instead.

retrievers.google_vertex_ai_search.GoogleVertexAISearchRetriever

Deprecated since version 0.0.33: Use langchain_google_community.VertexAISearchRetriever instead.

retrievers.qdrant_sparse_vector_retriever.QdrantSparseVectorRetriever

Deprecated since version 0.2.16: Use Qdrant vector store now supports sparse retrievals natively. Use langchain_qdrant.QdrantVectorStore#as_retriever() instead. Reference: https://python.langchain.com/v0.2/docs/integrations/vectorstores/qdrant/#sparse-vector-search instead.