You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build a dynamic Swarm-based LangGraph workflow where the number of agents can vary at runtime, based on a configuration.
The challenge I'm facing is that I currently need to recompile the whole Swarm graph every time a message is received, just to adapt to the updated set of agents. That doesn't feel right and introduces overhead I’d like to avoid.
I'm looking for a cleaner architectural approach that would let me:
Dynamically inject agents into the swarm,
Avoid recompiling the entire workflow on each user interaction,
Stay compatible with subgraphs (each agent has its own MCP workflow graph).
Has anyone managed to implement a dynamic agentic swarm that avoids full recompilation?
Here’s a simplified version of my setup:
Each agent uses its own subgraph (via create_graph_builder), and I build custom handoff tools dynamically to allow inter-agent communication.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone
I'm trying to build a dynamic Swarm-based LangGraph workflow where the number of agents can vary at runtime, based on a configuration.
The challenge I'm facing is that I currently need to recompile the whole Swarm graph every time a message is received, just to adapt to the updated set of agents. That doesn't feel right and introduces overhead I’d like to avoid.
I'm looking for a cleaner architectural approach that would let me:
Dynamically inject agents into the swarm,
Avoid recompiling the entire workflow on each user interaction,
Stay compatible with subgraphs (each agent has its own MCP workflow graph).
Has anyone managed to implement a dynamic agentic swarm that avoids full recompilation?
Here’s a simplified version of my setup:
Each agent uses its own subgraph (via create_graph_builder), and I build custom handoff tools dynamically to allow inter-agent communication.
Here’s the coordinator logic and Swarm setup:
Thank you all !
Beta Was this translation helpful? Give feedback.
All reactions