Skip to main content

Module bedrock_provider

Module bedrock_provider 

Source
Expand description

Native AWS Bedrock (Amazon Titan) embedding provider (sync ureq + SigV4). AWS Bedrock embedding provider (Amazon Titan) over the InvokeModel REST API.

Deliberately dependency light: a synchronous ureq call plus a small hand-rolled SigV4 signer, so the engine gains native Bedrock support without pulling in the full async AWS SDK. This matches the lean, no-heavy-deps philosophy of the rest of the engine (see the http provider).

Credentials come from the standard AWS environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN for temporary/SSO credentials). Full credential-chain resolution (profiles, instance metadata) is intentionally out of scope for this provider; export credentials or use the platform’s SDK-backed path for those.

use mentedb_embedding::bedrock_provider::{BedrockEmbeddingConfig, BedrockEmbeddingProvider};
use mentedb_embedding::provider::EmbeddingProvider;

let cfg = BedrockEmbeddingConfig::titan_v2("us-east-1")?; // reads creds from env
let provider = BedrockEmbeddingProvider::new(cfg)?;
let vector = provider.embed("the sky is blue")?;

Structs§

AwsCredentials
AWS credentials for signing, loaded from the standard environment variables.
BedrockEmbeddingConfig
Configuration for the Bedrock Titan embedding provider.
BedrockEmbeddingProvider
Synchronous Bedrock (Titan) embedding provider.