langchain-ai / langgraph-studio

Desktop app for prototyping and debugging LangGraph applications locally.
https://studio.langchain.com
1.97k stars 131 forks source link

Support for asynchronous graph compilation #162

Closed david1542 closed 1 month ago

david1542 commented 1 month ago

Hi everyone :)

I'm currently creating my graph asynchronously, since I have to pull stuff from the database (information about the customers, API keys, etc).

Is it possible to make langgraph-studio support asynchronous graph compilation? Right now, I have to specify the file + variable of the graph in my langgraph.json.

It'd be cool if I could specify a function that compiles the graph. Namely, instead of this in my langgraph.json:

{
  "graphs": {
    "my_graph": "./simple.py:graph"
  },
}

I could do this:

{
  "graphs": {
    "my_graph": {
      "asyncLoader": "./simple.py:create_my_graph" 
     }
  },
}
dqbd commented 1 month ago

Hello! I believe it is possible to provide a function, which will return a compiled graph, both in Python and JS.

For the given example "asyncLoader": "./simple.py:create_my_graph", make sure that the function is named create_my_graph