Understanding State Management with Gradio and LangGraph

Hi everyone,

I’m working on an agentic workflow using LangGraph and facing challenges with state management. Here’s the flow:

  1. Agent 1 collects three pieces of information by asking questions sequentially.
  2. Agent 2 processes the collected information and asks two additional questions.
  3. Agent 3 performs similar processing but includes additional tool calls.
  4. And so on.

This setup follows a human-in-the-loop approach as described in the LangGraph documentation.

The issue I’m encountering is maintaining state—specifically, keeping track of which agent is currently replying and directing the conversation appropriately using conditional edges in LangGraph—while using Gradio as the interface.

Does anyone have suggestions or best practices for handling this type of state management? Any guidance would be greatly appreciated!

1 Like

To store information on a per-user or per-session basis, it is convenient to use the State component of Gradio (a component that simply stores variables of any type).
I have not tried to see how large the data can be, but since it can handle audio and images, it should be able to handle text.