Bug Description
After calling /product/add with async_mode=sync, the API returns 200 with "Memory added successfully", but the memory is not actually stored in Neo4j. The database remains empty (MATCH (n) RETURN count(n) returns 0).
Environment
- MemOS version: latest (cloned from https://github.com/MemTensor/MemOS)
- Deployment: Self-hosted via Docker Compose
- LLM Provider: SiliconFlow (moonshotai/Kimi-K2-Instruct-0905)
- Embedder: SiliconFlow (BAAI/bge-m3)
- Neo4j: v5.26.4 (Docker)
- Qdrant: v1.15.3 (Docker)
Steps to Reproduce
- Start MemOS via docker-compose
- Call POST /product/add with:
{
"user_id": "user1",
"messages": [{"role": "user", "content": "test memory content"}],
"async_mode": "sync"
}
- API returns: {"code": 200, "message": "Memory added successfully", "data": []}
- Check Neo4j: MATCH (n) RETURN count(n) returns 0
Root Cause Analysis
The log shows: WARNING - log_add_messages - No add/update items prepared; skipping addMemory/knowledgeBaseUpdate logs. user_id=user1 mem_cube_id=user1 task_id=None missing_ids=[]
The issue is in memos/mem_scheduler/task_schedule_modules/handlers/add_handler.py in the log_add_messages method. It tries to parse msg.content as JSON via json.loads(msg.content), but the resulting userinput_memory_ids list is empty.
The upstream extraction flow appears to fail silently - the LLM (Kimi-K2-Instruct) is called successfully but the extracted memory IDs list ends up empty before reaching the storage step.
Expected Behavior
Memory should be stored in Neo4j and Qdrant after a successful API call.
Additional Context
- RabbitMQ is unavailable (DNS resolution fails in Docker Desktop on Windows), but this should not affect sync mode
- The LLM call itself succeeds (verified via direct API testing)
- The issue appears to be in the scheduler/handler layer between LLM extraction and Neo4j storage
Bug Description
After calling /product/add with async_mode=sync, the API returns 200 with "Memory added successfully", but the memory is not actually stored in Neo4j. The database remains empty (MATCH (n) RETURN count(n) returns 0).
Environment
Steps to Reproduce
{ "user_id": "user1", "messages": [{"role": "user", "content": "test memory content"}], "async_mode": "sync" }Root Cause Analysis
The log shows: WARNING - log_add_messages - No add/update items prepared; skipping addMemory/knowledgeBaseUpdate logs. user_id=user1 mem_cube_id=user1 task_id=None missing_ids=[]
The issue is in memos/mem_scheduler/task_schedule_modules/handlers/add_handler.py in the log_add_messages method. It tries to parse msg.content as JSON via json.loads(msg.content), but the resulting userinput_memory_ids list is empty.
The upstream extraction flow appears to fail silently - the LLM (Kimi-K2-Instruct) is called successfully but the extracted memory IDs list ends up empty before reaching the storage step.
Expected Behavior
Memory should be stored in Neo4j and Qdrant after a successful API call.
Additional Context