# How to use multiple independant "memory" and RAG database for different crews?

**URL:** <https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494>\
**Category:** CrewAI Community Support\
**Tags:** memory\
**Created:** [September 21, 2024, 3:47pm UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494 "2024-09-21T15:47:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yannick](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/yannick/32/313_2.png) [@Yannick](https://community.crewai.com/u/Yannick)\
**Post date:** [September 21, 2024, 3:47pm UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/1 "2024-09-21T15:47:29Z")

</div>

Hello,  
Is there a way to have multiple crews that use fully independent “memory” and rag tools, i.e. that have separate ./db folders I guess.  
I tried updating the CREWAI\_STORAGE\_DIR and CHROMA\_DB\_FOLDER variables before creating each crew but it does not seem to work and I have only one ./db in my root project folder… What I want is multiple fully different crew1/db crew2/db etc… so there is absolutely no mixup of data between the crews…  
I guess that should be possible… how?

---

<div class="post-metadata">

**Author:** ![Yannick](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/yannick/32/313_2.png) [@Yannick](https://community.crewai.com/u/Yannick)\
**Post date:** [September 22, 2024, 4:27am UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/2 "2024-09-22T04:27:29Z")

</div>

well it seems to work if I just chdir() to a different path before creating new crews…

---

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://community.crewai.com/u/moto)\
**Post date:** [September 22, 2024, 5:18am UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/3 "2024-09-22T05:18:28Z")

</div>

Where in the code are you doing the chdir?

---

<div class="post-metadata">

**Author:** ![matt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/matt/32/3_2.png) [@matt](https://community.crewai.com/u/matt)\
**Post date:** [September 22, 2024, 7:46am UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/4 "2024-09-22T07:46:22Z")

</div>

```auto
    pdf_search_tool = PDFSearchTool(
        config=dict(
            embedder={
                "provider": "openai",
                "config": {
                    "model": 'text-embedding-3-small'
                }
            },
            vectordb=dict(
                provider="chroma",
                config=dict(
                    dir=f'crew-db-{uuid.uuid4()}'
                    ...
                )
        )
    )

```

Something like this, note the UUID creating the dir so its distinct

---

<div class="post-metadata">

**Author:** ![Yannick](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/yannick/32/313_2.png) [@Yannick](https://community.crewai.com/u/Yannick)\
**Post date:** [September 22, 2024, 4:29pm UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/5 "2024-09-22T16:29:00Z")

</div>

Just “os.chdir('a speific path for each crew”)"…

I want to be able to “reset the memory” of a specifc crew and not some others. Using _crewai reset\_memories_ does not give any flexibilty to pick which part of the memory to reset.

If each crew that needs to be indpendant has a completly different “home” folder with a fully different ./db etc… then I am sure I can manage each crew memory and everything else autonomously… and also be certain that any rag query will not mix up data.

It’s not a very a very sophisticated design but it seems to work…

---

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://community.crewai.com/u/moto)\
**Post date:** [September 22, 2024, 5:27pm UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/6 "2024-09-22T17:27:51Z")

</div>

are you pipelining the crews?

---

<div class="post-metadata">

**Author:** ![Yannick](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/yannick/32/313_2.png) [@Yannick](https://community.crewai.com/u/Yannick)\
**Post date:** [September 22, 2024, 6:34pm UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/7 "2024-09-22T18:34:24Z")

</div>

No, simple crew with one agent and one task, default openai key… plain and standard…

But why pipeline would make any difference related to memory or rag ??

---

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://community.crewai.com/u/moto)\
**Post date:** [September 23, 2024, 12:21am UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/8 "2024-09-23T00:21:48Z")

</div>

I was just curious and wondering how memory and context got dragged along or not when pipelining crews.

---

<div class="post-metadata">

**Author:** ![Clinbay\_Ltd](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/clinbay_ltd/32/917_2.png) [@Clinbay\_Ltd](https://community.crewai.com/u/Clinbay_Ltd)\
**Post date:** [November 14, 2024, 1:18pm UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/9 "2024-11-14T13:18:20Z")

</div>

Great tip when processing multiple items having a different knowledge base using the same crew (eg: what is the color of my cat? with pdf1 = cat is blue, pdf2 = cat is red, …). When I store all PDFs in the same vector store, the retriever tends to mix things up between various data sources.

Is there any alternative to using a different db? For instance, with metadata?

---

<div class="post-metadata">

**Author:** ![cristian\_di\_febo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/cristian_di_febo/32/3639_2.png) [@cristian\_di\_febo](https://community.crewai.com/u/cristian_di_febo)\
**Post date:** [July 2, 2025, 10:21am UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/11 "2025-07-02T10:21:51Z")

</div>

> [@matt](#):
>
> ```auto
> pdf_search_tool = PDFSearchTool(
> config=dict(
> embedder={
> "provider": "openai",
> "config": {
> "model": 'text-embedding-3-small'
> }
> },
> vectordb=dict(
> provider="chroma",
> config=dict(
> dir=f'crew-db-{uuid.uuid4()}'
> ...
> )
> )
> )
> 
> ```

Thanks! This “vectordb” conf did the trick. But I would like to know where in documentation I should find this informations? I hope @CrewAI team will improve the documentation.

---

<div class="post-metadata">

**Author:** ![Yannick](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/yannick/32/313_2.png) [@Yannick](https://community.crewai.com/u/Yannick)\
**Post date:** [July 3, 2025, 8:19am UTC](https://community.crewai.com/t/how-to-use-multiple-independant-memory-and-rag-database-for-different-crews/494/12 "2025-07-03T08:19:23Z")

</div>

no. I am not using Crewai memory. I built my own app specific memory to have more control.
