Amazon Bedrock
Amazon Bedrock is a managed foundation model platform on AWS and supports multiple embedding models. seekdb provides AmazonBedrockEmbeddingFunction so you can generate embeddings via Bedrock and use them with seekdb collections.
tip
Using Amazon Bedrock service requires you to follow AWS's pricing rules and may incur corresponding fees. Before proceeding, please visit their official website or refer to relevant documentation to confirm and accept their pricing standards. If you do not agree, please do not proceed.
Dependencies and authentication
Ensure your AWS account has Bedrock enabled and that you have permission to invoke the target embedding model.
Installation
npm i seekdb @seekdb/amazon-bedrock
Example: create an Amazon Bedrock embedding function
import { AmazonBedrockEmbeddingFunction } from "@seekdb/amazon-bedrock";
const ef = new AmazonBedrockEmbeddingFunction({
region: "us-east-1",
modelName: "amazon.titan-embed-text-v2",
});
Configurations:
- apiKey: Bedrock API key (optional; if omitted, read from the environment).
- apiKeyEnv: Environment variable name for the API key (default:
"AMAZON_BEDROCK_API_KEY"). - region: AWS region (required; for example,
"us-east-1"). - modelName: Embedding model name (default:
"amazon.titan-embed-text-v2").