liveBook · Manning

Thread id

As explained in Build Python Web Apps with Streamlit

A thread ID is an identifier that associates multiple graph invocations with the same persisted conversation state.

A thread ID links multiple graph invocations to the same persisted conversation state. Without one, every follow-up starts as a separate execution and the chatbot forgets earlier messages. section 10.3.1

A checkpointer stores graph state after each step. Passing the same thread ID on later invocations tells the graph to restore that thread instead of starting from a clean slate. Different IDs create separate conversation histories. section 10.3.1

Remembering a support conversation

Compile the graph with a MemorySaver checkpointer, configure {"configurable": {"thread_id": "1"}}, and pass that configuration to graph.invoke. Later invocations using thread ID "1" can recall information from the earlier exchange.

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains independent executions, checkpointer storage, configuration, and invocation, but not thread-ID generation or durable storage design.
Examples
Uses a support chatbot that remembers earlier information and a configuration containing thread ID "1".
What it assumes
Assumes a LangGraph graph and introduces checkpointer-backed state persistence before applying thread configuration.
What you can do after
Apply it via LangGraph to preserve conversation context across repeated invocations.
How it connects
Connects thread IDs with checkpointers, graph state, and graph invocations.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.