Skip to content

feat(memory): add Voyage AI embedding provider#461

Open
luongndcoder wants to merge 1 commit intonextlevelbuilder:mainfrom
luongndcoder:feat/voyage-embedding-provider
Open

feat(memory): add Voyage AI embedding provider#461
luongndcoder wants to merge 1 commit intonextlevelbuilder:mainfrom
luongndcoder:feat/voyage-embedding-provider

Conversation

@luongndcoder
Copy link

Summary

  • Add VoyageEmbeddingProvider in internal/memory/voyage_embedding.go — a dedicated Voyage AI implementation that calls https://api.voyageai.com/v1/embeddings directly, with support for the input_type param ("query" / "document") for improved asymmetric retrieval quality
  • Add ProviderVoyage = "voyage" constant and register it in ValidProviderTypes so users can create a Voyage provider via the API or UI
  • Update buildEmbeddingProvider in cmd/gateway_agents.go to route the voyage provider type through VoyageEmbeddingProvider (Voyage is embedding-only; it has no chat API), with voyage-4 as the default model
  • Add Voyage AI to the UI provider type selector (ui/web/src/constants/providers.ts) with the API base pre-filled

Motivation

Voyage AI produces state-of-the-art embeddings for retrieval, especially for code and domain-specific corpora. The existing OpenAIEmbeddingProvider cannot be used for Voyage because:

  1. Voyage's input_type field (query vs document distinction) is not part of the OpenAI spec
  2. Voyage has no chat endpoint — it should never be registered as a chat provider in the registry

This PR adds a thin, dedicated provider that satisfies the EmbeddingProvider interface and integrates cleanly with the existing embedding resolution flow.

Test plan

  • Add a provider with type voyage and a valid Voyage AI API key via the UI
  • Set embedding.provider in system configs to the provider name
  • Send a message that triggers memory storage — verify embeddings are generated with model voyage-4
  • Confirm input_type can be omitted (default) or configured per deployment

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`).
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