Open
Description
Description
First, thank you for this great library! While examining the code, I noticed that the FastAPI routers are not using async endpoints, and the adapter.invoke
method runs synchronously for all underlying LangGraph operations. This appears to be a potential bottleneck for multi-user serving scenarios, as the server processes requests sequentially.
Current Behavior
- FastAPI routes are synchronous
adapter.invoke
blocks the event loop- Server processes requests one at a time
Expected Behavior
- FastAPI routes should support async operations
- Adapter should support
ainvoke
for asynchronous execution - Server should be able to handle multiple concurrent requests efficiently
Proposed Solution
- Convert FastAPI routers to use async endpoints
- Implement and use
await adapter.ainvoke
for LangGraph operations - Maintain backward compatibility with sync operations
Benefits
- Improved scalability for multi-user scenarios
- Better utilization of FastAPI's async capabilities
- Non-blocking request processing
Metadata
Metadata
Assignees
Labels
No labels