feat(drivers-embedding-twelvelabs): add TwelveLabsEmbeddingDriver#2214
Open
mohit-twelvelabs wants to merge 1 commit into
Open
feat(drivers-embedding-twelvelabs): add TwelveLabsEmbeddingDriver#2214mohit-twelvelabs wants to merge 1 commit into
TwelveLabsEmbeddingDriver#2214mohit-twelvelabs wants to merge 1 commit into
Conversation
Adds an opt-in embedding driver backed by TwelveLabs' Marengo multimodal model. Marengo maps text, images, and video into the same 512-dimensional vector space, enabling text-to-visual retrieval. Gated behind the `drivers-embedding-twelvelabs` extra; no existing behavior changes.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! I'm Mohit, I work at TwelveLabs (@mohit-twelvelabs).
Describe your changes
Adds an opt-in
TwelveLabsEmbeddingDriverbacked by TwelveLabs' Marengo multimodal embedding model.Why this helps Griptape: Marengo maps text, images, and video into the same 512-dimensional vector space. That means a plain text query can be matched against visual content stored in any Griptape vector store driver — useful for video/image RAG and multimodal search, which the existing text-only embedding drivers don't cover.
What it adds
griptape/drivers/embedding/twelvelabs_embedding_driver.py+twelvelabs/subpackage, following the existing Voyage/Cohere driver convention (@define,lazy_propertyclient,import_optional_dependency).griptape/drivers/__init__.py(import +__all__).drivers-embedding-twelvelabs = ["twelvelabs>=1.2.8"]inpyproject.toml(+uv.lock), so it installs only when requested.test_voyageai_embedding_driver.py(text, text-artifact, image-artifact, and empty-response paths).embedding-drivers.md.Opt-in / non-breaking: nothing is wired into defaults; the driver only loads if you install the extra and instantiate it. No existing behavior changes.
How it was tested
uv run pytest tests/unit/drivers/embedding/— all pass (63 tests, including the 5 new ones).ruff format --check,ruff check,pyright,typos, andmdformat --checkall clean on the changed files.TwelveLabsEmbeddingDriver().embed("a red bus driving down a city street")returns a 512-dim float vector (modelmarengo3.0).Process note (being upfront): per CONTRIBUTING, new integrations are normally raised as a discussion/issue first and may start as an extension. I'm opening this directly to share a complete, tested implementation — happy to convert it to a discussion, file a tracking issue, or repackage as an extension if you'd prefer that path.
You can grab a free API key at https://twelvelabs.io — there's a generous free tier.
Issue ticket number and link
No pre-existing issue — see the process note above. Happy to open a discussion/issue to track this.
📚 Documentation preview 📚: https://griptape--2214.org.readthedocs.build//2214/