Replies: 2 comments
-
Hey @AMGMNPLK, Thank you for raising this important question about sequential flow support in Agency Swarm. Below are some clarifications and recommendations:
Currently, there isn’t a straightforward or efficient way to enforce strictly sequential message routing in Agency Swarm. A sequential flow implies no real decision-making among agents—essentially a prompt chain—which isn’t considered truly “agentic.”
In short, we don’t recommend a purely sequential/prompt-chain approach if you want to leverage the framework’s agentic capabilities. However, if you do want to adapt this into a working solution using Agency Swarm, you’ll need an orchestrator agent that triggers other agents in the correct order based on your instructions and the input request. You can also pass shared context between tools by using shared_state, as described in the advanced usage documentation.
For clarity:
Yes. You can use:
These methods let you visualize all the messages and function calls within the framework, helping you see exactly how and where the routing happens. Additional Notes
We hope this clarifies the current limitations and offers a path forward. Let us know how we can further assist you! |
Beta Was this translation helpful? Give feedback.
-
This is my use case: Here's a top-down hierarchical diagram of our agent structure: graph TD
subgraph "Layer 1: Entry"
User[User]
O[Agent O]
end
subgraph "Layer 2: Core"
A[Agent A]
B[Agent B]
end
subgraph "Layer 3: Phases"
direction LR
C[Agent C]
D[Agent D]
E[Agent E]
F[Agent F]
G[Agent G]
H[Agent H]
I[Agent I]
J[Agent J]
end
subgraph "Layer 4: Specialists"
direction LR
K[Agent K]
L[Agent L]
M[Agent M]
N[Agent N]
P[Agent P]
end
%% Connections between layers
User --> O
O --> A & B
%% Core to Phases
A --> C & D & E & F & G & H & I & J
%% All Phases connect to first specialist
C & D & E & F & G & H & I & J --> K
%% Specialist chain
K --> L
L --> M
M --> N
N --> P
P --> O
%% Shared Context connections omitted for clarity
%% Styling
classDef layer1 fill:#e6f3ff,stroke:#333,stroke-width:2px
classDef layer2 fill:#f0fff0,stroke:#333,stroke-width:2px
classDef layer3 fill:#fff0f0,stroke:#333,stroke-width:2px
classDef layer4 fill:#f0f0ff,stroke:#333,stroke-width:2px
class User,O layer1
class A,B layer2
class C,D,E,F,G,H,I,J layer3
class K,L,M,N,P layer4
Layer Description:Layer 1: Entry
Layer 2: Core
Layer 3: Phases
Layer 4: Specialists
Key Features:f
This top-down view helps visualize the hierarchical nature of the system while maintaining the sequential flow through the specialist chain. |
Beta Was this translation helpful? Give feedback.
-
We're having an issue with sequential agent communication in our Agency Swarm implementation. Sometimes the message routing works as expected, other times it breaks the chain.
Setup:
We have a chain of agents that should process messages in sequence:
Current Implementation:
Issue:
Questions:
Any guidance would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions