Unable to Map message Field to Custom AgentState in LangGraph Studio Chat UI #5805
Unanswered
bilalcodehub
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I’ve been troubleshooting a LangChain agentic workflow using LangGraph Studio with the new Chat interface (see screenshot below).

My custom
AgentState
is defined as shown below. I want thequestion
field in the state to automatically receive input from the Chat UI’s message box (the single input field shown at the bottom of the interface), so that when a user types a message, it seamlessly populates thequestion
field.To make the graph compatible with the Chat UI — which only passes a top-level message field — I’ve added a
prepare_state
node at the very start of the graphworkflow.add_edge(START, "prepare_state")
to convert message to question, like so:This works fine in the Graph UI in the studio where I can directly set the
question
field, but when I input the message in Message box in the studio's Chat UI, the question field isn’t getting populated — it’s like message is not being passed into the state.Can someone guide how to map the message input from the Chat UI into the agent's state
question
field? Do I need to do anything special to get the message field to appear in the initial state passed into the graph?I will appreciate any guidance.
Many thanks and
Kind regards,
Bilal
Beta Was this translation helpful? Give feedback.
All reactions