Amazon Bedrock
Amazon Bedrock is a managed foundation model platform on AWS. seekdb provides an AmazonBedrockEmbeddingFunction wrapper 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
AmazonBedrockEmbeddingFunction uses boto3 to call the Bedrock embedding API. In practice, you typically need:
- An AWS account with Bedrock enabled and permission to invoke the target embedding model
- AWS credentials available via the standard
boto3credential chain (for example, environment variables, shared credentials file, or an IAM role) - Python packages:
pyseekdbandboto3
Example: create an Amazon Bedrock embedding function
import boto3
from pyseekdb.utils.embedding_functions import AmazonBedrockEmbeddingFunction
session = boto3.Session(profile_name="profile", region_name="us-east-1")
ef = AmazonBedrockEmbeddingFunction(
session=session,
model_name="amazon.titan-embed-text-v2",
)
Parameters
session: aboto3.Sessionused for credentials and region configuration.model_name: the Bedrock embedding model ID (for example,amazon.titan-embed-text-v2).
tip
Model availability and supported regions may change over time. For details, see https://docs.aws.amazon.com/bedrock/.