{"record":{"id":"e89185ec47d35f63","repo":"mastra-ai/mastra","slug":"observational-memory-is-not-implemented-by-this-st","errorCode":null,"errorMessage":"Observational memory is not implemented by this storage adapter (${this.constructor.name}).","messagePattern":"Observational memory is not implemented by this storage adapter \\((.+?)\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/memory/base.ts","lineNumber":244,"sourceCode":"        orderBy?.direction && orderBy.direction in THREAD_THREAD_SORT_DIRECTION_SET\n          ? orderBy.direction\n          : defaultDirection,\n    };\n  }\n\n  // ============================================\n  // Observational Memory Methods\n  // ============================================\n\n  /**\n   * Get the current observational memory record for a thread/resource.\n   * Returns the most recent active record.\n   */\n  async getObservationalMemory(\n    _threadId: string | null,\n    _resourceId: string,\n  ): Promise<ObservationalMemoryRecord | null> {\n    throw new Error(`Observational memory is not implemented by this storage adapter (${this.constructor.name}).`);\n  }\n\n  /**\n   * Get observational memory history (previous generations).\n   * Returns records in reverse chronological order (newest first).\n   */\n  async getObservationalMemoryHistory(\n    _threadId: string | null,\n    _resourceId: string,\n    _limit?: number,\n    _options?: ObservationalMemoryHistoryOptions,\n  ): Promise<ObservationalMemoryRecord[]> {\n    throw new Error(`Observational memory is not implemented by this storage adapter (${this.constructor.name}).`);\n  }\n\n  /**\n   * Create a new observational memory record.\n   * Called when starting observations for a new thread/resource.","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/memory/base.ts#L226-L262","documentation":"Thrown by the base MemoryStorageDomain's getObservationalMemory default implementation. Unlike resource support, observational memory is an optional capability, and adapters that don't support it throw this explicit error rather than returning null, so callers know the feature is unavailable rather than merely empty.","triggerScenarios":"Calling getObservationalMemory(threadId, resourceId) — directly or via Memory with observational memory enabled — on an adapter that has no observational-memory overrides.","commonSituations":"Enabling observational memory in Memory config while using a storage adapter (e.g. older LibSQL, Upstash, or custom adapter) that hasn't implemented it; upgrading core but not the adapter package.","solutions":["Switch to a storage adapter that implements observational memory (e.g. current PostgreSQL, MongoDB, or InMemory adapter).","Upgrade your adapter package to the latest version supporting observational memory.","Disable observational memory in the Memory configuration if your adapter can't support it.","Implement the observational-memory method family in your custom adapter."],"exampleFix":"// before\nnew Mastra({ storage: new LegacyCustomStore() }); // memory: { observationalMemory: { enabled: true } }\n// after\nnew Mastra({ storage: new PostgresStore({ connectionString: url }) }); // implements observational memory","handlingStrategy":"fallback","validationCode":"// capability probe before relying on observational memory\nasync function hasObservationalMemory(storage: MastraStorage) {\n  try { await storage.getObservationalMemory(null, '__probe__'); return true; }\n  catch (e) { return !String((e as Error).message).includes('Observational memory is not implemented'); }\n}","typeGuard":"function supportsObservationalMemory(s: unknown): boolean {\n  const proto = Object.getPrototypeOf(s);\n  return Object.getPrototypeOf(proto) && 'initializeObservationalMemory' in proto &&\n    (s as any).constructor.name !== 'MastraStorage';\n}","tryCatchPattern":"let record: ObservationalMemoryRecord | null = null;\ntry {\n  record = await storage.getObservationalMemory(threadId, resourceId);\n} catch (e) {\n  if (String((e as Error).message).includes('Observational memory is not implemented')) {\n    record = null; // feature unsupported; degrade gracefully\n  } else throw e;\n}","preventionTips":["Check the adapter's documented observational-memory support before enabling the feature.","Pin adapter versions in package.json so an upgrade doesn't silently drop support.","Wrap observational-memory reads in a capability check util used everywhere."],"tags":["storage","observational-memory","unimplemented-method"],"backgroundTag":"storage-adapter-unimplemented-method","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}