File tree Expand file tree Collapse file tree
ai/mcp/server/memory-core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,12 +56,6 @@ const defaultConfig = {
5656 clientId : process . env . OAUTH_CLIENT_ID || null ,
5757 clientSecret : process . env . OAUTH_CLIENT_SECRET || '' ,
5858 } ,
59- /**
60- * Provider to use for text embeddings ('gemini' or 'ollama')
61- * Used as the default fallback.
62- * @type {string }
63- */
64- embeddingProvider : process . env . EMBEDDING_PROVIDER || 'ollama' ,
6559 /**
6660 * Explicit override provider for the SQLite Native Database Engine.
6761 * @type {string }
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ class ChromaManager extends Base {
147147 generate : async ( texts ) => {
148148 // Pass arrays of texts sequentially or via promise.all to TextEmbeddingService
149149 const { default : TextEmbeddingService } = await import ( '../services/TextEmbeddingService.mjs' ) ;
150- const provider = aiConfig . chromaEmbeddingProvider || aiConfig . embeddingProvider ;
150+ const provider = aiConfig . chromaEmbeddingProvider ;
151151 const vectors = await Promise . all ( texts . map ( text => TextEmbeddingService . embedText ( text , provider ) ) ) ;
152152 return vectors ;
153153 } ,
Original file line number Diff line number Diff line change @@ -194,10 +194,10 @@ class HealthService extends Base {
194194 const providers = [ aiConfig . modelProvider ] ;
195195
196196 if ( aiConfig . engine === 'chroma' || aiConfig . engine === 'both' ) {
197- providers . push ( aiConfig . chromaEmbeddingProvider || aiConfig . embeddingProvider ) ;
197+ providers . push ( aiConfig . chromaEmbeddingProvider ) ;
198198 }
199199 if ( aiConfig . engine === 'neo' || aiConfig . engine === 'both' ) {
200- providers . push ( aiConfig . neoEmbeddingProvider || aiConfig . embeddingProvider ) ;
200+ providers . push ( aiConfig . neoEmbeddingProvider ) ;
201201 }
202202
203203 const needsGemini = providers . some ( p => p === 'gemini' ) ;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class TextEmbeddingService extends Base {
4040 construct ( config ) {
4141 super . construct ( config ) ;
4242
43- if ( aiConfig . embeddingProvider === 'gemini' || aiConfig . chromaEmbeddingProvider === 'gemini' || aiConfig . neoEmbeddingProvider === 'gemini' ) {
43+ if ( aiConfig . chromaEmbeddingProvider === 'gemini' || aiConfig . neoEmbeddingProvider === 'gemini' ) {
4444 const apiKey = process . env . GEMINI_API_KEY ;
4545 if ( ! apiKey ) {
4646 logger . warn ( '⚠️ [TextEmbeddingService] GEMINI_API_KEY not set. Semantic search features with Gemini will be unavailable.' ) ;
@@ -54,13 +54,13 @@ class TextEmbeddingService extends Base {
5454 /**
5555 * Creates an embedding vector for the provided text.
5656 * @param {String } text The text to embed.
57- * @param {String } [ explicitProvider=null] The embedding provider to use, bypassing config .
57+ * @param {String } explicitProvider The embedding provider to use.
5858 * @returns {Promise<number[]> }
5959 */
60- async embedText ( text , explicitProvider = null ) {
61- const provider = explicitProvider || aiConfig . embeddingProvider ;
60+ async embedText ( text , explicitProvider ) {
61+ if ( ! explicitProvider ) throw new Error ( 'TextEmbeddingService.embedText requires an explicit provider argument' ) ;
6262
63- if ( provider === 'ollama' ) {
63+ if ( explicitProvider === 'ollama' ) {
6464 const { host, embeddingModel } = aiConfig . ollama ;
6565 try {
6666 const response = await fetch ( `${ host } /api/embeddings` , {
You can’t perform that action at this time.
0 commit comments