-
Notifications
You must be signed in to change notification settings - Fork 558
Open
Labels
bugSomething isn't workingSomething isn't workingpendingPending items to be addressed | 待解决事项。Pending items to be addressed | 待解决事项。
Description
Pre-submission checklist | 提交前检查
- I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
- I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
- This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题
Bug Description | 问题描述
The /product/feedback endpoint fails when using Neo4j as the graph backend. The API returns {"code":200,"data":[[]]} but no memory is created or updated.
Root Cause | 根本原因
Issue 1: Neo4j CypherTypeError
In src/memos/graph_dbs/neo4j_community.py:102, when add_node() is called with metadata containing nested objects, Neo4j rejects it:
neo4j.exceptions.CypherTypeError: Property values can only be primitive types or arrays thereof. Encountered: Map{user_name -> String("test-user-001")}.
Issue 2: IndexError in feedback.py
In src/memos/mem_feedback/feedback.py:254, when memory_manager.add() returns an empty list due to the Neo4j error, the code crashes:
return {
"id": added_ids[0], # IndexError: list index out of rangeHow to Reproduce | 如何重现
- Set up MemOS with Neo4j backend (neo4j-community)
- Add a memory:
curl -X POST http://localhost:8000/product/add \
-H "Content-Type: application/json" \
-d '{
"user_id": "test-user-001",
"mem_cube_id": "test-cube-001",
"messages": [{"role": "user", "content": "I prefer Python for AI development"}],
"async_mode": "sync"
}'- Try to provide feedback:
curl -X POST http://localhost:8000/product/feedback \
-H "Content-Type: application/json" \
-d '{
"user_id": "test-user-001",
"mem_cube_id": "test-cube-001",
"memory_id": "<memory_id_from_step_2>",
"history": [{"role": "user", "content": "I prefer Python for AI development"}],
"feedback_content": "Actually I also like TypeScript"
}'Expected Behavior | 预期行为
- Feedback should update or add memory
- API should return the new/updated memory ID
- No errors in logs
Actual Behavior | 实际行为
- API returns:
{"code":200,"message":"Memory feedback successfully","data":[[]]} - No memory created or updated
- Logs show:
CypherTypeError: Property values can only be of primitive typesIndexError: list index out of range
Environment | 环境信息
- MemOS: latest (built from main branch)
- Neo4j: 5.x (neo4j:latest)
- Python: 3.11
- Deployment: Docker Compose
Additional Context | 补充信息
The function _flatten_info_fields() is used in add_nodes_batch() but not in add_node(). This may be related to the issue.
Willingness to Implement | 实现意愿
- I'm willing to implement this myself | 我愿意自己解决
- I would like someone else to implement this | 我希望其他人来解决
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpendingPending items to be addressed | 待解决事项。Pending items to be addressed | 待解决事项。