# Crewai memory embedding locally with Ollama ERROR OPENAI\_API\_KEY SOLVED

**URL:** <https://community.crewai.com/t/crewai-memory-embedding-locally-with-ollama-error-openai-api-key-solved/7739>\
**Category:** Crews\
**Tags:** memory\
**Created:** [August 22, 2026, 3:10pm UTC](https://community.crewai.com/t/crewai-memory-embedding-locally-with-ollama-error-openai-api-key-solved/7739 "2026-08-22T15:10:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jverde](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jverde](https://community.crewai.com/u/jverde)\
**Post date:** [August 22, 2026, 3:10pm UTC](https://community.crewai.com/t/crewai-memory-embedding-locally-with-ollama-error-openai-api-key-solved/7739/1 "2026-08-22T15:10:59Z")

</div>

Hello,

I faced a problem that many have faced as well and I did not find a solution online. Finally I fixed it and I thought it could be good to share the solution.

The setup I have is Crewai with local Ollama model AND memory embedding with local Ollama embedding. This gives an error of OPENAI\_API\_KEY not found. If I remove the memory and embedding, the local ollama model runs nicely.

I manage to fix the error if you declare the embedding in one line and keep the memory=True line independently, so like this:

ollama\_embedder = {  
“provider”: “ollama”,  
“config”: {  
“model”: “qwen3-embedding”,  
“url”: “[http://localhost:11434](http://localhost:11434)”  
}  
}

my\_crew = Crew(  
agents=[  
concept\_architect,  
scientific\_validator,  
editor  
],  
tasks=[  
establish\_premise,  
validate\_science,  
refine\_and\_edit  
],  
memory=True,  
embedder=ollama\_embedder,  
verbose=True,  
)
