Skip to content

fix: implement upsert_vector for MarqoVectorStoreDriver - #2254

Open
biconcavelens wants to merge 2 commits into
griptape-ai:mainfrom
biconcavelens:fix/marqo-upsert-vector
Open

biconcavelens wants to merge 2 commits into
griptape-ai:mainfrom
biconcavelens:fix/marqo-upsert-vector

Conversation

@biconcavelens

Copy link
Copy Markdown

Describe your changes

MarqoVectorStoreDriver.upsert_vector previously raised NotImplementedError. Marqo supports upserting arbitrary vectors through custom vector fields, so this implements it:

  • Builds a document with a custom_vector mapping and upserts it via add_documents, mirroring the existing upsert method in the same driver (namespace/meta handling, response parsing, and returning the _id).
  • Removes the now-inaccurate Raises: ... not yet implemented line from the docstring.
  • Adds unit tests covering the basic upsert and the namespace/meta passthrough, using the existing mocked Marqo client fixture.

Note: unlike the PineconeVectorStoreDriver, **kwargs is intentionally not forwarded to add_documents, since Marqo's add_documents has a fixed signature (no **kwargs) — this matches the existing upsert method in this driver.

Issue ticket number and link

Closes #1802#1802


AI assistance disclosure (per CONTRIBUTING.md): this change was drafted with AI assistance. The implementation follows the pattern of the existing upsert method and the issue author's suggested approach; I verified custom_vector is a valid Marqo mapping type and that add_documents does not accept arbitrary kwargs against the pinned marqo version, and confirmed the full driver test suite passes locally (pytest) with ruff check/format clean.

Marqo supports upserting arbitrary vectors via custom_vector fields, so
this no longer needs to raise NotImplementedError.

Closes griptape-ai#1802
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Support Upserting Custom Vectors In Marqo Vector Store Driver

1 participant