Unable to use external memory with mem0 and valkey #4032
Replies: 3 comments 6 replies
-
|
Regarding this issue, I have a fix in this PR but I'm having trouble moving it forward. Is there anything I can do to get it to the next step? |
Beta Was this translation helpful? Give feedback.
-
|
The error is a Redis/Valkey search query syntax issue. CrewAI is building an invalid filter. Root cause: Fixes: 1. Ensure user_id is set from crewai import Crew
crew = Crew(
agents=[...],
tasks=[...],
memory=True,
memory_config={
"provider": "mem0",
"config": {
"user_id": "user_123", # Must be non-empty!
}
}
)2. Check Mem0 direct config from mem0 import Memory
# Verify this works directly
memory = Memory(
vector_store={
"provider": "valkey",
"config": {...}
}
)
# Test with explicit user_id
memory.add("test", user_id="user_123")
memory.search("test", user_id="user_123") # Works?3. Valkey index setup 4. Workaround: Skip user filtering memory_config={
"provider": "mem0",
"config": {
"user_id": "global", # Use constant if multi-user not needed
}
}We integrate Mem0 + CrewAI at Revolution AI — the user_id must be explicitly set and non-empty. |
Beta Was this translation helpful? Give feedback.
-
|
Mem0 + Valkey issues! At RevolutionAI (https://revolutionai.io) we use this combo. Common fixes:
from mem0 import Memory
m = Memory.from_config({
"vector_store": {
"provider": "qdrant",
"config": {"url": "http://localhost:6333"}
},
"llm": {...},
"embedder": {...},
"history_db_path": "redis://localhost:6379" # Valkey compatible
})
"history_db_path": "redis://:password@localhost:6379"
valkey-cli ping # Should return PONGDebug: import redis
r = redis.Redis(host="localhost", port=6379)
r.ping() # Test connectionWhat error message are you getting? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use crewAI with external memory that is configured using mem0 and valkey and I get this error
Exception: An error occurred while running the crew: Invalid filter expression:
@AND:{[{'user_id': ' '}]} @user_id:{ }.ANDis not indexed as a tag fieldI've tested the configuration directly in mem0 and it works there, but not in crewai
More info is available here
Beta Was this translation helpful? Give feedback.
All reactions