Threads
Manage persistent, resumable conversations with useThreads and the Enterprise Intelligence Platform — list, create, rename, archive, and delete threads with realtime sync across devices.
What is this?#
CopilotKit threads enable persistent, resumable multi-turn conversations. The useThreads hook lists, creates, renames, archives, and deletes Enterprise Intelligence Platform threads with realtime synchronization via WebSocket. Threads work with any agent framework — the Enterprise Intelligence Platform stores conversation history server-side, so users can close their browser and pick up where they left off. It does not list or mutate native LangGraph, ADK, or other framework stores unless your backend explicitly bridges those systems. Thread metadata updates (renames, archives, new threads) appear on connected clients without polling.
Prebuilt thread UI: CopilotThreadsDrawer
The fastest way to add a thread switcher is the prebuilt
CopilotThreadsDrawer — drop
<CopilotThreadsDrawer /> next to your chat and it lists, switches,
archives, and deletes threads with no active-thread wiring. The useThreads
steps below are the headless path, for when you want to build the thread
UI yourself (and the way to add thread rename, which the prebuilt drawer
doesn't surface).
When should I use this?#
- Your app needs multiple saved conversations per user (like a chat history sidebar)
- Users should be able to resume a prior conversation across sessions or devices
- You want realtime sync so threads created on one tab appear on another
- You need to let users organize conversations by renaming or archiving them
Prerequisites#
- The Enterprise Intelligence Platform
- An OpenAI API key
- For the manual path: an existing CopilotKit project on
@copilotkit/react-corev1.56+
Implementation#
Next steps#
- Prebuilt UI: CopilotThreadsDrawer — the drop-in thread switcher (React reference)
- Thread architecture: Threads & Persistence Architecture — event replay model and WebSocket sync
- API reference: useThreads — parameters, return values, types