> Documentation index for agents: https://docs.rocketride.ai/llms.txt

# embedding_openai

A RocketRide embedding node that turns document chunks and questions into OpenAI API vectors; choose it when both ingestion and retrieval should use the same hosted text embedding model.

## About OpenAI

OpenAI develops AI services and APIs. This node uses its embedding API through the `langchain-openai` integration to represent text as numeric vectors.

## What it does

The node adds an `embedding` and `embedding_model` to documents and questions. Choose it over `embedding_transformer` when the selected embedding model should be called through OpenAI rather than loaded as a local sentence transformer. Documents in one write are sent to `embed_documents` as a batch; questions use `embed_query`.

## Lanes

| Lane in | Lane out | Description |
|---|---|---|
| `documents` | `documents` | Embeds document chunks for storage. |
| `questions` | `questions` | Embeds questions for matching against stored vectors. |

## Profiles

Default: **Text Small - A highly efficient model** (`text-embedding-3-small`).

| Profile | Model | Context tokens |
|---|---|---|
| `text-embedding-3-small` *(default)* | `text-embedding-3-small` | 8,191 |
| `text-embedding-3-large` | `text-embedding-3-large` | 8,191 |
| `text-embedding-ada-002` | `text-embedding-ada-002` | 8,191 |
| `text-embedding-004` | `text-embedding-004` | 2,048 |
| `text-embedding-005` | `text-embedding-005` | 2,048 |
| `text-embedding-3-small-inference` | `text-embedding-3-small-inference` | 8,191 |
| `text-embedding-ada-002-v2` | `text-embedding-ada-002-v2` | 8,191 |
| `text-embedding-large-exp-03-07` | `text-embedding-large-exp-03-07` | 8,192 |
| `text-embedding-preview-0409` | `text-embedding-preview-0409` | 3,072 |

This node currently supports `text-embedding-3-small`, `text-embedding-3-large`,
and `text-embedding-ada-002`. The other declared profiles require LiteLLM
routing, which this node does not currently implement; selecting one sends its
model name to the OpenAI endpoint and fails during the startup probe.

## Configuration

Select the profile used for both document ingestion and question embedding. The wrapper reads the profile’s configured model and token limit, and probes the selected model with `dummy` at startup to discover the vector size; account for that small startup request.

### Model

The model value is passed to `OpenAIEmbeddings`. Keep the same profile for ingestion and querying the same vector index; changing it can change the vector representation and makes previously stored vectors unsuitable for new questions.

## Authentication

Set the secure `llm.cloud.apikey` field for the selected profile. RocketRide
resolves this field as `apikey` and passes it to `OpenAIEmbeddings`. If no
configured key is available, `langchain-openai` can fall back to the engine
process's `OPENAI_API_KEY` environment variable. The startup probe fails when
neither source provides a usable key.

## Upstream docs

- [OpenAI API documentation](https://platform.openai.com/docs)
- [langchain-openai documentation](https://python.langchain.com/docs/integrations/text_embedding/openai/)

<!-- ROCKETRIDE:GENERATED:PARAMS START -->
<!-- Generated by nodes:docs-generate. Do not edit by hand. -->

## Schema

| Field | Type | Description | Default |
|---|---|---|---|
| `openai_embed.model` | `string` | **Model name**<br/>OpenAI model to use for embedding |  |
| `openai_embed.profile` | `string` | **Model**<br/>OpenAI embedding model | `"text-embedding-3-small"` |

## Dependencies

- `openai`
- `langchain-openai`

## Source

[<svg viewBox="0 0 16 16" width="15" height="15" fill="currentColor" aria-hidden="true" style="vertical-align:-0.15em;margin-right:0.35em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg> View source](https://github.com/rocketride-org/rocketride-server/tree/develop/nodes/src/nodes/embedding_openai)
<!-- ROCKETRIDE:GENERATED:PARAMS END -->
