You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a LangGraph JS system using the prebuilt supervisor-based architecture. I'm using MongoDBSaver for memory. I stream the graph output to the frontend using SSE, and to do that, I loop over graph.stream() like this:
The problem is that some chunks are missing in this stream — specifically intermediate tool_call and their corresponding ToolMessage. For example, when the supervisor hands off to a child agent via tool_call, that transition or its result sometimes doesn't show up in the streamed chunks.
However, when I check the checkpoints collection in MongoDB for the same thread, the full set of messages (including the missing ones) is there.
I also tried other streamMode values (like values, messages, etc.), but the result is still the same — the same chunks are missing in the stream output.
Why are some intermediate messages missing in the stream but present in the persisted memory? Is this expected behavior? If not, how can I ensure all messages (including intermediate tool interactions) are emitted in real time through the stream?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building a LangGraph JS system using the prebuilt supervisor-based architecture. I'm using
MongoDBSaver
for memory. I stream the graph output to the frontend using SSE, and to do that, I loop overgraph.stream()
like this:The problem is that some chunks are missing in this stream — specifically intermediate
tool_call
and their correspondingToolMessage
. For example, when the supervisor hands off to a child agent viatool_call
, that transition or its result sometimes doesn't show up in the streamed chunks.However, when I check the
checkpoints
collection in MongoDB for the same thread, the full set of messages (including the missing ones) is there.I also tried other streamMode values (like
values
,messages
, etc.), but the result is still the same — the same chunks are missing in the stream output.Why are some intermediate messages missing in the stream but present in the persisted memory? Is this expected behavior? If not, how can I ensure all messages (including intermediate tool interactions) are emitted in real time through the stream?
Beta Was this translation helpful? Give feedback.
All reactions