Skip to content

Fix mem0 dependency for debug runtimes - #855

Open
FirstayZheng wants to merge 1 commit into
volcengine:mainfrom
FirstayZheng:fix/mem0-debug-dependency
Open

Fix mem0 dependency for debug runtimes#855
FirstayZheng wants to merge 1 commit into
volcengine:mainfrom
FirstayZheng:fix/mem0-debug-dependency

Conversation

@FirstayZheng

Copy link
Copy Markdown
Contributor

背景

在 Studio 创建 Agent 并配置长期记忆后端为 mem0 时,本地/云端调试运行会在启动阶段失败:

ModuleNotFoundError: No module named 'mem0'
ImportError: LongTermMemory backend 'mem0' requires veadk-python[database]

根因是生成 Agent 项目的 requirements.txt 已经会为 mem0 添加 veadk-python[database],但 Studio 调试运行并不会安装临时项目里的 requirements,而是直接复用 Studio/WebUI 进程所在 Python 环境启动调试 runner。旧的 Studio 部署包只安装 veadk-python,harness 镜像也没有带 database extra,因此 mem0 SDK (mem0ai) 不会被安装。

修改内容

  • Studio 部署包默认安装 veadk-python[database],让调试 runner 所在环境包含 mem0 依赖。
  • --from-source 构建本地 Studio wheel 时,为本地 wheel requirements 追加 [database] extra。
  • harness Dockerfile 和 open-source harness 模板安装 database,extensions,harness extras,覆盖 LONG_TERM_MEMORY_TYPE=mem0 的运行场景。
  • 修正 mem0 backend 缺依赖提示,从 pip install mem0 改为指向 veadk-python[database] / mem0ai>=1.0.0,<2
  • 增加测试覆盖 Studio/harness requirements 以及 mem0 缺依赖提示。

验证

  • .venv/bin/pre-commit run --files ...
  • .venv/bin/python -m pytest tests/cli/test_cli_harness_open_source_defaults.py tests/cli/test_studio_deploy_target.py::test_studio_deploy_byteplus_wires_provider_to_cloud_engine_and_package tests/cli/test_studio_deploy_target.py::test_studio_deploy_from_source_bundles_unmirrored_dependencies tests/memory/long_term_memory_backends/test_mem0_backend.py tests/cli/test_studio_release.py tests/cli/test_studio_update.py::test_studio_update_preserves_branding_and_updates_existing_ids tests/cli/test_studio_update.py::test_studio_update_supports_byteplus_provider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant