[langchain-mongodb-deepagents-vfs] Add Embedder provider: voyageai

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: ABX
    • None
    • None
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Goal

      Add voyageai as a third client-side embedding provider in Embedder, alongside the existing bedrock and openai providers.

      Voyage AI is MongoDB's own embedding stack and the provider behind Atlas auto-embedding, so it is the natural default recommendation for this package even before auto-embedding lands (see related ticket).

      Current state (verified on branch pr-415-merge, PR #415)

      Item Status
      Embedder._build_model() provider branch exists — branches on "openai", else falls through to bedrock (embedder.py)
      Provider resolution via EMBEDDING_PROVIDER env var exists, default bedrock
      Model override via EMBEDDING_MODEL env var exists
      Extras [openai], [bedrock] pyproject.toml [project.optional-dependencies]
      Extra [voyageai] to add
      Provider table in README.md exists — "Embedding provider selection"; needs a third row
      tests/unit_tests/test_embedder.py exists — mirror existing provider-selection tests

      Scope

      1. Add a "voyageai" branch to Embedder._build_model(), importing VoyageAIEmbeddings from langchain-voyageai inside the branch and raising AdapterError on ImportError — same shape as the existing openai branch.
      2. Add voyageai = ["langchain-voyageai>=..."] to [project.optional-dependencies].
      3. Add a _VOYAGE_DEFAULT_MODEL constant and wire it into the resolved_name fallback chain.
      4. Update the module docstring in embedder.py (it enumerates supported providers).
      5. Update README.md: the install-extras block and the "Embedding provider selection" table (default model, required credential VOYAGE_API_KEY).
      6. Add a unit test asserting provider selection, following the existing pattern. Do not call the live API.
      7. Refresh uv.lock.

      Acceptance criteria

      • EMBEDDING_PROVIDER=voyageai yields a working Embedder at the package's default 1024 dimensions.
      • Omitting the [voyageai] extra produces a clear AdapterError, not a bare ImportError.
      • ruff, mypy --strict, and unit tests pass; uv lock --check is in sync.
      • README documents the provider and its credential.

      Decisions needed

      1. Default model. voyage-3-large and voyage-3.5 both support 1024-dimension output, matching the package default of 1024, so neither forces a dimension change. voyage-3.5 is the cheaper general-purpose option; voyage-3-large the higher-quality one. There are also domain models (voyage-code-3, voyage-finance-2, voyage-law-2) — relevant since this package indexes arbitrary S3 documents.
      2. Become the recommended provider? The current default is bedrock. Options: (a) leave bedrock default, document Voyage as recommended; (b) switch the default to voyageai — a behavior change for anyone relying on the env-var default.
      3. Sequence against auto-embedding. If Atlas auto-embedding is adopted, server-side embedding also uses Voyage models and this client-side provider becomes redundant for most users. Options: (a) do both, client-side provider is still needed for non-Atlas fallback; (b) skip this and go straight to auto-embedding.

      Notes

      • Verify the dimension-control kwarg before implementing: OpenAIEmbeddings takes dimensions=, but VoyageAIEmbeddings uses a different parameter name for output dimension. The existing openai branch passes
        dimensions=dimensions, so this cannot be copied verbatim.
      • Embedder is the only module that touches a provider — the rest of the stack depends solely on this class, so the change is genuinely contained.

            Assignee:
            Unassigned
            Reporter:
            Casey Clements
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: