AttributeError: 'NoneType' object has no attribute 'payload'
🐛 Describe the bug
[{'id': '31619c76-dfb6-4418-aea4-99b5ab04040d', 'event': 'add', 'data': 'Working on improving tennis skills'}]
[{'id': '31619c76-dfb6-4418-aea4-99b5ab04040d', 'text': 'Working on improving tennis skills', 'metadata': {'category': 'hobbies', 'user_id': 'alice', 'data': 'Working on improving tennis skills', 'created_at': 1721722520}}]
[{'id': '31619c76-dfb6-4418-aea4-99b5ab04040d', 'text': 'Working on improving tennis skills', 'metadata': {'category': 'hobbies', 'user_id': 'alice', 'data': 'Working on improving tennis skills', 'created_at': 1721722520}, 'score': 0.2371265959456912}]
Traceback (most recent call last):
File "/Users/senolsahin/Work/newsforgpt/test3.py", line 23, in
Hey @sensahin, thanks for opening the issue. Can you please share the code snippet for this so that we can reproduce the issue?
Hi @deshraj
I am just using the below sample code that is provided on the Github page:
import os
from mem0 import Memory
os.environ["OPENAI_API_KEY"] = "sk-proj-xxx"
# Initialize Mem0
m = Memory()
# Store a memory from any unstructured text
result = m.add("I am working on improving my tennis skills. Suggest some online courses.", user_id="alice", metadata={"category": "hobbies"})
print(result)
# Created memory: Improving her tennis skills. Looking for online suggestions.
# Retrieve memories
all_memories = m.get_all()
print(all_memories)
# Search memories
related_memories = m.search(query="What are Alice's hobbies?", user_id="alice")
print(related_memories)
# Update a memory
result = m.update(memory_id="m1", data="Likes to play tennis on weekends")
print(result)
# Get memory history
history = m.history(memory_id="m1")
print(history)
Hi @deshraj
I am just using the below sample code that is provided on the Github page:
import os from mem0 import Memory os.environ["OPENAI_API_KEY"] = "sk-proj-xxx" # Initialize Mem0 m = Memory() # Store a memory from any unstructured text result = m.add("I am working on improving my tennis skills. Suggest some online courses.", user_id="alice", metadata={"category": "hobbies"}) print(result) # Created memory: Improving her tennis skills. Looking for online suggestions. # Retrieve memories all_memories = m.get_all() print(all_memories) # Search memories related_memories = m.search(query="What are Alice's hobbies?", user_id="alice") print(related_memories) # Update a memory result = m.update(memory_id="m1", data="Likes to play tennis on weekends") print(result) # Get memory history history = m.history(memory_id="m1") print(history)
It should be this issue. https://github.com/mem0ai/mem0/issues/1538
Hi @Mrxyy and @deshraj thanks for your help. I changed the memory_id part and now it is working. thanks!