[docs]classMongoDBGraphRAGRetriever(BaseRetriever):"""RunnableSerializable API of MongoDB GraphRAG."""graph_store:MongoDBGraphStore"""Underlying Knowledge Graph storing entities and their relationships."""def_get_relevant_documents(self,query:str,*,run_manager:CallbackManagerForRetrieverRun)->List[Document]:"""Retrieve list of Entities found via traversal of KnowledgeGraph. Each Document's page_content is a string representation of the Entity dict. Description and details are provided in the underlying Entity Graph: :class:`~langchain_mongodb.graphrag.graph.MongoDBGraphStore` Args: query: String to find relevant documents for run_manager: The callback handler to use if desired Returns: List of relevant documents. """return[Document(str(e))foreinself.graph_store.similarity_search(query)]