MemPalace / MemPalace/mempalace

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

Open
#1,663 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/i18n area/search enhancement P2
Dominant language
Python
Stars
59.2k
Forks
7.6k
Avg merge
3d 5h
Merged PRs (30d)
88

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading mempalace/embedding.py and mempalace/onboarding.py, then inspect the existing mempalace migrate and repair CLI paths. Trace how the current embedding function and model choice are configured, and check the README references for the intended model names. Done means model selection is configurable, the current English model remains the default, and existing palaces have a documented re-indexing path for model changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
huggingface, python
Domain
cli, databases, machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.