vectorstores/typeorm.ts - TypeORMVectorStore.addDocuments() does NOT support options?: { ids?: string[] }
param
#7739
Labels
auto:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Checked other resources
Example Code
Currently, an upstream open-source project (Flowise) has encountered a bug when using the
TypeORMVectorStore.addDocuments()
function as described here:FlowiseAI/Flowise#3570 (comment)
Essentially, Flowise performs this call when adding documents:
Ref: https://github.com/FlowiseAI/Flowise/blob/c0a74782d8f1dbe118d2ed3aa40dd292d25d9119/packages/components/src/indexing.ts#L300
Flowise ASSUMES that the second parameter
{ids: uids}
is getting passed correctly to theTypeORMVectorStore.addDocuments()
function -- HOWEVER, that it seems the current implementation in typeorm does not support processing that second parameter at all:langchainjs/libs/langchain-community/src/vectorstores/typeorm.ts
Line 121 in d303e90
This causes the underlying RecordManager implementation in LangChain to fail, because there are no matching ids between the vector store and the record manager tables -- therefore, ANY cleanup modes (e.g., FULL, INCREMENTAL) will not work correctly.
In comparison, the
vectorstores/pgvector.ts
implementation does not suffer from this issue, as it correctly supports the second parameter:langchainjs/libs/langchain-community/src/vectorstores/pgvector.ts
Lines 350 to 353 in d303e90
So, while a workaround exists, this bug is to request that equivalent support be added to the typeorm implementation so that this bug does not exist.
Error Message and Stack Trace (if applicable)
No response
Description
When using the typeorm vector stores driver in Flowise, FULL and INCREMENTAL cleanup modes in the underlying LangChain RecordManager will fail due to this error.
System Info
"@langchain/core": "0.3.37"
platform: linux
The text was updated successfully, but these errors were encountered: