{"record":{"id":"811ec3805a2fab75","repo":"mastra-ai/mastra","slug":"semantic-recall-missing-embedder","errorCode":"SEMANTIC_RECALL_MISSING_EMBEDDER","errorMessage":"Using Mastra Memory semantic recall requires an embedder but no attached embedder was detected.","messagePattern":"Using Mastra Memory semantic recall requires an embedder but no attached embedder was detected\\.","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/memory/memory.ts","lineNumber":836,"sourceCode":"    if (effectiveConfig.semanticRecall) {\n      if (!memoryStore)\n        throw new MastraError({\n          category: 'USER',\n          domain: ErrorDomain.STORAGE,\n          id: 'SEMANTIC_RECALL_MISSING_STORAGE_ADAPTER',\n          text: 'Using Mastra Memory semantic recall requires a storage adapter but no attached adapter was detected.',\n        });\n\n      if (!this.vector)\n        throw new MastraError({\n          category: 'USER',\n          domain: ErrorDomain.MASTRA_VECTOR,\n          id: 'SEMANTIC_RECALL_MISSING_VECTOR_ADAPTER',\n          text: 'Using Mastra Memory semantic recall requires a vector adapter but no attached adapter was detected.',\n        });\n\n      if (!this.embedder)\n        throw new MastraError({\n          category: 'USER',\n          domain: ErrorDomain.MASTRA_VECTOR,\n          id: 'SEMANTIC_RECALL_MISSING_EMBEDDER',\n          text: 'Using Mastra Memory semantic recall requires an embedder but no attached embedder was detected.',\n        });\n\n      // Check if user already manually added SemanticRecall\n      const hasSemanticRecall = configuredProcessors.some(p => !isProcessorWorkflow(p) && p.id === 'semantic-recall');\n\n      if (!hasSemanticRecall) {\n        const semanticConfig = typeof effectiveConfig.semanticRecall === 'object' ? effectiveConfig.semanticRecall : {};\n\n        // Probe the embedder for its actual dimension to generate the correct index name.\n        // This ensures the processor uses the same dimension-aware index name as recall().\n        const embeddingDimension = await this.getEmbeddingDimension();\n        const indexName = this.getEmbeddingIndexName(embeddingDimension);\n\n        processors.push(","sourceCodeStart":818,"sourceCodeEnd":854,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/memory/memory.ts#L818-L854","documentation":"Semantic recall must embed the current user message to search the vector store. getInputProcessors therefore checks `this.embedder`; if no embedding model is attached, this MastraError is thrown. Storage and vector alone are not sufficient — an embedder produces the query vector.","triggerScenarios":"Memory has storage and vector adapters and `semanticRecall` enabled, but no `embedder` was provided to the Memory constructor (or resolvable embedding model), when getInputProcessors runs during generate/stream.","commonSituations":"Forgetting the `embedder` option after adding storage and vector; assuming the LLM model also does embeddings; older configs where embedder defaulted from another option; renamed config keys across major versions.","solutions":["Add an embedder: `new Memory({ storage, vector, embedder: embed('text-embedding-3-small'), options: { semanticRecall: {...} } })` (or `new Fastembed()` etc.).","Verify the embedder key is not misspelled and the embedding model id is valid.","Disable semanticRecall if embedding-based recall is not intended."],"exampleFix":"// before\nconst memory = new Memory({ storage, vector, options: { semanticRecall: { topK: 5 } } });\n// after\nimport { embed } from '@mastra/core/llm';\nconst memory = new Memory({\n  storage, vector,\n  embedder: embed('text-embedding-3-small'),\n  options: { semanticRecall: { topK: 5 } },\n});","handlingStrategy":"validation","validationCode":"function assertEmbedderForSemanticRecall(memory) {\n  if (memory.threadConfig?.semanticRecall && !(memory as any).embedder) {\n    throw new Error('semanticRecall enabled but no embedder attached to Memory');\n  }\n}","typeGuard":"function hasEmbedder(m): m is MastraMemory & { embedder: NonNullable<MastraMemory['embedder']> } {\n  return Boolean((m as any).embedder);\n}","tryCatchPattern":null,"preventionTips":["Use a config factory that requires embedder whenever semanticRecall is set.","Validate the embedding model id at construction time.","Keep storage/vector/embedder declared together in one Memory options block."],"tags":["memory","embedder","semantic-recall","configuration"],"backgroundTag":"missing-embedder","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}