SQLServer_VectorStore - add_documents Does Not Update Existing Entries #29808
Replies: 1 comment
-
Hey @amnayk! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve this issue! The If you are encountering a duplicate key error, it suggests that the current implementation might not be correctly handling the update logic for existing entries. This could be due to a missing check for existing IDs before attempting to insert new ones, or an issue with how the update operation is being executed in the database. To resolve this, you might want to ensure that the method is correctly checking for existing entries and performing an update operation instead of an insert when a duplicate ID is detected. If the implementation is not behaving as expected, reviewing the logic in the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The add_documents method in SQLServer_VectorStore is supposed to add or update documents in the vector store.
However, when attempting to add documents that already exist in the table, it raises a duplicate key error instead of updating them:
Add text failed: ('23000', "[23000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot insert duplicate key row in object 'dbo.embeddings' with unique index 'idx_custom_id'. The duplicate key value is (Solar Activity.pdf0). (2601) (SQLExecDirectW)")
Maybe I'm wrong but I'm expecting that if a document with same ID already exists, the method would update it instead of trying to insert a duplicate.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions