Skip to Content
ReferenceMemory.getThreadsByResourceId()

getThreadsByResourceId Reference

The getThreadsByResourceId function retrieves all threads associated with a specific resource ID from storage.

Usage Example

import { Memory } from "@mastra/core/memory"; const memory = new Memory(config); const threads = await memory.getThreadsByResourceId({ resourceId: "resource-123", });

Parameters

resourceId:

string
The ID of the resource whose threads are to be retrieved.

Returns

StorageThreadType[]:

Promise
A promise that resolves to an array of threads associated with the given resource ID.