@@ -123,7 +123,8 @@ def load(
123123
124124 # Upsert documents if upsert is True and vector db supports upsert
125125 if upsert and self .vector_db .upsert_available ():
126- self .vector_db .upsert (documents = document_list , filters = doc .meta_data )
126+ for doc in document_list :
127+ self .vector_db .upsert (documents = [doc ], filters = doc .meta_data )
127128 # Insert documents
128129 else :
129130 # Filter out documents which already exist in the vector db
@@ -132,7 +133,8 @@ def load(
132133 documents_to_load = self .filter_existing_documents (document_list )
133134
134135 if documents_to_load :
135- self .vector_db .insert (documents = documents_to_load , filters = doc .meta_data )
136+ for doc in documents_to_load :
137+ self .vector_db .insert (documents = [doc ], filters = doc .meta_data )
136138
137139 num_documents += len (documents_to_load )
138140 log_info (f"Added { len (documents_to_load )} documents to knowledge base" )
@@ -174,7 +176,8 @@ async def aload(
174176
175177 # Upsert documents if upsert is True and vector db supports upsert
176178 if upsert and self .vector_db .upsert_available ():
177- await self .vector_db .async_upsert (documents = document_list , filters = doc .meta_data )
179+ for doc in document_list :
180+ await self .vector_db .async_upsert (documents = [doc ], filters = doc .meta_data )
178181 # Insert documents
179182 else :
180183 # Filter out documents which already exist in the vector db
@@ -183,7 +186,8 @@ async def aload(
183186 documents_to_load = self .filter_existing_documents (document_list )
184187
185188 if documents_to_load :
186- await self .vector_db .async_insert (documents = documents_to_load , filters = doc .meta_data )
189+ for doc in documents_to_load :
190+ await self .vector_db .async_insert (documents = [doc ], filters = doc .meta_data )
187191
188192 num_documents += len (documents_to_load )
189193 log_info (f"Added { len (documents_to_load )} documents to knowledge base" )
0 commit comments