This project is an Question Answering application with Large Language Models (LLMs) and Knowledge Bases for Amazon Bedrock. An application using the RAG(Retrieval Augmented Generation) approach retrieves information most relevant to the user’s request from the enterprise knowledge base or content, bundles it as context along with the user’s request as a prompt, and then sends it to the LLM to get a GenAI response.
LLMs have limitations around the maximum word count for the input prompt, therefore choosing the right passages among thousands or millions of documents in the enterprise, has a direct impact on the LLM’s accuracy.
In this project, Knowledge Bases for Amazon Bedrock is used for knowledge base.
The overall architecture is like this:
- Deploy the cdk stacks (For more information, see here).
- A Knowledge Base for Amazon Bedrock to store embeddings.
- A SageMaker Studio for RAG application and data ingestion to Knowledge Base for Amazon Bedrock.
- Open SageMaker Studio and then open a new terminal.
- Run the following commands on the terminal to clone the code repository for this project:
git clone --depth=1 https://github.com/ksmin23/rag-with-knowledge-bases-for-amazon-bedrock.git
- Open
data_ingestion_to_knowldege_base_for_amazon_bedrock.ipynb
notebook and Run it. (For more information, see here) - Run Streamlit application. (For more information, see here)
- Amazon Bedrock Workshop - Hands-on labs using Amazon Bedrock APIs, SDKs, and open-source software, such as LangChain and FAISS, to implement the most common Generative AI usage patterns (e.g., summarizing text, answering questions, building chatbots, creating images, and generating code).
- Building with Amazon Bedrock and LangChain - Hands-on labs using LangChain to build generative AI prototypes with Amazon Bedrock.
- Amazon Bedrock Samples - Pre-built examples to help customers get started with the Amazon Bedrock service.
- Build a powerful question answering bot with Amazon SageMaker, Amazon OpenSearch Service, Streamlit, and LangChain (2023-05-25)
- Build Streamlit apps in Amazon SageMaker Studio (2023-04-11)
- LangChain - A framework for developing applications powered by language models.
- Streamlit - A faster way to build and share data apps
- rag-with-amazon-kendra-and-sagemaker - Question Answering application with Large Language Models (LLMs) and Amazon Kendra
- rag-with-amazon-postgresql-using-pgvector - Question Answering application with Large Language Models (LLMs) and Amazon Aurora Postgresql
- rag-with-amazon-opensearch-and-sagemaker - Question Answering application with Large Language Models (LLMs) and Amazon OpenSearch Service with LangChain
- rag-with-amazon-opensearch-serverless - Question Answering application with Large Language Models (LLMs) and Amazon OpenSearch Service Serverless with LangChain
- rag-with-haystack-and-amazon-opensearch - Question Answering application with Large Language Models (LLMs) and Amazon OpenSearch Service with Haystack