Replies: 4 comments
-
converted it to a discussion. I like this a lot for what it is worth |
Beta Was this translation helpful? Give feedback.
-
Thank you for making this a discussion! Interested to see what others have to say. @The-Best-Codes @iandouglas @michaelneale |
Beta Was this translation helpful? Give feedback.
-
Don't forget other embedding providers, like Google embedding models for instance! The plan seems solid to me. Once I see some code in a PR I might have more feedback :) |
Beta Was this translation helpful? Give feedback.
-
I agree should not be coupled to a provider necessarily, perfectly valid to even use a local embedding model with a frontier chat model. one other thing to note - if this is for router tool selection - may not need this at all: #3933 (there may be other uses of embeddings and so on so it may end up still valid) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
RFC: Orthogonal EmbeddingService Architecture for Flexible Embedding Provider Support
Summary
This RFC proposes refactoring Goose's embedding functionality into an orthogonal
EmbeddingService
trait, separate from the mainProvider
trait. This design enables mixing different embedding providers with chat providers (e.g., Ollama embeddings with OpenAI chat), improves local embedding model support, and resolves existing compatibility issues.Motivation
Currently, embedding functionality is tightly coupled to the Provider trait, which creates several limitations:
Related Issues This Solves
Fixes Router Tool Selection Strategy Vector always fails with local text embedding models #3027 - "Router Tool Selection Strategy Vector always fails with local text embedding models"
Addresses remote Ollama limitations (Allow remote Ollama #844, Allow custom Ollama #846)
Proposed Solution
1. New
EmbeddingService
Trait2. Provider Trait Extension
3. Concrete Implementations
/api/embeddings
and OpenAI-compatible endpointsBenefits
Flexibility: Mix and match embedding providers with chat providers
Better Local Support: Properly handles different embedding dimensions
Backward Compatibility: Maintains existing API with deprecation warnings
Extensibility: Easy to add new embedding providers
Implementation Status
I have a working implementation that includes:
EmbeddingService
trait and infrastructureOllamaEmbeddingService
with dimension auto-detectionOpenAIEmbeddingService
with model-specific dimensionsVectorToolSelector
to useEmbeddingService
Example Usage
Questions for Discussion
Next Steps
If this approach is approved, I can submit a PR with the implementation. The changes are designed to be backward compatible while providing a clear path forward for more flexible embedding support.
Beta Was this translation helpful? Give feedback.
All reactions