Skip to main content
Mastra v1 is coming in January 2026. Get ahead by starting new projects with the beta or upgrade your existing project today.

Memory.getThreadById()

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

Usage ExampleDirect link to Usage Example

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

ParametersDirect link to Parameters

threadId:

string
The ID of the thread to be retrieved.

ReturnsDirect 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