Skip to content

Docker deployment: daemon loses embedding/LLM config when started outside Python adapter #1520

@SonicBotMan

Description

@SonicBotMan

Summary

When MemTensor runs inside a Docker container and the daemon is started directly from the container's entrypoint.sh (instead of being lazily spawned by the Python adapter's bridge_client.py), the bridge process cannot locate its config.yaml, resulting in:

  • No embedding provider — falls back to local or disabled
  • No LLM provider — summarization/reflection features break
  • Wrong data directory — falls back to ~/.openharness/memos-state (empty) instead of ~/.hermes/memos-plugin/data/
  • Lost branding — no custom title/logo

Root Cause

core/config/paths.ts resolves the runtime home via:

  1. MEMOS_HOME env var
  2. MEMOS_CONFIG_FILE env var
  3. Built-in default: ~/.<agent>/memos-plugin/

When the Docker entrypoint starts the daemon with just node bridge.cts --agent=hermes, none of these env vars are set. In v1.x, MEMOS_BRIDGE_CONFIG was used but only carried stateDir, missing config and branding. In v2.0, the YAML-based config system is cleaner but still requires either:

  • MEMOS_HOME pointing to the correct runtime directory, or
  • config.yaml existing at ~/.hermes/memos-plugin/config.yaml

In a Docker container where HOME=/opt/data, the default resolves to /opt/data/.hermes/memos-plugin/ which may not exist or may not have the config file generated by install.sh.

Environment

  • Hermes Agent in Docker (official nousresearch/hermes-agent image)
  • MemOS v1.0.3 (also reproducible conceptually with v2.0-alpha)
  • MemTensor installed via install.sh to /opt/data/home/.hermes/memos-plugin/
  • Container entrypoint.sh starts daemon as a background service before Hermes main process

Workaround (current)

We created a start_memtensor.sh script on the persistent volume that:

  1. Reads openclaw.json to extract Siliconflow embedding/LLM config
  2. Injects full MEMOS_BRIDGE_CONFIG with stateDir, config, and branding
  3. Starts the daemon with proper environment

This works but is fragile and couples the startup script to a specific provider's config format.

Suggested Fix

  1. Document MEMOS_HOME and MEMOS_CONFIG_FILE env vars prominently in the README and Docker deployment guide
  2. Add a --home CLI flag to bridge.cts as an alternative to env vars (easier for Docker CMD/ENTRYPOINT)
  3. Add a Docker deployment example showing proper env var setup
  4. Graceful fallback: when config.yaml is missing, log a clear warning with the expected path and a link to the configuration docs

Related Files

  • apps/memos-local-plugin/core/config/paths.ts — env var resolution
  • apps/memos-local-plugin/bridge.cts — daemon entry point
  • apps/memos-local-plugin/templates/config.hermes.yaml — config template
  • apps/memos-local-plugin/install.sh — generates config.yaml at install time

Happy to submit a PR with the documentation improvements and --home flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-taskAutoDev task dispatched to AI coding agent | AI 编码任务bugSomething isn't working | 功能异常pluginPlugin/adapter/bridge layer (apps/ directory) | 插件/适配层

    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