Skip to main content
Mastra 1.0 is available 🎉 Read announcement

Memory.getThreadById()

The .getThreadById() method retrieves a specific thread by its ID.

Usage Example
Direct link to Usage Example

await memory?.getThreadById({ threadId: "thread-123" });

Parameters
Direct link to Parameters

threadId:

string
The ID of the thread to be retrieved.

Returns
Direct link to Returns

thread:

Promise<StorageThreadType | null>
A promise that resolves to the thread associated with the given ID, or null if not found.
On this page