Multi Agents w/ memory isolation and dynamic workflows

I’m trying to implement a hierarchical multi-agent interaction in CrewAI with specific memory isolation and dynamic workflows. Here’s the structure:

  1. A is the Manager agent.
  2. B1 to B10 are intermediate agents that report to A.
  3. 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:

  1. Once all Bi agents report back to A, the response from each Bi is a list of next-step actions.
  2. 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.
  3. 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!