Skip to content

feat: add TwelveLabs video understanding Executor - #6245

Open
mohit-twelvelabs wants to merge 1 commit into
jina-ai:masterfrom
mohit-twelvelabs:feat/twelvelabs-integration
Open

feat: add TwelveLabs video understanding Executor#6245
mohit-twelvelabs wants to merge 1 commit into
jina-ai:masterfrom
mohit-twelvelabs:feat/twelvelabs-integration

Conversation

@mohit-twelvelabs

Copy link
Copy Markdown

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

Goals:

This PR adds an opt-in, self-contained example Executor that serves TwelveLabs video understanding through standard Jina-serve endpoints.

  • Adds integrations/twelvelabs/, a Jina-serve Executor project following the documented executor file structure (executor/ package + config.yml + requirements.txt + tests).
  • TwelveLabsExecutor exposes two endpoints:
    • /embed — Marengo multimodal embeddings (512-dim) for text queries, returned as a DocList[EmbeddingDoc] with an NdArray[512] field.
    • /analyze — Pegasus video understanding (generated text from a public video URL or an indexed video_id).
  • Adds a tutorial at docs/tutorials/twelvelabs-video-understanding.md, wired into the tutorials toctree.

Why it helps this project: TwelveLabs gives Jina users a drop-in way to add video embeddings and video-to-text into their Flows/Deployments, complementing the existing text/image executor ecosystem for multimodal pipelines.

Opt-in / non-breaking: Nothing in core jina changes. The twelvelabs SDK is imported lazily, only when the Executor actually runs, so it adds no import-time dependency to the framework.

How it was tested:

  • No-network unit tests (mocked client) cover /embed, /analyze, and the missing-key error path.
  • A live test (skipped unless TWELVELABS_API_KEY is set) verifies a real Marengo call returns a 512-dim embedding. Run locally against the live API: all 4 tests pass.
  • Formatted with black -S and isort --profile black; docstrings pass pydocstyle D101/D102/D103, matching this repo's pre-commit config.

You can grab a free API key at https://twelvelabs.io — there's a generous free tier.

  • check and update documentation.

Note: I see this repo uses a CLA (.github/CLA.md). Happy to sign it as part of the review process — just let me know the current signing flow.

Adds an opt-in example Executor wrapping the TwelveLabs API:
- /embed serves Marengo multimodal embeddings (512-dim)
- /analyze serves Pegasus video understanding

The twelvelabs SDK is imported lazily, so core Jina-serve behaviour is
unchanged. Ships a config.yml, requirements, unit + live tests, a README
and a tutorial.
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