Skip to content

[Bug] /product/add returns 200 but memory not stored in Neo4j #1355

Description

@spf165513244-sudo

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

  1. Start MemOS via docker-compose
  2. Call POST /product/add with:
{
  "user_id": "user1",
  "messages": [{"role": "user", "content": "test memory content"}],
  "async_mode": "sync"
}
  1. API returns: {"code": 200, "message": "Memory added successfully", "data": []}
  2. 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

Metadata

Metadata

Assignees

Labels

ai-pr-readyAutoDev tests passed and PR is ready for human review/merge.bugSomething isn't working | 功能异常memosCore MemOS logic (memory, MCP, scheduler, API, database) | 核心模块

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions