I’m trying to implement a hierarchical multi-agent interaction in CrewAI with specific memory isolation and dynamic workflows. Here’s the structure:
- A is the Manager agent.
- B1 to B10 are intermediate agents that report to A.
- Each Bi has two sub-agents, C1 and C2, which report to Bi.
Requirements:
- The process starts with A asking all Bi agents to do parallel tasks.
- Bi makes its own decisions about when to interact with C1 and C2. It might reach out to them multiple times (e.g., gather results, refine queries) before finally reporting back to A.
- C1 and C2 do not share memory with each other. They only share memory with their associated Bi.
- Similarly, B1 to B10 do not share memory with each other.
Next Step After Reporting to A:
- Once all Bi agents report back to A, the response from each Bi is a list of next-step actions.
- A evaluates all suggested actions together, checks for conflicts, refines the actions if needed, and sends lists (of equal size or shorter length) back to the respective Bi agents.
- Each Bi then executes its refined actions in parallel. During this step:
- Each action must have access to Bi’s memory.
- Parallel processes should not mix memory between each other or between different Bi agents.
How can this be modeled in CrewAI? Would love to hear thoughts or see example implementations for this workflow!