Skip to main content
View source

OpenAI (Embedding)

View as Markdown

A RocketRide embedding node that converts document chunks and search queries into vectors using OpenAI's embedding API.

What it does

Generates text embeddings using OpenAI's embedding API. Documents arriving on the documents lane have an embedding vector (and the embedding_model name) attached to each chunk, ready for ingestion into a vector store. Questions arriving on the questions lane are embedded with the same model so they can be matched against a stored index.

Uses langchain-openai (OpenAIEmbeddings) under the hood. Document chunks are embedded in a single batched embed_documents call per write; questions are embedded one at a time with embed_query. An empty document list is a no-op.

At pipeline startup the node makes one small probe call (embedding the string "dummy") to discover the model's vector size, since the API does not report it directly: expect one extra tiny request when the pipeline starts. The maximum token count per request is read from the model's context length (embedding_ctx_length).

Requires an OpenAI API key.


Configuration

Lanes

LaneDirectionDescription
documentsin / outEmbed document text; attach vector to each chunk for vector store ingestion
questionsin / outEmbed a query string; attach vector for similarity search against a stored index

Fields

FieldTypeDescription
modelstringOpenAI model to use for embedding
profilestringDefault "text-embedding-3-small". OpenAI embedding model

Each profile resolves to a model name and token limit that the wrapper passes to OpenAIEmbeddings.

Profiles

ProfileModelNotes
Text Small (default)text-embedding-3-smallEfficient, good general-purpose performance
Text Largetext-embedding-3-largeHigher accuracy, larger vector representation
Text Adatext-embedding-ada-002Legacy model (first OpenAI embeddings model)

All three models accept up to 8,191 tokens per input.


Authentication

Set the apikey field to your OpenAI API key. The key is resolved per profile, so if you switch profiles you may supply a different key for each. There is no support for organization-scoped keys or Azure OpenAI endpoints in this node.


Schema

FieldTypeDescriptionDefault
openai_embed.modelstringModel name
OpenAI model to use for embedding
openai_embed.profilestringModel
OpenAI embedding model
"text-embedding-3-small"

Dependencies

  • openai
  • langchain-openai