A2UI Launched: Full CopilotKit support at launch!

A2UI Launched: CopilotKit has partnered with Google to deliver full support in both CopilotKit and AG-UI!

Check it out
LogoLogo
  • Overview
  • Integrations
  • API Reference
  • Copilot Cloud
Slanted end borderSlanted end border
Slanted start borderSlanted start border
Select integration...

Please select an integration to view the sidebar content.

Persistence

Loading Agent State

Learn how threadId is used to load previous agent states.

Setting the threadId

When setting the threadId property in CopilotKit, i.e:

When using LangGraph platform, the threadId must be a UUID.

<CopilotKit threadId="2140b272-7180-410d-9526-f66210918b13">
  <YourApp />
</CopilotKit>

CopilotKit will restore the complete state of the thread, including the messages, from the database. (See Message Persistence for more details.)

Loading Agent State

This means that the state of any agent will also be restored. For example:

const { state } = useCoAgent({name: "research_agent"});

// state will now be the state of research_agent in the thread id given above

Learn More

To learn more about persistence and state in CopilotKit, see:

  • Reading agent state
  • Writing agent state
  • Loading Message History
PREV
Authentication
Slanted end borderSlanted end border
Slanted start borderSlanted start border
NEXT
Threads

On this page

Setting the threadId
Loading Agent State
Learn More