Back to Copilotkit

Shared State Setup

showcase/integrations/claude-sdk-python/docs/setup/shared-state-setup.mdx

1.63.1421 B
Original Source
<Steps> <Step> ### Put shared state in the system prompt and tools
The demo exposes frontend preferences to Claude and gives the agent a tool
for writing notes back into CopilotKit state. Keep the state contract small,
typed, and mirrored by the UI components that read the same values.

<DemoCode file="src/agents/shared_state_read_write_agent.py" region="shared-state-setup" />
</Step> </Steps>