Cosmos DB icon

Cosmos DB

Cosmos DB Node - Upsert documents to Azure Cosmos DB

Item → Document Indexing

AI-generated

Summary

Index chunks from a connected Document Loader into the selected Cosmos DB container. The node embeds each chunk with a connected Embeddings sub-node and upserts it as a document for vector and full-text search.

Inputs

  • Authentication Type (required) — Choose Master Key or Microsoft Entra ID (Azure AD) credentials to connect to Cosmos DB.
  • Database Name or ID (required) — Select or enter the target database.
  • Container Name or ID (required) — Select or enter the target container.
  • Document Loader (required) — Connect a Document Loader sub-node; it must return at least one chunk.
  • Embeddings (required) — Connect an Embeddings sub-node to generate a vector for each chunk.
  • Partition Key Value (required) — Set the value shared by every indexed chunk for the container’s partition key field.
  • Vector Field Name (required) — Name the field that stores each chunk’s embedding vector; defaults to vector.
  • Full Text Field Name (required) — Name the field that stores each chunk’s text for full-text search; defaults to text. The text is also stored in content.
  • Add Metadata — Enable this to add the same custom metadata object to every indexed chunk.
  • Metadata (JSON) — When metadata is enabled, provide a JSON object to store in each chunk’s metadata field.
  • Simplify Output — When enabled, omit the configured text and vector fields and Cosmos DB internal fields from returned documents; defaults to false.
  • Use Dev Override (Custom Endpoint + Token) — Optionally bypass the selected credential flow with a custom Cosmos DB endpoint and bearer token.
  • Custom Endpoint — Cosmos DB account endpoint, shown when Dev Override is enabled.
  • Custom Access Token — Bearer token for Cosmos DB, shown when Dev Override is enabled.

Output shape

A list of items, one per indexed chunk.

Each chunk is upserted with a generated ID based on the source filename and chunk position, the configured partition key value, the chunk text in content and the configured text field, and its embedding in the configured vector field. If metadata is supplied, it is added under metadata. Returned JSON contains the Cosmos DB upserted document, or the constructed document if no resource is returned; Simplify Output removes the text, vector, and internal Cosmos DB fields.

Links

Discussion