-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: ABX
-
None
-
None
-
Python Drivers
-
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 | |
| Provider resolution via EMBEDDING_PROVIDER env var | |
| Model override via EMBEDDING_MODEL env var | |
| Extras [openai], [bedrock] | |
| Extra [voyageai] | |
| Provider table in README.md | |
| tests/unit_tests/test_embedder.py |
Scope
- 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.
- Add voyageai = ["langchain-voyageai>=..."] to [project.optional-dependencies].
- Add a _VOYAGE_DEFAULT_MODEL constant and wire it into the resolved_name fallback chain.
- Update the module docstring in embedder.py (it enumerates supported providers).
- Update README.md: the install-extras block and the "Embedding provider selection" table (default model, required credential VOYAGE_API_KEY).
- Add a unit test asserting provider selection, following the existing pattern. Do not call the live API.
- 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
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.
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.
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.
- is blocked by
-
INTPYTHON-1028 Engineering review of PR #415: langchain-mongodb-deepagents-vfs package
-
- In Progress
-