-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[BUG] Mem0 (local config) - Memory.search() got an unexpected keyword argument 'metadata' #2599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Jainish-S, This is the issue, #2587. the local config parameter is not being passed currently to the |
…a' with local Mem0 Co-Authored-By: Joe Moura <[email protected]>
@Vidit-Ostwal Yes I had found it earlier and have fixed it locally. |
@Jainish-S still the issue is there? |
@Vidit-Ostwal Yes the issue is still persistent when using local mem0, this doesn't arise when using the mem0 cloud provider config |
@Jainish-S It happens when you don't set the api_key - I'll work in a solution for it this week |
@lucasgomide, is this because |
@lucasgomide If you don't mind, can I pick this up? |
Sure man, thank u so much.. |
@Vidit-Ostwal I think this PR handles that, right? #2604 |
I think so. The author @Dev-Khant, is the maintainer of mem0 itself. I think he pretty much knows what actually the issue is and the best way to resolve that as well. |
@Dev-Khant, can you confirm wether with the changes you have provided the search function will be compatible? Memory Client has this particular defination of and Memory has this particular defination of I think because Memory does not have a |
Hey that is correct. The issue was |
@Dev-Khant, thanks for the clarification |
Description
I am currently using local mem0 with the following config
My crew is defined as this
The full traceback
The payload of mem0 has changed in v2 compared to v1 but can't find out any major difference as the older version should work as it is ("version": "v1.1" added in config).
Steps to Reproduce
Expected behavior
The local mem0 search functionality should work as it does with the cloud one.
I am using qdrant for my vector store.
Screenshots/Code snippets
None
Operating System
macOS Sonoma
Python Version
3.11
crewAI Version
0.114.0
crewAI Tools Version
0.40.1
Virtual Environment
Venv
Evidence
Traceback (most recent call last):
File "/Users/JainishSavalia/work/playground/crewAI/examples/main.py", line 27, in run_crew
result = crew.kickoff(inputs=inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/crew.py", line 646, in kickoff
result = self._run_sequential_process()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/crew.py", line 758, in _run_sequential_process
return self._execute_tasks(self.tasks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/crew.py", line 861, in _execute_tasks
task_output = task.execute_sync(
^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/.venv/lib/python3.11/site-packages/opentelemetry/instrumentation/crewai/instrumentation.py", line 61, in wrapper
return func(tracer, duration_histogram, token_histogram, wrapped, instance, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/.venv/lib/python3.11/site-packages/opentelemetry/instrumentation/crewai/instrumentation.py", line 149, in wrap_task_execute
result = wrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/task.py", line 328, in execute_sync
return self._execute_core(agent, context, tools)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/task.py", line 472, in _execute_core
raise e # Re-raise the exception after emitting the event
^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/task.py", line 392, in _execute_core
result = agent.execute_task(
^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/.venv/lib/python3.11/site-packages/opentelemetry/instrumentation/crewai/instrumentation.py", line 61, in wrapper
return func(tracer, duration_histogram, token_histogram, wrapped, instance, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/.venv/lib/python3.11/site-packages/opentelemetry/instrumentation/crewai/instrumentation.py", line 108, in wrap_agent_execute_task
result = wrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/agent.py", line 212, in execute_task
memory = contextual_memory.build_context_for_task(task, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/memory/contextual/contextual_memory.py", line 46, in build_context_for_task
context.append(self._fetch_external_context(query))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/memory/contextual/contextual_memory.py", line 130, in _fetch_external_context
external_memories = self.exm.search(query)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/memory/memory.py", line 37, in search
return self.storage.search(
^^^^^^^^^^^^^^^^^^^^
File "/Users/JainishSavalia/work/playground/crewAI/src/crewai/memory/storage/mem0_storage.py", line 119, in search
results = self.memory.search(**params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Memory.search() got an unexpected keyword argument 'metadata'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/JainishSavalia/work/playground/crewAI/examples/main.py", line 40, in
run_crew()
File "/Users/JainishSavalia/work/playground/crewAI/examples/main.py", line 34, in run_crew
print(f"\nAn error occurred: {e.with_traceback()}")
Possible Solution
None
Additional context
None
The text was updated successfully, but these errors were encountered: