showcase/integrations/langgraph-fastapi/qa/shared-state-read-write.md
/api/copilotkit GET — agent_status: "reachable")OPENAI_API_KEY is set in the agent environmentpreferences object straight into agent state via agent.setState.set_notes tool the
notes slice of agent state updates and the Notes card re-renders.PreferencesInjectorMiddleware reads
preferences out of state every turn and prepends it to the system
prompt, so the next reply visibly adapts./demos/shared-state-read-writedata-testid="preferences-card") is visibledata-testid="notes-card") is visibledata-testid="notes-empty")pref-name (e.g. "Atai") — the JSON in
pref-state-json updates immediatelypref-tone — JSON reflects itpref-language — JSON reflects itinterests array updatesset_notesnotes-emptynote-item appears with each remembered factnotes-clear-buttonnotes-empty immediatelypref-state-json immediately