mastra-ai/mastra · error · MastraError
SEMANTIC_RECALL_MISSING_EMBEDDER
SEMANTIC_RECALL_MISSING_EMBEDDER
Error message
Using Mastra Memory semantic recall requires an embedder but no attached embedder was detected.
What it means
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.
Source
Thrown at packages/core/src/memory/memory.ts:836
if (effectiveConfig.semanticRecall) {
if (!memoryStore)
throw new MastraError({
category: 'USER',
domain: ErrorDomain.STORAGE,
id: 'SEMANTIC_RECALL_MISSING_STORAGE_ADAPTER',
text: 'Using Mastra Memory semantic recall requires a storage adapter but no attached adapter was detected.',
});
if (!this.vector)
throw new MastraError({
category: 'USER',
domain: ErrorDomain.MASTRA_VECTOR,
id: 'SEMANTIC_RECALL_MISSING_VECTOR_ADAPTER',
text: 'Using Mastra Memory semantic recall requires a vector adapter but no attached adapter was detected.',
});
if (!this.embedder)
throw new MastraError({
category: 'USER',
domain: ErrorDomain.MASTRA_VECTOR,
id: 'SEMANTIC_RECALL_MISSING_EMBEDDER',
text: 'Using Mastra Memory semantic recall requires an embedder but no attached embedder was detected.',
});
// Check if user already manually added SemanticRecall
const hasSemanticRecall = configuredProcessors.some(p => !isProcessorWorkflow(p) && p.id === 'semantic-recall');
if (!hasSemanticRecall) {
const semanticConfig = typeof effectiveConfig.semanticRecall === 'object' ? effectiveConfig.semanticRecall : {};
// Probe the embedder for its actual dimension to generate the correct index name.
// This ensures the processor uses the same dimension-aware index name as recall().
const embeddingDimension = await this.getEmbeddingDimension();
const indexName = this.getEmbeddingIndexName(embeddingDimension);
processors.push(View on GitHub (pinned to 75dd419e61)
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.
Example fix
// before
const memory = new Memory({ storage, vector, options: { semanticRecall: { topK: 5 } } });
// after
import { embed } from '@mastra/core/llm';
const memory = new Memory({
storage, vector,
embedder: embed('text-embedding-3-small'),
options: { semanticRecall: { topK: 5 } },
}); Defensive patterns
Strategy: validation
Validate before calling
function assertEmbedderForSemanticRecall(memory) {
if (memory.threadConfig?.semanticRecall && !(memory as any).embedder) {
throw new Error('semanticRecall enabled but no embedder attached to Memory');
}
} Type guard
function hasEmbedder(m): m is MastraMemory & { embedder: NonNullable<MastraMemory['embedder']> } {
return Boolean((m as any).embedder);
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Semantic recall requires a vector store to be configured. h
- Semantic recall requires an embedder to be configured. http
- Tried to create embedding index but no vector db is attached
- SEMANTIC_RECALL_MISSING_STORAGE_ADAPTER
- SEMANTIC_RECALL_MISSING_VECTOR_ADAPTER
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/811ec3805a2fab75.
Report an issue: GitHub.