mongodb-memory-mcp: Skill for Claude Code

.claude/skills/embedding-model-migration/SKILL.md

embedding-model-migration is a skill for Claude Code from jtv4k/mongodb-memory-mcp. It costs 91 tokens per session (2,822 once invoked), scanned A, original, Apache-2.0.

A runbook for changing the model or service that turns text into searchable number lists, including changes to their size. It covers how to update stored data while keeping search usable.

In plain words
What is it for?
Use it to add a provider, change model or dimensions, rebuild the search index when needed, refill stored vectors, and check coverage.
Why use it?
Changing the model makes existing search data incompatible. The ordered process prevents an empty or partly broken knowledge base during the update.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is jtv4k/mongodb-memory-mcp's own configuration. It tells Claude Code how to work on mongodb-memory-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mongodb-memory-mcp configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/ndocker.sh npm run db:indexes -- --dry-run.

Reuse

Borrowing it

Nothing to install: this file belongs to jtv4k/mongodb-memory-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jtv4k/mongodb-memory-mcp/main/.claude/skills/embedding-model-migration/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/jtv4k/mongodb-memory-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for embedding-model-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/jtv4k/mongodb-memory-mcp/embedding-model-migration.svg)](https://agentmods.dev/skills/jtv4k/mongodb-memory-mcp/embedding-model-migration)
Your own site
<a href="https://agentmods.dev/skills/jtv4k/mongodb-memory-mcp/embedding-model-migration"><img src="https://agentmods.dev/badge/skills/jtv4k/mongodb-memory-mcp/embedding-model-migration.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,822 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.02822
Opus 5 $0.00046 $0.01411
Sonnet 5 $0.00018 $0.00564
Haiku 4.5 $0.00009 $0.00282

Measured 6d ago against content hash 427078f85439, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

embedding-model-migration scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sS http://localhost:3000/api/embedding-coverage \
.claude/skills/embedding-model-migration/SKILL.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Migrating the embedding model or provider

Changing the embedding model invalidates every vector in the corpus. Done in the wrong order it strands the knowledge base — search returns nothing, and the reason is invisible. Done in this order it is a background backfill during which search keeps working.


Why nothing gets orphaned

Every chunk records who embedded it, as flat, indexed, filterable fields:

embeddingProvider   'voyage'
embeddingModel      'voyage-context-3'
embeddingDimensions 1024
embeddedAt          <Date>

Plus a matching stamp on the parent document (document.embedding) for the management views. Two of those fields — embeddingModel and embeddingDimensions — are declared filter paths in src/db/index-definitions/chunks.vector.json, and that is what the whole migration story rests on:

  • Search is always constrained to the configured model. buildVectorFilter() in src/services/knowledge-service.ts unconditionally adds embeddingModel == config.embedding.model and embeddingDimensions == config.embedding.dimensions to every $vectorSearch. buildTextFilter() pins the model too (embeddingDimensions is not in chunks.text.json, which is fine — the vector leg pins both, and two configs sharing a model name but differing in width is pathological). So a half-migrated corpus returns fewer results, never a ranking that silently mixes two incompatible vector spaces. That failure mode — confidently wrong answers — is far worse than temporarily thin recall.
  • The backfill knows exactly what is left. "Stale" is embeddingModel != target OR embeddingDimensions != target, served by the chunks_embeddingModel_dimensions index.
  • storeContent notices too. An unchanged content hash whose chunks were embedded by a different model is re-ingested rather than skipped (event ingest.repair), so ordinary traffic helps the migration along.

Before you start

Answer these:

  1. Does the vector width change? voyage-context-3voyage-3.5 at the same 1024 dims is the easy case. Any change to EMBEDDING_DIMENSIONS means the vector index must be dropped and recreated (see step 3) and there is an unavoidable window where the old vectors are unmatchable.
  2. Is the new model contextual? CONTEXTUAL_MODELS in src/config/env.ts drives config.embedding.contextual. Moving from contextual to non-contextual is legal — the provider interface is the same either way — but retrieval characteristics change, so re-check quality by hand, not just by test.
  3. Does the width the model supports match? The env schema rejects an EMBEDDING_DIMENSIONS the model does not offer (2048 | 1024 | 512 | 256 for the known Voyage Matryoshka models). Add the model to KNOWN_MODEL_DIMENSIONS if it is new.
  4. How big is the corpus? GET /api/embedding-coverage (bearer token required) gives chunk and document counts per model. Multiply by your provider's rate limit to get a realistic wall-clock estimate before you start.

Read the full file on GitHub · 272 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 272 lines · 91 tokens per session scan A 427078f85439

Subscribe to this mod's changes

embedding-model-migration is a skill published in the GitHub repository jtv4k/mongodb-memory-mcp (0 stars, last pushed 2d ago), licensed Apache-2.0. It adds 91 tokens to every session and 2,822 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

embeddings

Vector embeddings with HNSW indexing, sql.js persistence, and hyperbolic support. 75x faster with agentic-flow integration. Use when: semantic search, pattern matching, similarity queries, knowledge retrieval. Skip when: exact text matching, simple lookups, no semantic understanding needed.

ruvnet/ruflo · 62 tokens

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

llm-app-patterns

Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.

davila7/claude-code-templates · 54 tokens

9router-embeddings

Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.

decolua/9router · 66 tokens

azure-search-documents-dotnet

Azure AI Search SDK for .NET (Azure.Search.Documents). Use for building search applications with full-text, vector, semantic, and hybrid search. Covers SearchClient (queries, document CRUD), SearchIndexClient (index management), and SearchIndexerClient (indexers, skillsets). Triggers: "Azure Search .NET"…

microsoft/skills · 102 tokens

embedding-strategies

Select and optimize embedding models for semantic search and RAG applications. Use when choosing embedding models, implementing chunking strategies, or optimizing embedding quality for specific domains.

foryourhealth111-pixel/Vibe-Skills · 37 tokens