Amazon Bedrock is a fully managed service that makes high-performing foundation models (FMs) from leading AI startups and Amazon available for your use through a unified API. You can choose from a wide range of foundation models to find the model that is best suited for your use case. Amazon Bedrock also offers a broad set of capabilities to build generative AI applications with security, privacy, and responsible AI. Using Amazon Bedrock, you can easily experiment with and evaluate top foundation models for your use cases, privately customize them with your data using techniques such as fine-tuning and Retrieval Augmented Generation (RAG), and build agents that execute tasks using your enterprise systems and data sources.
Large Language Models (LLMs) inevitably exhibit hallucinations since the accuracy of generated texts cannot be secured solely by the parametric knowledge they encapsulate. Although Retrieval Augmented Generation (RAG) is a practicable complement to LLMs, it relies heavily on the relevance of retrieved documents, raising concerns about how the model behaves if retrieval goes wrong.
Advanced RAG techniques like Corrective RAG were proposed to improve the robustness of generation. In CRAG, a lightweight retrieval evaluator is designed to assess the overall quality of retrieved documents for a query, returning a confidence degree based on which different knowledge retrieval actions can be triggered. Since retrieval from static and limited corpora can only return sub-optimal documents, large-scale web searches are utilized as an extension for augmenting the retrieval results. CRAG is plug-and-play and can be seamlessly coupled with various RAG-based approaches.
This repository contains code that will walk you through the process of building a simplified CRAG based assistant. We will cover two scenarios for the retrieval phase:
py312_opensearch-py_requests_and_requests-aws4auth.zip
using the following procedure and upload it to the same Amazon S3 bucket as in step 3.
C:/Program Files/7-Zip/
.cd
into it.py312_opensearch-py_requests_and_requests-aws4auth.zip
.cd
into it.py312_opensearch-py_requests_and_requests-aws4auth.zip
.See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.