mastra-ai/mastra · error · Error
Semantic recall requires an embedder to be configured. http
Error message
Semantic recall requires an embedder to be configured. https://mastra.ai/en/docs/memory/semantic-recall
What it means
Memory's semantic recall feature stores message embeddings in a vector database and retrieves them by similarity, which requires an embedding model (embedder) to convert text into vectors. Memory throws this Error in its constructor when semantic recall is enabled but config.embedder is not provided. It fails fast at construction time rather than at first recall, so misconfiguration is caught immediately.
Source
Thrown at packages/core/src/memory/memory.ts:181
);
}
if (config.storage) {
this._storage = augmentWithInit(config.storage);
this._hasOwnStorage = true;
}
if (this.threadConfig.semanticRecall) {
if (!config.vector) {
throw new Error(
`Semantic recall requires a vector store to be configured.
https://mastra.ai/en/docs/memory/semantic-recall`,
);
}
this.vector = config.vector;
if (!config.embedder) {
throw new Error(
`Semantic recall requires an embedder to be configured.
https://mastra.ai/en/docs/memory/semantic-recall`,
);
}
// Convert string embedder to ModelRouterEmbeddingModel
if (typeof config.embedder === 'string') {
this.embedder = new ModelRouterEmbeddingModel(config.embedder);
} else {
this.embedder = config.embedder;
}
// Set embedder options (e.g., providerOptions for Google models)
if (config.embedderOptions) {
this.embedderOptions = config.embedderOptions;
}
} else {View on GitHub (pinned to 75dd419e61)
Solutions
- Pass an embedder in the Memory config, e.g. embedder: new FastEmbed() or an AI SDK embedding model via embedMany-compatible wrapper.
- If you do not need semantic recall, remove the semanticRecall option from memory options.
- Verify the config object shape: semanticRecall requires BOTH vector (vector store) and embedder.
Example fix
// before
const memory = new Memory({
options: { semanticRecall: { topK: 5 } },
vector: new PgVector connectionString,
});
// after
const memory = new Memory({
embedder: new FastEmbed(),
vector: new PgVector(connectionString),
options: { semanticRecall: { topK: 5 } },
}); Defensive patterns
Strategy: validation
Validate before calling
function assertEmbedder(config) {
if (config?.options?.semanticRecall && !config.embedder) {
throw new Error('semanticRecall requires an embedder in Memory config');
}
} Prevention
- Always pass embedder alongside vector when enabling semanticRecall.
- Centralize Memory construction in one factory function so required fields are not dropped.
- Add a unit test that constructs Memory with your production config.
When it happens
Trigger: new Memory({ options: { semanticRecall: true/..., vector: <store> } }) without an embedder property in the config object.
Common situations: Developers add a vector store (e.g. PgVector) for semantic recall but forget to also pass an embedder like fastembed or an AI SDK embedding model; copying old snippets where the embedder defaulted or was optional; switching Memory configs and dropping the embedder field during refactors.
Related errors
- Semantic recall requires a vector store to be configured. h
- Tried to create embedding index but no vector db is attached
- SEMANTIC_RECALL_MISSING_STORAGE_ADAPTER
- SEMANTIC_RECALL_MISSING_VECTOR_ADAPTER
- SEMANTIC_RECALL_MISSING_EMBEDDER
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/26a36099ce6f609f.
Report an issue: GitHub.