Description
Hi, I'm using mem0 for my langgraph. I noticed that sometimes mem0 does not save information even though it's not redundant, and it's very necessary. Are there any way to fix this?
This is my code for mem0
from mem0 import Memory
from dotenv import load_dotenv
import os
load_dotenv()
config = {
"llm": {
"provider": "openai",
"config": {
"model": "gpt-4o"
}
},
"vector_store": {
"provider": "supabase",
"config": {
"connection_string": os.getenv("DATABASE_URL"),
"collection_name": "memories"
}
}
}
client = Memory.from_config(config)
And this is for saving
try:
messages = json.loads(data)
# Insert the messages into mem0
client.add([messages], user_id=session_id)
result = "Chat history created."
except Exception as e:
result = f"Failed to create chat history: {str(e)}"
print("Result chat history: ", result)
I've also checked just in case the add function failed, but it did not. I assume that the AI deems the new information as either irrelevant or redundant. Which it isn't.