feat(memory): add Voyage AI embedding provider#461
Open
luongndcoder wants to merge 1 commit intonextlevelbuilder:mainfrom
Open
feat(memory): add Voyage AI embedding provider#461luongndcoder wants to merge 1 commit intonextlevelbuilder:mainfrom
luongndcoder wants to merge 1 commit intonextlevelbuilder:mainfrom
Conversation
Introduce first-class support for Voyage AI as a dedicated embedding
provider, separate from the generic OpenAI-compatible path.
- Add `VoyageEmbeddingProvider` in `internal/memory/voyage_embedding.go`
with support for the `input_type` param ("query"/"document") that
improves retrieval quality for asymmetric use cases. Default model
is `voyage-4`.
- Add `ProviderVoyage = "voyage"` constant and register it in
`ValidProviderTypes` so it can be created via the API/UI.
- Update `buildEmbeddingProvider` in `cmd/gateway_agents.go` to route
`voyage` provider type through `VoyageEmbeddingProvider` directly
(Voyage is embedding-only; no chat API), with `voyage-4` as the
per-provider default model.
- Add Voyage AI entry to the UI provider type selector with the correct
API base pre-filled (`https://api.voyageai.com/v1`).
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.
Summary
VoyageEmbeddingProviderininternal/memory/voyage_embedding.go— a dedicated Voyage AI implementation that callshttps://api.voyageai.com/v1/embeddingsdirectly, with support for theinput_typeparam ("query"/"document") for improved asymmetric retrieval qualityProviderVoyage = "voyage"constant and register it inValidProviderTypesso users can create a Voyage provider via the API or UIbuildEmbeddingProviderincmd/gateway_agents.goto route thevoyageprovider type throughVoyageEmbeddingProvider(Voyage is embedding-only; it has no chat API), withvoyage-4as the default modelui/web/src/constants/providers.ts) with the API base pre-filledMotivation
Voyage AI produces state-of-the-art embeddings for retrieval, especially for code and domain-specific corpora. The existing
OpenAIEmbeddingProvidercannot be used for Voyage because:input_typefield (query vs document distinction) is not part of the OpenAI specThis PR adds a thin, dedicated provider that satisfies the
EmbeddingProviderinterface and integrates cleanly with the existing embedding resolution flow.Test plan
voyageand a valid Voyage AI API key via the UIembedding.providerin system configs to the provider namevoyage-4input_typecan be omitted (default) or configured per deployment