Skip to content
Star

LangGraph SDK

Render messages from a LangGraph client you manage outside React.

Read messages from graph state

Install Ghost UI and its view dependencies, then add the tested SDK.

Install dependencies

Use the direct SDK when a server, store, or service already manages the run. For a React-owned client, use LangChain useStream.

langgraph-values.ts

Create your Client({ apiUrl }) with application authentication, select/create a real thread and consume the generator into your existing store. Each yielded messages array is a replacement snapshot, not a list to append again. Render it with the plain-data composition, or expose the store through runtime integration.

Native state and lifecycle

values can contain graph fields beyond messages; the example retains the native state alongside the projection. Validate those fields before application rendering. The SDK owns network stream decoding. Ghost neither reconstructs graph deltas nor creates another graph store.

Use native checkpoint, interrupt, task and run APIs for branching and resumption. An aborted reader is not proof of remote cancellation; use the SDK's run cancellation command for your selected native run. Keep its run ID and eventual status. See the LangGraph SDK reference for these richer operations.

Troubleshooting

Pass complete values snapshots to the normalizer and replace the current view on each update. Give messages a stable ID when the SDK supplies none. Use thread and revision to discard late results from a replaced run.