Skip to content

The agent engineering platform.

community[patch]: Fix MongoDBAtlasVectorSearch max_marginal_relevance_search (#17971)

certified-dodo43e324457351
diff --git a/libs/community/langchain_community/vectorstores/mongodb_atlas.py b/libs/community/langchain_community/vectorstores/mongodb_atlas.py
index ab15d0a7fc..ae645568f9 100644
--- a/libs/community/langchain_community/vectorstores/mongodb_atlas.py
+++ b/libs/community/langchain_community/vectorstores/mongodb_atlas.py
@@ -215,7 +215,6 @@ class MongoDBAtlasVectorSearch(VectorStore):
for res in cursor:
text = res.pop(self._text_key)
score = res.pop("score")
- del res[self._embedding_key]
docs.append((Document(page_content=text, metadata=res), score))
return docs