[SEO Subhead]
This Guidance demonstrates how to use Retrieval-Augmented Generation (RAG) for your environmental, social, and governance (ESG) or sustainability knowledge base by combining Amazon Kendra and a large language model (LLM) from Amazon Bedrock—a fully managed service offering high-performing foundation models.
Designed to provide rapid insights, the RAG process enables efficient navigation and summarization of diverse ESG information sources like corporate reports, regulatory filings, and industry standards. It allows you to analyze extensive text data quickly, extract key insights, and draw informed conclusions to support your organization’s ESG reporting needs.
Please note: [Disclaimer]
Architecture Diagram
[Architecture diagram description]
Step 1
A user asks questions and receives generated responses through various frontend integration options. For example, Amazon Lex for conversational chatbots, AWS Amplify for custom frontend web applications, and Amazon API Gateway for processing user requests with backend services.
Step 2
AWS Lambda acts as a backend response orchestrator.
Step 3
Lambda stores all inputted questions and generated responses into Amazon DynamoDB as conversational memory to facilitate future user requests.
Step 4
Amazon Kendra performs semantic searches on your sustainability knowledge base. This consists of objects related to sustainability frameworks, such as the EU Corporate Sustainability Reporting Directive (CSRD) and the International Sustainability Standards Board (ISSB) and corporate reporting, such as CDP questionnaires and Forms 10-K.
The knowledge base can be stored on Amazon Simple Storage Service (Amazon S3) or third-party repositories like Dropbox and Confluence. It can also be accessed with public or internal websites over HTTPS using an Amazon Kendra Web Crawler.
Step 5
The Lambda function uses the Amazon Kendra Retrieve API, which is optimized for Retrieval-Augmented Generation (RAG), to identify and extract relevant passages. Document metadata filters are specified in the query API to help narrow the results, including only documents relevant to the user's question.
Step 6
The user's question and the relevant context are passed by the Lambda function to a large language model (LLM) hosted on Amazon Bedrock, a fully managed service that offers a choice of high-performing foundation models (FMs). LLMs such as Anthropic’s Claude or Meta Llama can compare, analyze, and summarize large volumes of text from the sustainability knowledge base.
Step 7
The generated response from the LLM on Amazon Bedrock is returned to the Lambda function, which updates the conversational memory in DynamoDB and presents the response back to the user through your implementation of frontend integrations.
Well-Architected Pillars
The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
-
Operational Excellence
Amazon Bedrock and Lambda provide serverless compute capabilities, helps to eliminate virtual machine imaging, operating system upgrades, and patching. Amazon Kendra offers an optimized Retriever API with a semantic ranker, tailored for RAG with Amazon Bedrock.
Together, these services automate critical aspects like LLM deployment, code implementation, scaling, and failover. By reducing human intervention and accelerating response times during operations, they help minimize the likelihood of errors and help provide consistent, efficient operations. This allows you to harness the power of generative artificial intelligence (AI) while maintaining a streamlined, low-maintenance architecture.
-
Security
AWS Identity and Access Management (IAM) integrates with Lambda, enabling authentication across services like Amazon Kendra and Amazon Bedrock without storing long-term credentials in your application code.
IAM identity-based policies also enable granular control over access to Amazon Kendra resources, such as denying specific users from querying certain indexes. By governing access and permitted actions across all involved services, IAM enforces the principle of least privilege. This robust, policy-driven security model helps ensure this Guidance allows you to maintain tight access controls.
-
Reliability
Amazon Bedrock, Lambda, Amazon Kendra, and DynamoDB are fully managed, serverless offerings that are deployed across multiple Availability Zones by default, providing inherent redundancy and fault tolerance without manual configuration.
By avoiding long-running compute or databases requiring maintenance, potential failure points are reduced. You benefit from a highly available, reliable solution backed by the global infrastructure of AWS.
-
Performance Efficiency
Amazon Bedrock is a fully managed generative AI service offering a choice of foundation models accessible through a unified API. This single integration point allows quick experimentation across providers and seamless adoption of the latest model versions—all with minimal code changes.
Using a multi-model API provides flexibility and scalability. You can efficiently utilize the right resources for each task, seamlessly adapting as requirements evolve.
-
Cost Optimization
Lambda, Amazon Bedrock, and Amazon Kendra are fully managed services that automatically scale based on demand. These services also offer the capability to adopt a pay-as-you-go pricing model, ensuring you only pay for the resources actively processing requests. For example, Amazon Bedrock offers on-demand and batch modes, allowing for the use of FMs without time-based commitments.
Additionally, these services reduce the operational burden on DevOps teams by minimizing infrastructure management and maintenance tasks, lowering associated costs. By minimizing idle resource usage, adopting efficient pricing models, reducing maintenance overhead, and optimizing data handling, Lambda, Amazon Bedrock, and Amazon Kendra can lead to lower operational costs while maintaining your required performance levels.
-
Sustainability
By using the managed services provided in this Guidance, the responsibility of maintaining high utilization and optimization is shifted to AWS. AWS is on a path to matching 100% of the electricity powering our operations with renewable energy by 2025 and committed to achieving net-zero carbon emissions by 2040.
Moreover, the RAG approach using Amazon Kendra and Amazon Bedrock is effective for augmenting LLM capabilities by retrieving and integrating relevant external information from predefined datasets. This strategy aims to minimize the resources required to train models on new data or build new models from the beginning.
Implementation Resources
The sample code is a starting point. It is industry validated, prescriptive but not definitive, and a peek under the hood to help you begin.
Related Content
The executive’s guide to generative AI for sustainability
Disclaimer
The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.
References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.