diff --git a/langchain/docstore/in_memory.py b/langchain/docstore/in_memory.py index f1e36102581..1049337839b 100644 --- a/langchain/docstore/in_memory.py +++ b/langchain/docstore/in_memory.py @@ -17,7 +17,7 @@ class InMemoryDocstore(Docstore, AddableMixin): overlapping = set(texts).intersection(self._dict) if overlapping: raise ValueError(f"Tried to add ids that already exist: {overlapping}") - self._dict = dict(self._dict, **texts) + self._dict = {**self._dict, **texts} def search(self, search: str) -> Union[str, Document]: """Search via direct lookup."""