Potential Bug in Retriever.py: Can't instantiate abstract class BaseRetriever with abstract method _get_relevant_documents
Labels: name: area: memory, name: area: vector store, name: auto:bug

### System Info

LangChain Version: 0.0.339
Python version: 3.10.8
Windows 10 Enterprise 21H2

When creating a ConversationalRetrievalChain as follows:

CONVERSATION_RAG_CHAIN_WITH_SUMMARY_BUFFER = ConversationalRetrievalChain(
    combine_docs_chain=combine_docs_chain,
    memory=summary_memory,
    retriever=rag_retriever,
    question_generator=question_generator_chain
)

With rag_retriever = VectorStoreRetrieverMemory(retriever=VECTOR_STORE.as_retriever())

The following error occurs:

"
Traceback (most recent call last):
  File "C:\Users\om403f\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\om403f\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\om403f\Documents\Applied_Research\Deep_Learning\web_app\app.py", line 1438, in llm_task
    CONVERSATION_RAG_CHAIN_WITH_SUMMARY_BUFFER = ConversationalRetrievalChain(
  File "C:\Users\om403f\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\load\serializable.py", line 97, in __init__
    super().__init__(**kwargs)
  File "pydantic\main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for ConversationalRetrievalChain
retriever
  Can't instantiate abstract class BaseRetriever with abstract method _get_relevant_documents (type=type_error)
"

Name mangling may be occurring as described here: https://stackoverflow.com/questions/31457855/cant-instantiate-abstract-class-with-abstract-methods

retriever.py implements the abstract method _get_relevant_documents: https://github.com/langchain-ai/langchain/blob/4eec47b19128fa168e58b9a218a9da049275f6ce/libs/langchain/langchain/schema/retriever.py#L136

Hope this is an accurate bug report and it helps! Apologies if this is in fact a dumb report and actually an error at my end.

### Who can help?

_No response_

### Information

- [X] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [X] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

from langchain.memory import ConversationSummaryBufferMemory
from langchain.memory import VectorStoreRetrieverMemory
from langchain.prompts import PromptTemplate
from langchain.vectorstores import Chroma
from langchain.chains import LLMChain
from langchain.chains import RetrievalQA
from langchain.chains import ConversationChain
from langchain.chains import StuffDocumentsChain
from langchain.chains import ConversationalRetrievalChain

VECTOR_STORE = Chroma(persist_directory=VECTORDB_SBERT_FOLDER, embedding_function=HuggingFaceEmbeddings())
LLM = AzureChatOpenAI()

document_prompt = PromptTemplate(
    input_variables=["page_content"],
    template="{page_content}"
)

document_variable_name = "context"

temp_StuffDocumentsChain_prompt = PromptTemplate.from_template(
    "Summarize this content: {context}"
)

llm_chain_for_StuffDocumentsChain = LLMChain(llm=LLM, prompt=temp_StuffDocumentsChain_prompt)

combine_docs_chain = StuffDocumentsChain(
    llm_chain=llm_chain_for_StuffDocumentsChain,
    document_prompt=document_prompt,
    document_variable_name=document_variable_name
)

summary_memory = ConversationSummaryBufferMemory(llm=LLM, max_token_limit=100)

retriever=VECTOR_STORE.as_retriever()

rag_retriever = VectorStoreRetrieverMemory(retriever=retriever)

temp_template = (
    """
    Combine the chat history and qustion into a standalone question:
    Chat history: {chat_history}
    question: {user_query}
    """
)

temp_prompt = PromptTemplate.from_template(temp_template)

question_generator_chain = LLMChain(llm=LLM, prompt=temp_prompt)

CONVERSATION_RAG_CHAIN_WITH_SUMMARY_BUFFER = ConversationalRetrievalChain(
    combine_docs_chain=combine_docs_chain,
    memory=summary_memory,
    retriever=rag_retriever,
    question_generator=question_generator_chain
)

### Expected behavior

Example code here works: https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain.html#langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain