Skip to content

fix: /product/add returns 200 success but stores no memory (No add/update items prepared) #1493

Closed

Description

@jihyun-jeong-854

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 | 问题描述

Environment

  • MemOS: self-hosted via Docker Compose

  • Services confirmed running:

    • Neo4j
    • Qdrant
    • RabbitMQ
    • memos API
  • RabbitMQ connection issue resolved

  • Search endpoint reachable

Problem Summary

POST /product/add returns:

{
  "code": 200,
  "message": "Memory added successfully",
  "data": []
}

But no memory is actually stored.

Then POST /product/search returns empty results for all memory types.


Relevant Logs

No add/update items prepared; skipping addMemory/knowledgeBaseUpdate logs

Repeated for every /product/add request.

Also search shows no stored Memory nodes.


Expected Behavior

The sentence "I like strawberry." should create at least one memory item (likely preference memory), and /product/search should return it.

Actual Behavior

API returns success, but no memory item is created or indexed.

Additional Notes

  • Happens with:

    • I like strawberry.
    • My favorite fruit is strawberry.
    • The user's favorite fruit is strawberry.
  • Also tested after RabbitMQ / Neo4j / Qdrant were fully healthy.

  • Same behavior with deprecated mem_cube_id and new writable_cube_ids / readable_cube_ids.

Question

Is this a known bug in current add_handler / extraction pipeline, or is additional configuration required for text/preference memory creation?

How to Reproduce | 如何重现

Add Request

import requests, json

payload = {
    "user_id": "8736b16e-1d20-4163-980b-a5063c3facdc",
    "writable_cube_ids": [
        "b32d0977-435d-4828-a86f-4f47f8b55bca"
    ],
    "messages": [
        {
            "role": "user",
            "content": "I like strawberry."
        }
    ],
    "async_mode": "sync"
}

res = requests.post(
    "http://localhost:8000/product/add",
    headers={"Content-Type": "application/json"},
    data=json.dumps(payload)
)

print(res.json())

Add Response

{
  "code": 200,
  "message": "Memory added successfully",
  "data": []
}

Search Request

payload = {
    "user_id": "8736b16e-1d20-4163-980b-a5063c3facdc",
    "readable_cube_ids": [
        "b32d0977-435d-4828-a86f-4f47f8b55bca"
    ],
    "query": "strawberry"
}

res = requests.post(
    "http://localhost:8000/product/search",
    headers={"Content-Type": "application/json"},
    data=json.dumps(payload)
)

print(res.json())

Search Response

{
  "code": 200,
  "message": "Search completed successfully",
  "data": {
    "text_mem": [],
    "act_mem": [],
    "para_mem": [],
    "pref_mem": [
      {
        "cube_id": "b32d0977-435d-4828-a86f-4f47f8b55bca",
        "memories": [],
        "total_nodes": 0
      }
    ],
    "tool_mem": [],
    "skill_mem": []
  }
}

Environment | 环境信息

  • MemOS: self-hosted via Docker Compose
  • Services confirmed running:
    • Neo4j
    • Qdrant
    • RabbitMQ
    • memos API
  • RabbitMQ connection issue resolved
  • Search endpoint reachable
  • Ubuntu 24.04 LTS

Additional Context | 其他信息

No response

Willingness to Implement | 实现意愿

  • I'm willing to implement this myself | 我愿意自己解决
  • I would like someone else to implement this | 我希望其他人来解决

Activity

  1. MaiHHConnect commented on Apr 19, 2026

    @MaiHHConnect
  2. added
    ai:taskDispatched to AI coding agent | 已派发给 AI 编码任务
    on Jun 29, 2026
  3. self-assigned this
    on Jun 30, 2026
  4. Memtensor-AI commented on Jun 30, 2026

    @Memtensor-AI
    Collaborator

    🤖 AutoDev has picked up this issue and started working on it.

    Task ID: 6d548ec04e483fce
    Working branch: bugfix/autodev-1493
    Target branch: latest dev* branch
    Workflow: opsp (analysis → coding → testing → PR)

    I will post the PR link here once done. If I need more information, I will ask in the comments.

  5. Memtensor-AI commented on Jun 30, 2026

    @Memtensor-AI
    Collaborator

    ✅ AutoDev task 6d548ec04e483fce completed.

    Summary: Fixed /product/add silently dropping memories under sync mode (#1493).

    Root cause: SimpleStructMemReader._get_llm_response in src/memos/mem_reader/simple_struct.py returned its salvage-fallback dict under the key "memory_list" (with underscore), while every downstream consumer in the same file (_process_chat_data line 397, _process_transfer_chat_data line 434) reads "memory list" (with space). The fallback was therefore dead code: when the LLM returned non-strict JSON for short inputs like "I like strawberry." (a common Kimi-K2 failure mode), _safe_parse returned {}, the fallback fired but emitted the wrong key, _process_chat_data yielded zero items, text_mem.add([]) wrote nothing to Neo4j/Qdrant, and /product/add still returned 200 + data: [] while the scheduler's downstream log_add_messages audit logged "No add/update items prepared". This is a duplicate of #1355 in symptom and root cause; the #1355 fix was merged on a different branch and had not propagated to dev-20260624-v2.0.22.

    Fix: one-character key rename from "memory_list" to "memory list" in the fallback branch (lines 288-299 of simple_struct.py), bringing the dead fallback back into alignment with the two consumers and the two sibling readers (multi_modal_struct.py:500, strategy_struct.py:67). Added 2 unit-level regression tests in tests/mem_reader/test_simple_struct_fallback.py that (a) pin the fallback dict key contract and (b) prove end-to-end that _process_chat_data(mode="fine") emits at least one TextualMemoryItem when the LLM output is unparseable. Both tests fail red on the buggy code (verified by running them pre-fix) and pass green after the one-character change.

    Verification: python3 -m pytest tests/mem_reader/test_simple_struct_fallback.py -v → 2 passed; python3 -m pytest tests/mem_reader/ -q → 44 passed + 2 pre-existing markitdown-extras failures (confirmed unrelated via git stash/rerun); python3 -m pytest tests/mem_scheduler/ -q → 61 passed + 1 skipped; ruff check and ruff format --check both clean on the two touched files. Committed b241194d and pushed bugfix/autodev-1493 to origin. opsp artifacts (task.md, proposal.md, spec.md, design.md, verification-report.md) are written under .ai-tasks/ and openspec/changes/ (excluded from the working branch via .git/info/exclude) and were synced to the sibling memos-autodev-specs repo at commit 6e2e41b on main.

    Base branch: main
    Branch: bugfix/autodev-1493
    Commit: b241194
    PR: #1989
    Assigned to: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller
    Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller

  6. added
    ai:testingAI agent is running tests | AI 正在运行测试
    ai:pr-readyAI-created PR is ready for review | AI 生成的 PR 已等待评审
    and removed
    ai:codingAI agent is coding | AI 正在编码
    ai:testingAI agent is running tests | AI 正在运行测试
    ai:taskDispatched to AI coding agent | 已派发给 AI 编码任务
    on Jun 30, 2026
  7. kimberly-WY commented on Jun 30, 2026

    @kimberly-WY

    Hit this same issue — the root cause was the missing null check before deserialization. Wrapping in a try/catch fixed it on our end.

  8. added a commit that references this issue on Jul 2, 2026
    06836ef
  9. added and removed
    ai:pr-readyAI-created PR is ready for review | AI 生成的 PR 已等待评审
    on Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:coreMOS 编排层 / 框架底座 / 跨模块问题types:bugSomething isn't working | 功能异常

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions