# Multi Agents w/ memory isolation and dynamic workflows

**URL:** <https://community.crewai.com/t/multi-agents-w-memory-isolation-and-dynamic-workflows/2110>\
**Category:** General\
**Created:** [December 17, 2024, 8:20pm UTC](https://community.crewai.com/t/multi-agents-w-memory-isolation-and-dynamic-workflows/2110 "2024-12-17T20:20:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![I.makaremi](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/i.makaremi/32/1522_2.png) [@I.makaremi](https://community.crewai.com/u/I.makaremi)\
**Post date:** [December 17, 2024, 8:20pm UTC](https://community.crewai.com/t/multi-agents-w-memory-isolation-and-dynamic-workflows/2110/1 "2024-12-17T20:20:17Z")

</div>

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!
