Skip to content

fix: wrap vector and payload in lists for Langchain.update#4446

Merged
kartik-mem0 merged 2 commits intomainfrom
fix/langchain-update-type-mismatch-3767
Mar 20, 2026
Merged

fix: wrap vector and payload in lists for Langchain.update#4446
kartik-mem0 merged 2 commits intomainfrom
fix/langchain-update-type-mismatch-3767

Conversation

@kartik-mem0
Copy link
Copy Markdown
Contributor

Description

Fix type mismatch in Langchain.update() where vector and payload are passed as scalars to insert(), which expects List[List[float]] and List[Dict]. This causes AttributeError: 'str' object has no attribute 'get' at runtime when updating vectors through the LangChain adapter.

Wraps both parameters in lists before passing to insert().

Fixes #3767

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit Test

Added regression test test_update_wraps_vector_and_payload_in_lists that verifies update() correctly wraps vector and payload in lists before calling insert(). All 11 existing + new
tests pass.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Maintainer Checklist

@kartik-mem0 kartik-mem0 requested a review from whysosaket March 20, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type Mismatch in Langchain Vector Store Adapter's update Method

2 participants