You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Re-embed existing memories when embedding model/provider changes #1333
I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题
Problem
When a user changes their embedding model configuration (e.g., switching from text-embedding-3-small to text-embedding-3-large, or from OpenAI to a self-hosted model), existing memories become incompatible with vector search.
The embeddings table stores vectors with dimensions but does not store which embedding model/provider generated them:
Summary: Resolves issue #1333 by teaching memos-local-openclaw-plugin to detect embedding model/provider changes and provide a re-embed CLI. Every embedding row in embeddings, skill_embeddings, task_embeddings, hub_embeddings, hub_skill_embeddings, and hub_memory_embeddings is now tagged with (provider, model) via an idempotent migration; ingest / viewer / hub call sites pass the producer triple from the live Embedder. On plugin init, when legacy or mismatched rows exist, the plugin emits a single warn line pointing the user to pnpm exec tsx scripts/re-embed.ts.
The new scripts/re-embed.ts resolves ~/.openclaw/openclaw.json, prints a before/after stats block (matched / mismatched / legacy / missing plus byProducer counts), and re-embeds in configurable batches. Supports --missing-only, --dry-run, --limit, --batch-size, --db, and --config. Failures inside a batch log a warn and continue so a single bad row doesn't abort the run; re-running picks up where it left off because the candidate list is recomputed each time.
Verification: 15 new tests in tests/embedding-reembed.test.ts cover migration, producer-aware writes, getEmbeddingStats, listChunkIdsForReembed, Embedder.signature, the init warning, CLI arg parsing, and dry-run no-write behavior — all pass. 132/132 in 13 related suites (storage, hub-server, recall, integration, migration-status, plugin-impl-access, multi-agent, skill-sync, worker-lifecycle, viewer-config, policy, capture) pass. tsc --noEmit is clean. The 5 pre-existing failures elsewhere in the repo (accuracy / skill-auto-install / task-processor / update-install) were confirmed unchanged on the unmodified baseline via git stash and are unrelated to this change.
Activity
Memtensor-AI commentedon Jun 30, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
aaa5d7dd575337baWorking branch:
feature/autodev-1333Target branch:
latest dev* branchWorkflow: opsp (analysis → coding → testing → PR)
I will post the PR link here once done. If I need more information, I will ask in the comments.
feat(memos-local-openclaw): detect embedding model change and add re-…
Memtensor-AI commentedon Jun 30, 2026
✅ AutoDev task
aaa5d7dd575337bacompleted.Summary: Resolves issue #1333 by teaching
memos-local-openclaw-pluginto detect embedding model/provider changes and provide a re-embed CLI. Every embedding row inembeddings,skill_embeddings,task_embeddings,hub_embeddings,hub_skill_embeddings, andhub_memory_embeddingsis now tagged with(provider, model)via an idempotent migration; ingest / viewer / hub call sites pass the producer triple from the liveEmbedder. On plugin init, when legacy or mismatched rows exist, the plugin emits a single warn line pointing the user topnpm exec tsx scripts/re-embed.ts.The new
scripts/re-embed.tsresolves~/.openclaw/openclaw.json, prints a before/after stats block (matched / mismatched / legacy / missingplusbyProducercounts), and re-embeds in configurable batches. Supports--missing-only,--dry-run,--limit,--batch-size,--db, and--config. Failures inside a batch log a warn and continue so a single bad row doesn't abort the run; re-running picks up where it left off because the candidate list is recomputed each time.Verification: 15 new tests in
tests/embedding-reembed.test.tscover migration, producer-aware writes,getEmbeddingStats,listChunkIdsForReembed,Embedder.signature, the init warning, CLI arg parsing, and dry-run no-write behavior — all pass. 132/132 in 13 related suites (storage, hub-server, recall, integration, migration-status, plugin-impl-access, multi-agent, skill-sync, worker-lifecycle, viewer-config, policy, capture) pass.tsc --noEmitis clean. The 5 pre-existing failures elsewhere in the repo (accuracy / skill-auto-install / task-processor / update-install) were confirmed unchanged on the unmodified baseline viagit stashand are unrelated to this change.Base branch:
mainBranch:
feature/autodev-1333Commit:
346d867PR: #1975
Assigned to: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller
Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller
Fix #1333: [Feature Request] Re-embed existing memories when embeddin…