Skip to content

LangChain embedder

An adapter that wraps a caller-provided LangChain Embeddings object rather than calling any API itself. Selected via EMBEDDING_PROVIDER=langchain.

Enable it

bash
EMBEDDING_PROVIDER=langchain
EMBEDDING_DIMS=<dimension of your wrapped model>

pip install langchain-core (plus whichever LangChain embeddings integration you wrap).

Configuration

VariableDefaultDescription
EMBEDDING_PROVIDERopenaiSet to langchain.
EMBEDDING_DIMS1536Vector dimension; must match the wrapped model's output.

Notes

  • Unlike the other providers this one embeds no HTTP or SDK logic of its own; it wraps a LangChain Embeddings instance passed in as model (or config) and maps embed and embed_batch onto its embed_query and embed_documents.
  • It requires that instance to be supplied in code; there is no env var to name a LangChain model, and it raises if none is passed.
  • If the passed object lacks embed_query / embed_documents, it raises a clear error, and if LangChain is not installed it raises an ImportError with the install hint.

The memory layer for AI agents.