mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

ERROR:root:Error in new_memories_with_actions:

Open CHesketh76 opened this issue 7 months ago • 3 comments

🐛 Describe the bug

I get this error when adding a few paragraphs of text to the memories. Each text is about 6~8 sentences.

for text in texts:
   m.add(text, user="user-1")

ERROR:root:Error in new_memories_with_actions: '9'

CHesketh76 avatar May 17 '25 23:05 CHesketh76

{'results': []} This is the final output, so no memories are added.

CHesketh76 avatar May 18 '25 00:05 CHesketh76

I think I found the issues. mem0 fails when the added text as more than 100 characters long.

CHesketh76 avatar May 18 '25 00:05 CHesketh76

config = {
    "llm": {
        "provider": "ollama",
        "config": {
            "model": "mistral-nemo",
            "temperature": 0.1,
            "max_tokens": 2000,
        }
    },
    "embedder": {
        "provider": "ollama",
            "model": "verdx/gte-base-zh",
            "embedding_dims": 768,
            "max_tokens": 2000,
        },
    "vector_store": {
        "config": {
            "collection_name": "test",
            "path": r"C:\Users\win_user\tmp",
            "embedding_model_dims":768,
        },
    },
}

try:
    memory = Memory.from_config(config)
except:
    pass
messages = []

# Character cards
for name, card in characters_cards.items():
    user     = {"role": "user", "content": f"{name}, Character Card"}
    assisant = {"role": "assistant", "content": f"{card[:100]}"}
    messages.append(user)
    messages.append(assisant)
    counter += 1

memory.add(messages, user_id="user_1")

Here is my full code.

CHesketh76 avatar May 18 '25 00:05 CHesketh76

@CHesketh76 This has been fixed with the new version of mem0ai. You can try and test it out.

parshvadaftari avatar Aug 16 '25 21:08 parshvadaftari