Dependency Injection/ Singleton management

@sameer I’m trying to figure out this exact same thing at the moment. Please share if you have a solution. I looked through the langgraph_api code to see how I might be able to instrument the middleware but I didn’t see anything that could help.