A developer is building a LangChain-based RAG pipeline on Databricks and wants to use a Mosaic AI Vector Search index as the retriever. After creating the index, which LangChain integration class should they instantiate to wrap the index as a LangChain-compatible retriever?
- A. FAISS.from_existing_index() pointed at the Vector Search endpoint
- B. VectorSearchRetriever, imported directly from langchain_community.retrievers
- C. DatabricksEmbeddings wrapped around the index object
- D. DatabricksVectorSearch, then call .as_retriever()✓ Correct
Explanation
DatabricksVectorSearch (from langchain_community.vectorstores) is the correct class to wrap a Mosaic AI Vector Search index, and calling .as_retriever() on it produces a standard LangChain retriever interface. There is no standalone VectorSearchRetriever class in langchain_community.retrievers for Databricks. DatabricksEmbeddings is an embeddings wrapper used for generating embeddings, not for wrapping a vector store as a retriever. FAISS.from_existing_index() is used for local FAISS indexes and has no connection to Mosaic AI Vector Search.