# Unable to change model provider for MDXSearchTool

**URL:** <https://community.crewai.com/t/unable-to-change-model-provider-for-mdxsearchtool/7367>\
**Category:** CrewAI Community Support\
**Tags:** tools\_issues\
**Created:** [March 3, 2026, 4:50pm UTC](https://community.crewai.com/t/unable-to-change-model-provider-for-mdxsearchtool/7367 "2026-03-03T16:50:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abu\_Ubaida](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/abu_ubaida/32/4916_2.png) [@Abu\_Ubaida](https://community.crewai.com/u/Abu_Ubaida)\
**Post date:** [March 3, 2026, 4:50pm UTC](https://community.crewai.com/t/unable-to-change-model-provider-for-mdxsearchtool/7367/1 "2026-03-03T16:50:57Z")

</div>

I was trying to customize the MDXSearchTool to use Cohere models instead of OpenAI. The simple code is as follows:

```python
semantic_search_resume_tool: MDXSearchTool = MDXSearchTool(
        mdx='resume.md',
        config={
            "embedding_model": {
                "provider": "cohere",
                "config": {
                    "model": "embed-english-v3.0",
                },
            },
            "vectordb": {
                "provider": "chromadb",
                "config": {}
            },
        },
    )

```

But since I already ran the crew with another provider before, now it throws the following error:

> An embedding function already exists in the collection configuration, and a new one is provided. If this is intentional, please embed documents separately. Embedding function conflict: new: cohere vs persisted: openai [type=value\_error, input\_value={‘collection\_name’: 'rag\_…logservice\_port=50052))}, input\_type=dict]

So basically, I would like to know how to override/replace the previously created collection with another model?

---

<div class="post-metadata">

**Author:** ![major\_tiwari](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/major_tiwari/32/4908_2.png) [@major\_tiwari](https://community.crewai.com/u/major_tiwari)\
**Post date:** [March 6, 2026, 12:30pm UTC](https://community.crewai.com/t/unable-to-change-model-provider-for-mdxsearchtool/7367/2 "2026-03-06T12:30:36Z")

</div>

@Abu_Ubaida You’re hitting a **ChromaDB embedding function conflict**. Chroma persists a collection **with the embedding function metadata** it was created with (OpenAI, in your earlier run). When you now pass a different embedding function (Cohere), Chroma refuses to reuse that persisted collection because the vectors aren’t compatible.

You have a few clean ways to switch providers:

1. Chroma stores an **embedding function signature** with each collection.
2. Reusing that collection with a _different_ embedder (OpenAI → Cohere) is blocked to prevent corrupted/mismatched similarity search results.
3. Therefore, you must **drop and recreate** , or **write to a new collection** , or **use a separate persist directory**.
