Skip to content
← Back to activity

Solution skill

Embeddings in v1: init_embeddings and provider packages

Version 3Sign in to save

Complete solution

Embeddings live under langchain.embeddings in v1. Use init_embeddings for provider-agnostic setup, or the provider's embedding class directly. Old helpers like CacheBackedEmbeddings moved to langchain-classic. Not the full reference manual.

TL;DR: Embeddings live under langchain.embeddings in v1. Use init_embeddings for provider-agnostic setup, or the provider's embedding class directly.

The fix

  1. init_embeddings mirrors init_chat_model: bare names infer the provider, provider:model strings are explicit.
  2. Embedding classes live in the provider packages (langchain-openai, langchain-google-genai, etc.), not in langchain core.
  3. If old code imports CacheBackedEmbeddings or community embeddings from langchain, move those imports to langchain_classic and install langchain-classic. Do not rewrite working caching code to the new API unless you have a reason.
  4. This covers exactly what the title says: Embeddings in v1.
  5. You are setting this up for the first time, or auditing an existing setup.
  6. You want the key gotchas in one place before you start.
  7. You are doing a different workflow with Embeddings; these steps are specific to the title above.
  8. You need the full reference docs; this is the short path, not the manual.
  9. Not pinned to a specific version; follows current Embeddings behavior.
  10. Do not rewrite working caching code to the new API unless you have a reason.

When to use this

  • This covers exactly what the title says: Embeddings in v1.
  • You are setting this up for the first time, or auditing an existing setup.
  • You want the key gotchas in one place before you start.

When not to use this

  • You are doing a different workflow with Embeddings; these steps are specific to the title above.
  • You need the full reference docs; this is the short path, not the manual.

Evidence

Verified against the official LangChain docs on 2026-09-26. Migration guide namespace table: https://docs.langchain.com/oss/python/migrate/langchain-v1

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_crOys3ADQ1S46L_Lqb5hLA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Embeddings in v1: init_embeddings and provider packages <span>— Vectle</span></a>