Skip to content

Amazon Bedrock Embeddings

Amazon Bedrock Embeddings lets you turn plain text into numerical vectors (embeddings) that can be used for searching, clustering, or feeding into other AI models. It connects to Amazon Bedrock, a cloud service that hosts powerful language models, and returns a set of numbers that capture the meaning of your text.

How it Works

When you add this component to your workflow, it uses the Amazon Bedrock API to send your text to a chosen model (currently only amazon.titan-embed-text-v1). The API processes the text and returns an embedding vector. The component handles authentication automatically: you first set up an Amazon Bedrock API credential in Nappai, then select that credential in the component. The component then uses the credential’s access key, secret key, and region to create a secure connection to Bedrock. Finally, it calls the Bedrock runtime client and returns the embeddings.

Inputs

Mapping Mode

This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:

  • Fixed: You type the value directly into the field.
  • Mapped: You connect the output of another component to use its result as the value.
  • Javascript: You write Javascript code to dynamically calculate the value.

This flexibility allows you to create more dynamic and connected workflows.

Input Fields

The following fields are available to configure this component. Each field may be visible in different operations:

  • Endpoint URL: The URL of the Bedrock endpoint you want to use. Leave blank to use the default endpoint for the selected region.
  • Model Id: The identifier of the Bedrock embedding model. The only available option is amazon.titan-embed-text-v1.

Important: This component uses a special Credential field to select an Amazon Bedrock API credential that you must create in the Nappai credentials section. Do not enter any keys or secrets directly in the component.

Outputs

  • Embeddings: The component outputs a set of embeddings (a list of numbers) that represent the input text. These embeddings can be stored in a vector database, used for similarity searches, or passed to other AI components.

Usage Example

  1. Create a Credential
    In Nappai, go to CredentialsAdd CredentialAmazon Bedrock API. Enter your AWS Access Key ID, Secret Access Key, and region.

  2. Add the Component
    Drag the Amazon Bedrock Embeddings component into your workflow.

    • Select the credential you just created.
    • Choose the model amazon.titan-embed-text-v1.
    • (Optional) Set a custom Endpoint URL if you are using a custom Bedrock endpoint.
  3. Provide Text
    Connect a text source (e.g., a Text Input component or a Read File component) to the Embeddings output of this component. If you want to process many documents at once, enable Mapping Mode and map the text list to the component.

  4. Use the Embeddings
    Feed the embeddings into a Vector Store component or a Similarity Search component to find related documents or to cluster your data.

  • Amazon Bedrock Text Generation – Generate natural language text from prompts.
  • Amazon Bedrock Text Classification – Classify text into predefined categories.
  • Amazon Bedrock Summarization – Produce concise summaries of longer documents.

Tips and Best Practices

  • Choose the right region: Use the region that matches your Bedrock deployment to reduce latency.
  • Use Mapping Mode for batch processing: When you have many documents, enable Mapping Mode and map a list of texts to generate embeddings in one go.
  • Keep credentials secure: Store your AWS keys in Nappai’s credential store and never hard‑code them in your workflow.
  • Monitor usage: Bedrock charges per token; keep an eye on your usage to avoid unexpected costs.

Security Considerations

  • The component relies on AWS credentials; ensure that the IAM role or user you use has only the permissions required for Bedrock embeddings.
  • Store credentials in Nappai’s secure credential store and never expose them in logs or UI.
  • If you use a custom endpoint, verify that the endpoint is protected by proper authentication and network controls.