Skip to main content
Native embeddings let LambdaDB generate vector values from fields in your documents and store them in a vector field. Sources can be text, or text and images with a multimodal model. Choose the provider and model in the field’s embedding configuration. LambdaDB handles:
  • provider credentials
  • vector generation during document writes
  • query embedding generation for vector search
Native embedding generation consumes inference usage. Inference usage is measured in LIU (LambdaDB Inference Unit). See Understanding costs.

Supported providers and models

LambdaDB’s dimension limits also apply when the embedding provider accepts smaller values. Optional embedding.similarity supports cosine and euclidean; all models default to cosine.

Collection schema

Define a vector field with an embedding block to let LambdaDB generate its vectors. sources lists the document fields to embed, in order, each with its type.
A Cohere field can combine several text and image sources into one vector. Source fields do not need their own index configs; photos below is stored but not indexed:

Schema rules

See Limits for a summary of source, image, and request constraints. Use the recommended SDK, CLI, MCP server, and Migration CLI releases for native configuration.
  • embedding.provider, embedding.model, and embedding.sources are required
  • embedding.sources holds a nonempty ordered list of { "field", "type" } entries; type is text or image, and field paths must be unique
  • a source field is a dotted path in the stored document; it does not need an index config. If it is indexed, the leaf must be text or keyword and its ancestors must be object fields
  • OpenAI models accept exactly one text source; Cohere models accept text and image sources in any order
  • native embedding vector fields must not use top-level dimensions or similarity; set them inside embedding, where omitted values use the model defaults
  • LambdaDB resolves and stores the effective embedding.dimensions and embedding.similarity

Write behavior

Send the source fields and let LambdaDB generate the vector. You can also send the vector field directly; a supplied vector is stored as is and skips inference and image retrieval for that document. Text sources must be scalar strings. Image sources are a string or a flat array of strings; every array element is embedded with the other sources into one combined vector. Missing sources and empty image arrays are skipped; if no source is present, no vector is generated. Explicit null, arrays on text sources, objects, and other non-string values return HTTP 400 when inference is needed. To omit a source, leave out the JSON property rather than setting it to null. Example upsert payloads for the two schemas above:

Text input limits

Use nonempty source text within the selected provider’s input budget: OpenAI token budgets follow its embedding input contract. LambdaDB requests no truncation for Cohere, so an input over the model’s context limit is rejected with HTTP 400. These limits apply to source text and query text, independently of LambdaDB’s request and document byte limits. LambdaDB sends source strings to the provider without automatic chunking or truncation. Split long documents into separate records with stable chunk IDs before writing them, and count tokens using the selected model’s tokenizer. When writing many long records, use smaller upsert or update batches to stay within the provider’s combined token limit.

Image inputs

Image sources are available with Cohere models. Each value is either a public HTTPS URL that LambdaDB downloads, or a data URI with base64 content, such as data:image/png;base64,.... Supported formats are PNG, JPEG, GIF, and WebP. Images are downloaded and decoded while the write or query is prepared; they are not stored by LambdaDB, and the document keeps the original URL or data URI. See embedding limits for the allowed number of parts and images, decoded image bytes, and pixel count. A failed download, an unsupported or mismatched format, or an input over these limits returns HTTP 400.

Failed embedding generation

Embedding generation completes before a write is submitted for indexing. If generation fails for any document or native field, the write request fails without submitting its documents; it does not store a partially embedded batch. Successful embedding calls can still consume inference usage if a later call in the same request fails. Native embeddings have no returnOriginal fallback. The reranking failure policy applies only to the reranking stage; it cannot bypass query embedding failures. For an overall request timeout or an unknown write outcome, verify the resulting state before retrying.

Query behavior

A knn query on a native embedding vector field takes exactly one of:
  • queryText: text that LambdaDB embeds with the field’s model
  • queryInputs: ordered parts, each { "type": "text" | "image", "value": "..." }; Cohere fields accept mixed text and image parts, OpenAI fields accept one text part
  • queryVector: a vector you computed yourself, which skips inference
Query text must be nonblank and fit the input limits above; query images follow the image input limits. LambdaDB prepares all inputs and generates the query vector before retrieval; if that fails, the query fails without returning search results.
For full query examples, see Vector query.

Bulk upsert

Bulk upsert never generates embeddings. For each native embedding field, a document with no source values can omit the vector; a document with a present source must supply the vector directly. A document with a present source but no vector fails the whole bulk request before any documents are committed; empty image arrays are skipped. To generate embeddings, use the regular upsert or update flow.