For the use of asynchronous sub-agents, the ASGI protocol must utilize langgraph.json. How can it be supported in the case of dynamic multi-agent systems #5413
Replies: 2 comments
|
Converting to a discussion item since this is more of a usage question instead of a pointed feature request/ issue. Could you elaborate more on what you mean by dynamic multi-agent systems? |
|
For dynamic multi-agent, keep one (or a few) entries in {
"dependencies": ["."],
"graphs": {
"agent": "./src/agent.py:graph"
}
}# src/agent.py
from langgraph.graph import StateGraph
from langgraph.types import Send
def route(state):
# decide which specialists to run for *this* request
return [Send("specialist", {"task": t}) for t in state["tasks"]]
builder = StateGraph(...)
# compile once
graph = builder.compile()Patterns that work with the ASGI server:
What does not work: writing a new Async subagents: they can be async nodes inside that one compiled graph. You do not need a second ASGI app. If you are hitting "must use langgraph.json" it is because the process you launched is LangGraph Server / Happy to sketch a registry-based parent if you say whether the set of agents is per-tenant, per-user, or per-request. I have not seen your current |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Feature description
For the use of asynchronous sub-agents, the ASGI protocol must utilize langgraph.json. How can it be supported in the case of dynamic multi-agent systems
Proposed solution (optional)
No response
Additional context (optional)
No response
All reactions