Skip to content

[Bug]: SUPERMEMORY_EMBEDDING_PROVIDER and related env vars are ignored — embedding hardcoded to local #1336

Description

@DengHaitao-2022

Bug Description

The self-hosted Supermemory server ignores the SUPERMEMORY_EMBEDDING_PROVIDER, SUPERMEMORY_EMBEDDING_MODEL, SUPERMEMORY_EMBEDDING_DIMENSIONS, and SUPERMEMORY_EMBEDDING_BASE_URL environment variables documented at https://supermemory.ai/docs/self-hosting/embeddings. The embedding provider is hardcoded to local with model Xenova/bge-base-v1.5 (768d).

Environment Variables Not Read

The binary only references SUPERMEMORY_EMBEDDING_RAM_LIMIT — none of the following documented variables are present in the compiled binary:

  • SUPERMEMORY_EMBEDDING_PROVIDER
  • SUPERMEMORY_EMBEDDING_MODEL
  • SUPERMEMORY_EMBEDDING_DIMENSIONS
  • SUPERMEMORY_EMBEDDING_BASE_URL

Proof (binary analysis)

# Only EMBEDDING_RAM_LIMIT is found
strings /usr/local/bin/supermemory-server | grep -o "SUPERMEMORY_EMBEDDING[A-Z_]*" | sort -u
# Output: SUPERMEMORY_EMBEDDING_RAM_LIMIT

# Default provider hardcoded
strings /usr/local/bin/supermemory-server | grep "var y90"
# Output: var y90="local"

Steps to Reproduce

  1. Set environment variables in /etc/supermemory/supermemory.env:
SUPERMEMORY_EMBEDDING_PROVIDER=openai
SUPERMEMORY_EMBEDDING_MODEL=BAAI/bge-m3
SUPERMEMORY_EMBEDDING_DIMENSIONS=1024
SUPERMEMORY_EMBEDDING_BASE_URL=http://10.10.0.2:3004/v1
  1. Restart the service
  2. Check logs — still shows * local embeddings Xenova/bge-base-v1.5
  3. Verify env vars are loaded in process

Expected Behavior

The server should use the configured embedding provider (e.g., OpenAI-compatible endpoint with BAAI/bge-m3).

Actual Behavior

The server always uses local Xenova/bge-base-v1.5 (768d) regardless of environment variable configuration.

Affected Versions

  • v0.0.6 (stable)
  • v0.0.7-rc.2 (pre-release)

Impact

Users with non-English content cannot use the self-hosted server effectively because the default local model is English-only. The documented workaround (switching to remote embedding or local bge-m3) does not work.

Additional Context

  • Platform: Ubuntu 24.04, x86_64
  • Installation: systemd service
  • The OpenAI-compatible endpoint works correctly when tested directly via curl
  • The LLM configuration (OPENAI_BASE_URL, OPENAI_MODEL) works fine — only embedding is affected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions