@personaai/sdkv0.9.0

Threads

Conversation scope — create, list, resume, reset

Threads

Threads scope messages, files, and memory to one conversation. The runtime and React auto-load them.

Create

ts
const thread = await userClient.threads.create({ agentId: agent._id });// { _id, title, agentId, createdAt }

In React, useChat mints lazily when threadId is undefined (see ) — no create needed.

Resume

ts
// Same thread next turnawait userClient.chat.stream(agent._id, {  messages: [{ role: 'user', content: 'follow-up' }],  threadId: thread._id,});

In the runtime: GET /threads/:id/messages loads history; POST /threads/:id/reset clears it in place. See .