Replies: 1 comment 1 reply
-
|
Strands doesn’t have an exact equivalent of LangGraph’s Send API, because the framework doesn’t dynamically spawn nodes inside the graph itself. Instead, the recommended pattern is to let a single agent decide how many subtasks are required, and then let that agent call other agents or tools as needed. In other words, the “dynamic” part happens in the agent’s reasoning layer, not in the graph structure. The usual way to build a map-reduce workflow in Strands is to have one coordinator agent that receives the original query, breaks it into however many subtasks are needed, and then calls the appropriate sub-agents in parallel. You don’t need to pre-declare five different branches in the graph; you only declare the coordinator agent and the sub-agents, and the coordinator chooses which ones to invoke at runtime. Strands automatically handles the parallel execution of tool or agent calls when you invoke multiple calls inside a single step. The reduce phase is done by the same coordinator agent. After the sub-agents complete their work, their outputs come back to the coordinator, and the LLM decides how to merge them into a final answer. So the graph itself stays simple and static, but its behavior becomes dynamic because the model decides how many calls to make and how to combine the results. This pattern is how most complex or branching workflows are implemented in Strands today. It keeps the graph definition minimal while still giving you dynamic fan-out and fan-in behavior similar to map-reduce. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to understand the proper way to set up a map-reduce graph framework in Strands. I am used to using the
Sendapi fromlanggraph(see https://docs.langchain.com/oss/python/langgraph/graph-api#send for reference).Basically, at runtime, depending on the users query, I would like anywhere from 1-5 sub-agents to be spawned (depending on user query complexity) to perform various tasks (in parallel). What would be the best way to accomplish this with
strands?Beta Was this translation helpful? Give feedback.
All reactions