Skip to content
Discussion options

You must be logged in to vote

@Mohamed-AtiaB

  1. yes, compiled state graph is thread safe, and you should be able to just define a single instance of the compiled graph
  2. the way you use any checkpointer across different requests is by passing a config with thread_id field, like you're already doing in graphConfig.

importantly, you have an anti-pattern in your code of getting the latest state from sessions/checkpointer, modifying it and passing it to graph.invoke. you should not do that -- as long as you're using a checkpointer, graph will automatically have access to the state as of the last execution (for a given thread ID). instead, you should just simply invoke it with new inputs like graph.invoke(inputs, config)

i wo…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@nimishdm-airindia
Comment options

Answer selected by Mohamed-AtiaB
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants