{"record":{"id":"c9df8c073bc26fcc","repo":"mastra-ai/mastra","slug":"semantic-recall-missing-vector-adapter","errorCode":"SEMANTIC_RECALL_MISSING_VECTOR_ADAPTER","errorMessage":"Using Mastra Memory semantic recall requires a vector adapter but no attached adapter was detected.","messagePattern":"Using Mastra Memory semantic recall requires a vector adapter but no attached adapter was detected\\.","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/memory/memory.ts","lineNumber":828,"sourceCode":"            storage: memoryStore,\n            lastMessages: typeof lastMessages === 'number' ? lastMessages : undefined,\n          }),\n        );\n      }\n    }\n\n    // Add semantic recall input processor if configured\n    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) {","sourceCodeStart":810,"sourceCodeEnd":846,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/memory/memory.ts#L810-L846","documentation":"Semantic recall performs vector similarity search over stored message embeddings. After confirming storage exists, getInputProcessors checks `this.vector`; if no vector adapter is attached to the Memory instance, this MastraError is thrown. Semantic recall is impossible without a vector store to query.","triggerScenarios":"Memory configured with `semanticRecall` and a storage adapter but constructed without a `vector` adapter (e.g. `new Memory({ storage, options: { semanticRecall: {...} } })` with no `vector`), then running a generate/stream that builds input processors.","commonSituations":"Developers assume the storage adapter doubles as a vector store; older Mastra versions resolved vectors from storage, newer versions require an explicit vector adapter; using a storage-only adapter like LibSQL without a vector integration.","solutions":["Attach a vector adapter: `new Memory({ storage, vector: new PgVector({...}), options: { semanticRecall: {...} } })`.","Use a storage adapter that also provides vector support and pass it as `vector` as well if it implements MastraVector.","Disable semanticRecall if vector search is not required."],"exampleFix":"// before\nconst memory = new Memory({ storage, options: { semanticRecall: { topK: 5 } } });\n// after\nconst memory = new Memory({\n  storage,\n  vector: new PgVector({ connectionString: process.env.DATABASE_URL }),\n  options: { semanticRecall: { topK: 5 } },\n});","handlingStrategy":"validation","validationCode":"function assertVectorForSemanticRecall(memory) {\n  if (memory.threadConfig?.semanticRecall && !(memory as any).vector) {\n    throw new Error('semanticRecall enabled but no vector adapter attached to Memory');\n  }\n}","typeGuard":"function hasVector(m): m is MastraMemory & { vector: NonNullable<MastraMemory['vector']> } {\n  return Boolean((m as any).vector);\n}","tryCatchPattern":null,"preventionTips":["Pair every semanticRecall config with both a vector adapter and an embedder.","Remember storage adapters and vector adapters are separate; do not conflate them.","Add a startup smoke test that builds input processors once to fail fast."],"tags":["memory","vector","semantic-recall","configuration"],"backgroundTag":"missing-vector-adapter","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}