-
Type: Task
-
Resolution: Works as Designed
-
Priority: Unknown
-
None
-
Affects Version/s: langchain-mongodb-0.3
-
Component/s: AI/ML
-
None
-
Python Drivers
Context
apoorva.joshi@mongodb.com pointed out that she wasn't seeing any speed improvements in using the ParentDocRetriever. I looked into this and see that that's because we do not provide a function that can take advantage of concurrency in calling out to the LLM to create embedding vectors when we add documents to the Collection.
A batching structure is already in place, so this really is going from for to async for
Note that one can call aadd_documents now, but this is implemented in the super-class as await run_in_executor(self.add_documents, *, ** so it doesn't provide benefit to the calls to the LLM, which can be done via aembed_documents.
So, we implement
_aadd_documents
_aadd_texts
and abulk_embed_and_insert_texts
and call out to
{{aembed_documents(texts)
Definition of done
Implement. Add tests. Open PR. Merge. Release.
- is related to
-
INTPYTHON-432 LangChain: MongoDBAtlasVectorSearch: Combine add_texts & add_documents
- Backlog