Skip to main content
These docs will be deprecated and no longer maintained with the release of LangChain v1.0 in October 2025. Visit the v1.0 alpha docs

Nomic

The NomicEmbeddings class uses the Nomic AI API to generate embeddings for a given text.

Setup

In order to use the Nomic API you'll need an API key. You can sign up for a Nomic account and create an API key here.

You'll first need to install the @langchain/nomic package:

  • npm
  • Yarn
  • pnpm
npm install @langchain/nomic @langchain/core

Usage

import { NomicEmbeddings } from "@langchain/nomic";

/* Embed queries */
const nomicEmbeddings = new NomicEmbeddings();
const res = await nomicEmbeddings.embedQuery("Hello world");
console.log(res);
/* Embed documents */
const documentRes = await nomicEmbeddings.embedDocuments([
"Hello world",
"Bye bye",
]);
console.log(documentRes);

API Reference:


Was this page helpful?


You can also leave detailed feedback on GitHub.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.