mastra-ai/mastra · error · MastraError
MASTRA_MEMORY_STORAGE_NOT_AVAILABLE
MASTRA_MEMORY_STORAGE_NOT_AVAILABLE
Error message
Memory storage is not supported by this storage adapter
What it means
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.
Source
Thrown at packages/core/src/memory/mock.ts:105
options: {
...options,
workingMemory: enableWorkingMemory
? ({
...options?.workingMemory,
enabled: true,
...(workingMemoryTemplate !== undefined ? { template: workingMemoryTemplate } : {}),
} as WorkingMemory)
: options?.workingMemory,
lastMessages: enableMessageHistory ? (options?.lastMessages ?? 10) : options?.lastMessages,
},
});
this._hasOwnStorage = true;
}
protected async getMemoryStore(): Promise<MemoryStorage> {
const store = await this.storage.getStore('memory');
if (!store) {
throw new MastraError({
id: 'MASTRA_MEMORY_STORAGE_NOT_AVAILABLE',
domain: ErrorDomain.MASTRA_MEMORY,
category: ErrorCategory.SYSTEM,
text: 'Memory storage is not supported by this storage adapter',
});
}
return store;
}
async getThreadById({ threadId }: { threadId: string }): Promise<StorageThreadType | null> {
const memoryStorage = await this.getMemoryStore();
return memoryStorage.getThreadById({ threadId });
}
async saveThread({
thread,
}: {
thread: StorageThreadType;View on GitHub (pinned to 75dd419e61)
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.
Example fix
// before
const memory = new Memory({ storage: new CustomMinimalStore() });
// after
const memory = new Memory({ storage: new LibSQLStore({ url: 'file:mastra.db' }) }); Defensive patterns
Strategy: try-catch
Validate before calling
const store = await (memory as any).storage?.getStore?.('memory');
if (!store) throw new Error('Selected storage adapter does not support memory storage'); Type guard
function supportsMemoryStore(s: unknown): s is { getStore(k: 'memory'): Promise<unknown> & nonNullable } {
return typeof (s as any)?.getStore === 'function';
} Try / catch
try {
await memory.memoryStorage;
} catch (e) {
if ((e as MastraError).id === 'MASTRA_MEMORY_STORAGE_NOT_AVAILABLE') {
// swap to a full-featured storage adapter or degrade gracefully
} else throw e;
} Prevention
- 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').
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- AcpAgent does not support resuming suspended stream calls
- ClaudeSDKAgent resumeData must include a message.
- @mastra/opencode: failed to initialize memory storage from $
- sendStateSignal could not load thread ${threadId}
- Storage is not configured on this AgentController
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/c5fe185fff9e1568.
Report an issue: GitHub.