{"record":{"id":"c5fe185fff9e1568","repo":"mastra-ai/mastra","slug":"mastra-memory-storage-not-available","errorCode":"MASTRA_MEMORY_STORAGE_NOT_AVAILABLE","errorMessage":"Memory storage is not supported by this storage adapter","messagePattern":"Memory storage is not supported by this storage adapter","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/memory/mock.ts","lineNumber":105,"sourceCode":"      options: {\n        ...options,\n        workingMemory: enableWorkingMemory\n          ? ({\n              ...options?.workingMemory,\n              enabled: true,\n              ...(workingMemoryTemplate !== undefined ? { template: workingMemoryTemplate } : {}),\n            } as WorkingMemory)\n          : options?.workingMemory,\n        lastMessages: enableMessageHistory ? (options?.lastMessages ?? 10) : options?.lastMessages,\n      },\n    });\n    this._hasOwnStorage = true;\n  }\n\n  protected async getMemoryStore(): Promise<MemoryStorage> {\n    const store = await this.storage.getStore('memory');\n    if (!store) {\n      throw new MastraError({\n        id: 'MASTRA_MEMORY_STORAGE_NOT_AVAILABLE',\n        domain: ErrorDomain.MASTRA_MEMORY,\n        category: ErrorCategory.SYSTEM,\n        text: 'Memory storage is not supported by this storage adapter',\n      });\n    }\n    return store;\n  }\n\n  async getThreadById({ threadId }: { threadId: string }): Promise<StorageThreadType | null> {\n    const memoryStorage = await this.getMemoryStore();\n    return memoryStorage.getThreadById({ threadId });\n  }\n\n  async saveThread({\n    thread,\n  }: {\n    thread: StorageThreadType;","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/memory/mock.ts#L87-L123","documentation":"MockMemory (or a memory wrapper) resolves its MemoryStorage via `this.storage.getStore('memory')`. When the attached storage adapter does not implement/expose a memory store, this SYSTEM-category MastraError is thrown instead of returning a null store. It signals the chosen storage backend cannot back memory features.","triggerScenarios":"Calling getMemoryStore (e.g. via the memoryStorage accessor) on a Memory whose storage adapter returns no store for the 'memory' domain — e.g. a storage adapter that does not implement memory persistence or is misconfigured/incomplete.","commonSituations":"Using a minimal or custom storage adapter that only implements some stores; passing the wrong adapter type (vector or non-memory storage) as `storage`; adapter versions where memory store support was added later.","solutions":["Use a full-featured storage adapter that implements memory storage (e.g. LibSQLStore, PostgresStore, UpstashStore).","Upgrade the storage adapter package to a version supporting `getStore('memory')`.","If using a custom adapter, implement the memory store interface so getStore('memory') returns a valid store."],"exampleFix":"// before\nconst memory = new Memory({ storage: new CustomMinimalStore() });\n// after\nconst memory = new Memory({ storage: new LibSQLStore({ url: 'file:mastra.db' }) });","handlingStrategy":"try-catch","validationCode":"const store = await (memory as any).storage?.getStore?.('memory');\nif (!store) throw new Error('Selected storage adapter does not support memory storage');","typeGuard":"function supportsMemoryStore(s: unknown): s is { getStore(k: 'memory'): Promise<unknown> & nonNullable } {\n  return typeof (s as any)?.getStore === 'function';\n}","tryCatchPattern":"try {\n  await memory.memoryStorage;\n} catch (e) {\n  if ((e as MastraError).id === 'MASTRA_MEMORY_STORAGE_NOT_AVAILABLE') {\n    // swap to a full-featured storage adapter or degrade gracefully\n  } else throw e;\n}","preventionTips":["Choose storage adapters from the officially supported list.","Keep storage adapter packages on versions matching your Mastra core version.","For custom adapters, implement and test getStore('memory')."],"tags":["memory","storage","adapter","unsupported"],"backgroundTag":"storage-adapter-not-supported","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}