Skip to content

Feature request: support configurable embedding model (e.g. embeddinggemma-300m for multilingual) #1663

@HZaxx

Description

@HZaxx

Problem

mempalace/embedding.py hardcodes ONNXMiniLM_L6_V2 (all-MiniLM-L6-v2), an English-only model. For non-English users (Chinese, Japanese, Arabic, etc.), semantic search quality is significantly degraded because the model cannot understand non-English text.

The README already advertises embeddinggemma-300m (multilingual, 100+ languages) as an onboarding option, but the current codebase has no mechanism to actually use it.

Current behavior

# mempalace/embedding.py — hardcoded
def _build_ef_class():
    from chromadb.utils.embedding_functions import ONNXMiniLM_L6_V2
    class _MempalaceONNX(ONNXMiniLM_L6_V2):
        ...

Proposed solution

Allow model selection via config or env var, e.g.:

# ~/.mempalace/config.json
{
  "embedding_model": "multilingual"  # or "english" (default)
}

Where "multilingual" maps to embeddinggemma-300m (or a configurable HuggingFace model ID) and "english" keeps the current all-MiniLM-L6-v2.

The model switch should:

  1. Be backward-compatible (default stays all-MiniLM-L6-v2)
  2. Trigger a mempalace migrate or mempalace repair to re-index existing palaces (different model = different vector dims)
  3. Auto-download the model on first use

Context

  • README references: embeddinggemma-300m (multilingual) and all-MiniLM-L6-v2 (English-only)
  • mempalace/onboarding.py mentions model choice in README but not in code
  • mempalace/migrate CLI command already exists but doesn't handle model migration yet
  • ChromaDB SentenceTransformerEmbeddingFunction can load arbitrary HuggingFace models, which would be a natural implementation path

Impact

Non-English users currently get poor semantic search results. For a tool advertised as "the best-benchmarked open-source AI memory system", multilingual support is table stakes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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