Skip to content

feat(drivers-embedding-twelvelabs): add TwelveLabsEmbeddingDriver#2214

Open
mohit-twelvelabs wants to merge 1 commit into
griptape-ai:mainfrom
mohit-twelvelabs:feat/twelvelabs-integration
Open

feat(drivers-embedding-twelvelabs): add TwelveLabsEmbeddingDriver#2214
mohit-twelvelabs wants to merge 1 commit into
griptape-ai:mainfrom
mohit-twelvelabs:feat/twelvelabs-integration

Conversation

@mohit-twelvelabs

@mohit-twelvelabs mohit-twelvelabs commented Jun 25, 2026

Copy link
Copy Markdown

Hi! I'm Mohit, I work at TwelveLabs (@mohit-twelvelabs).

Describe your changes

Adds an opt-in TwelveLabsEmbeddingDriver backed 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_property client, import_optional_dependency).
  • Registered in griptape/drivers/__init__.py (import + __all__).
  • New optional extra drivers-embedding-twelvelabs = ["twelvelabs>=1.2.8"] in pyproject.toml (+ uv.lock), so it installs only when requested.
  • Unit tests mirroring test_voyageai_embedding_driver.py (text, text-artifact, image-artifact, and empty-response paths).
  • Docs section + runnable example in 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, and mdformat --check all clean on the changed files.
  • Live smoke test against the real API: TwelveLabsEmbeddingDriver().embed("a red bus driving down a city street") returns a 512-dim float vector (model marengo3.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/

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

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.23529% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/drivers/embedding/twelvelabs_embedding_driver.py 87.09% 2 Missing and 2 partials ⚠️

📢 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.

1 participant