@kozmoai/rag-ai-backend-embeddings-aws v0.2.1
RAG AI Backend-embeddings AWS Bedrock submodule
This is a submodule for the @kozmoai/rag-ai-backend
module, which provides functionality to use AWS Bedrock embeddings to generate a RAG AI Backend plugin for Backstage. It integrates @backstage/integration-aws-node
package for fetching AWS account credentials.
Initialization
const vectorStore = await createGlintPgVectorStore({ logger, database });
const awsCredentialsManager = DefaultAwsCredentialsManager.fromConfig(config);
const credProvider = await awsCredentialsManager.getCredentialProvider();
const augmentationIndexer = await initializeBedrockEmbeddings({
logger,
catalogApi,
vectorStore,
discovery,
config,
options: {
credentials: credProvider.sdkCredentialProvider,
region: 'eu-central-1',
},
});
Configuration Options
The module expects 2 pieces of configuration:
- The configuration of the module to configure AWS Bedrock
- AWS integration configuration for credentials provisioning
AWS Bedrock configuration
The module expects the name of the embeddings generative AI model to be configured via app-config.
ai:
embeddings:
awsBedrock:
# Name of the Bedrock model to use to create Embeddings
modelName: 'amazon.titan-embed-text-v1'
AWS Credentials Configuration
The module depends on the @backstage/integration-aws-node
package which helps fetch AWS account credentials for AWS SDK clients in backend packages and plugins. Users configure AWS account information and the credentials in their Backstage app configurations. This could include IAM user credentials, IAM roles, and profile names for their AWS accounts.
A full description of how to use and configure @backstage/integration-aws-node
package can be found from the package README.
Configuration examples:
aws:
mainAccount:
accessKeyId: ${MY_ACCESS_KEY_ID}
secretAccessKey: ${MY_SECRET_ACCESS_KEY}
accounts:
- accountId: '111111111111'
roleName: 'my-iam-role-name'
externalId: 'my-external-id'
- accountId: '222222222222'
partition: 'aws-other'
roleName: 'my-iam-role-name'
region: 'not-us-east-1'
accessKeyId: ${MY_ACCESS_KEY_ID_FOR_ANOTHER_PARTITION}
secretAccessKey: ${MY_SECRET_ACCESS_KEY_FOR_ANOTHER_PARTITION}
- accountId: '333333333333'
accessKeyId: ${MY_OTHER_ACCESS_KEY_ID}
secretAccessKey: ${MY_OTHER_SECRET_ACCESS_KEY}
- accountId: '444444444444'
profile: my-profile-name
- accountId: '555555555555'
accountDefaults:
roleName: 'my-backstage-role'
externalId: 'my-id'