[BUG] Memory Rag Storage Issue
Description
Started getting this error regarding rag with the latest version 0.83.0
Steps to Reproduce
Just using the default crew configuration with memory=True.
Expected behavior
no errors
Screenshots/Code snippets
return Crew(
agents=agents,
tasks=tasks,
manager_agent=create_manager_agent(),
process=Process.sequential,
memory=True,
verbose=crewai_verbose,
**kwargs
)
Operating System
Ubuntu 20.04
Python Version
3.10
crewAI Version
0.83.0
crewAI Tools Version
0.14.0
Virtual Environment
Conda
Evidence
2024-11-27 10:42:36,152 - 13765931008 - rag_storage.py-rag_storage:118 - ERROR: Error during short_term search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
2024-11-27 10:42:36,457 - 13765931008 - rag_storage.py-rag_storage:118 - ERROR: Error during entities search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
Possible Solution
Not sure currently
Additional context
Nothing else
the same with memory based on Azure OpenAI:
embedder_config = {
"provider": "azure",
"config": {
"api_key": os.getenv("AZURE_OPENAI_API_KEY"),
"api_base": os.getenv("AZURE_OPENAI_ENDPOINT"),
"api_version": os.getenv("AZURE_API_VERSION"),
"model_name": os.getenv("AZURE_OPENAI_EMBEDDED_MODEL"),
"deployment_id": os.getenv("AZURE_OPENAI_EMBEDDED_DEPLOYMENT"),
}
}
crew = Crew(
...
embedder=embedder_config
...
error:
2024-11-27 23:46:04,920 - 17808 - rag_storage.py-rag_storage:89 - ERROR: Error during short_term save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
2024-11-27 23:46:26,410 - 17808 - rag_storage.py-rag_storage:89 - ERROR: Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
Same issue..
same issue.
Same issue
Same Issue
the same with memory based on Azure OpenAI:
embedder_config = { "provider": "azure", "config": { "api_key": os.getenv("AZURE_OPENAI_API_KEY"), "api_base": os.getenv("AZURE_OPENAI_ENDPOINT"), "api_version": os.getenv("AZURE_API_VERSION"), "model_name": os.getenv("AZURE_OPENAI_EMBEDDED_MODEL"), "deployment_id": os.getenv("AZURE_OPENAI_EMBEDDED_DEPLOYMENT"), } }crew = Crew( ... embedder=embedder_config ...error:
2024-11-27 23:46:04,920 - 17808 - rag_storage.py-rag_storage:89 - ERROR: Error during short_term save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body' 2024-11-27 23:46:26,410 - 17808 - rag_storage.py-rag_storage:89 - ERROR: Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
in my case i had to change embedder config to:
embedder_config = {
"provider": "azure",
"config": {
"api_key": os.getenv("AZURE_OPENAI_API_KEY"),
"api_base": os.getenv("AZURE_OPENAI_ENDPOINT"),
"api_version": os.getenv("AZURE_API_VERSION"),
"model_name": 'text-embedding-ada-002',
"model": os.getenv("AZURE_OPENAI_EMBEDDED_DEPLOYMENT"),
}
}
So deployment_id was changed to model - name of deployment made on Azure OpenAI.
same issue when use the knowledge~
Same issue when setting memory=True for the Crew
same issue when setting memory=True for the Crew
no fix yet?
same issue
Same issue for me too. Anyone got any fix?
in my case i had to change config parameters as wrote here: https://github.com/crewAIInc/crewAI/issues/1669#issuecomment-2519951743
so, after my case ... check embedder_config
I have the same error with memory=True.
crewai version 0.86.0
OS: Windows 11
pyhton: 3.12.6
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
#manager_llm=ChatOpenAI(temperature=0, model="gpt-4o-mini"),
#process=Process.hierarchical,
memory=True,
verbose=True
)
ERROR:root:Error during short_term save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during short_term search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
Same issue, I have this very simple crew where I activate memory:
self.crew = Crew(
agents=[self.csa],
tasks=[self.task],
verbose=True,
memory=True
)
Errors that I see during the processing:
ERROR:root:Error during short_term save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
I use:
- Python 3.12.8
- Crewai 0.86.0
Same issue for me as well
ag_storage.py-rag_storage:90 - ERROR: Error during short_term save: ClientError.__init__() missing 1 required positional argument: 'operation_name'
I have tried the latest release 0.95.0, but have the same error as with previous versions 0.86.0
ERROR:root:Error during short_term search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
I have successfully resolved the issue I was encountering.
The resolution involved adding credits to my OpenAI account. Following this, both short-term and entity memory functionalities began to operate as expected.
I was aware Crewai memory, by default, used OpenAI embeddings. However, the documentation did not explicitly state the requirement of OpenAI credits for the memory feature to function correctly.
I am now able to observe data being populated within both my entity and short-term memory.
It would be beneficial if Crewai could return a low credit error more explicitly when this is the root cause of an issue.
the same with memory based on Azure OpenAI:
embedder_config = { "provider": "azure", "config": { "api_key": os.getenv("AZURE_OPENAI_API_KEY"), "api_base": os.getenv("AZURE_OPENAI_ENDPOINT"), "api_version": os.getenv("AZURE_API_VERSION"), "model_name": os.getenv("AZURE_OPENAI_EMBEDDED_MODEL"), "deployment_id": os.getenv("AZURE_OPENAI_EMBEDDED_DEPLOYMENT"), } }crew = Crew( ... embedder=embedder_config ...error:
2024-11-27 23:46:04,920 - 17808 - rag_storage.py-rag_storage:89 - ERROR: Error during short_term save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body' 2024-11-27 23:46:26,410 - 17808 - rag_storage.py-rag_storage:89 - ERROR: Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
hey, could you please tell me if it's resolved for you?
the same with memory based on Azure OpenAI:
embedder_config = { "provider": "azure", "config": { "api_key": os.getenv("AZURE_OPENAI_API_KEY"), "api_base": os.getenv("AZURE_OPENAI_ENDPOINT"), "api_version": os.getenv("AZURE_API_VERSION"), "model_name": os.getenv("AZURE_OPENAI_EMBEDDED_MODEL"), "deployment_id": os.getenv("AZURE_OPENAI_EMBEDDED_DEPLOYMENT"), } }crew = Crew( ... embedder=embedder_config ...error:
2024-11-27 23:46:04,920 - 17808 - rag_storage.py-rag_storage:89 - ERROR: Error during short_term save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body' 2024-11-27 23:46:26,410 - 17808 - rag_storage.py-rag_storage:89 - ERROR: Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'hey, could you please tell me if it's resolved for you?
change deployment_id for model as i wrote here: https://github.com/crewAIInc/crewAI/issues/1669#issuecomment-2519951743
I have the same error with memory=True.
I have the same error but I am still getting an output completely fine but it might be missing something because the error is still within the output.
@joaomdmoura @bhancockio I solved this annoying BUG and it took me around 12+ hrs to debug. You can close this issue
Note: this works for Ollama embedding model, so one can use ollama pull nomic-embed-text to pull the model or any other model to solve (RECOMMENDED)
The error was happening due to incorrect configuration of the embedder attribute in the Crew class, just change the model name as per your need just make sure not include any tag with it.
crew = Crew(
agents=[sales_rep_agent,lead_sales_rep_agent],
tasks=[lead_profiling_task,personalized_outreach_task],
verbose=True,
process=Process.sequential,
memory=True,
embedder={
"provider": "ollama",
"config": {
"model": "nomic-embed-text"
}
}
)
For Google users, add the api_key attribute and change the model to models/text-embedding-004, note in between you still might face error like:
2025-01-19 00:10:58,441 - 20228 - rag_storage.py-rag_storage:109 - ERROR: Error during short_term save: 400 400 Request payload size exceeds the limit: 10000 bytes. in add.
2025-01-19 00:11:05,404 - 20228 - rag_storage.py-rag_storage:138 - ERROR: Error during short_term search: 400 400 Request payload size exceeds the limit: 10000 bytes. in query.
2025-01-19 00:11:06,654 - 20228 - rag_storage.py-rag_storage:138 - ERROR: Error during entities search: 400 400 Request payload size exceeds the limit: 10000 bytes. in query.
So it is recommended to use Ollama as an embedding provider(or openai). I highly RECOMMEND to use Ollama and ditch google's text-embedding-004 for embedding. I hope this issue will be closed and my comment will be pinned for beginners :)
PROOF of working:
@akef-malomatia @dumip @amanydv-asc @Yeswanth-gif @akshayb7 @xiaoxipanda Try my solution, it takes less than 5 minutes to install the ollama and the model :) and tell me if you face any trouble with this approach
@joaomdmoura @bhancockio I solved this annoying BUG and it took me around 12+ hrs to debug. You can close this issue
Note: this works for Ollama embedding model, so one can use
ollama pull nomic-embed-textto pull the model or any other model to solve (RECOMMENDED)The error was happening due to incorrect configuration of the
embedderattribute in the Crew class, just change the model name as per your need just make sure not include any tag with it.crew = Crew( agents=[sales_rep_agent,lead_sales_rep_agent], tasks=[lead_profiling_task,personalized_outreach_task], verbose=True, process=Process.sequential, memory=True, embedder={ "provider": "ollama", "config": { "model": "nomic-embed-text" } } )
This worked beautifully. Thank you.
anyone able to get it to work with bedrock embedding,
@messeiry Right now the only solution is to use OpenAI embeddings or the one I did above
HI @messeiry for bedrock you need the config like this
` @crew def crew(self) -> Crew: load_dotenv() """Creates the AiTroubleshooter crew"""
session = boto3.Session( profile_name='default',
region_name='us-west-2')
return Crew(
agents=self.agents, # Automatically created by the @agent decorator
tasks=self.tasks, # Automatically created by the @task decorator
# process=Process.hierarchical,
process=Process.sequential,
verbose=True,
manager_agent=self.manager_agent(),
output_log_file="./troubleshooting.log",
embedder={
'provider': 'bedrock',
'config': {
'model': 'amazon.titan-embed-text-v1',
'vector_dimension': 1536,
'session': session
}
}
) `
Hey @Yeswanth-gif thanks for your reply, this error is gone now.
but after setting the session, this error showed up :)
ERROR:root:Error during short_term save: ClientError.__init__() missing 1 required positional argument: 'operation_name'
here is the session :
session = boto3.Session( profile_name='default', region_name='us-west-2', )
here is my code for the crew
` crew2 = Crew( agents=[finder, explainer], tasks=[find, explain], verbose=True, memory=True, #manager_agent=manager_llm, #process=Process.hierarchical, human_input=True, manager_callbacks=[CustomHandler("Crew Manager")], embedder={ 'provider': 'bedrock', 'config': { 'model': 'amazon.titan-embed-text-v2', 'vector_dimension': 1536, 'session': session } }
) `
hello, I'm using azure open ai. How can i configure the embedder for azure? (llm: azure/gpt-4o)