mirror of
https://github.com/Mintplex-Labs/langchain-python.git
synced 2026-07-22 01:05:52 -04:00
47c3221fda
Implementation fails if there are not enough documents. Added the same
check as used for similarity search.
Current implementation raises
```
File ".venv/lib/python3.9/site-packages/langchain/vectorstores/faiss.py", line 160, in max_marginal_relevance_search
_id = self.index_to_docstore_id[i]
KeyError: -1
```