Skip to content

ksmin23/rag-with-knowledge-bases-for-amazon-bedrock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QA with LLM and RAG (Retrieval Augmented Generation) using Knowledge Bases for Amazon Bedrock

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:

rag_with_knowledge_bases_for_amazon_bedrock_arch

Overall Workflow

  1. 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.
  2. Open SageMaker Studio and then open a new terminal.
  3. 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
    
  4. Open data_ingestion_to_knowldege_base_for_amazon_bedrock.ipynb notebook and Run it. (For more information, see here)
  5. Run Streamlit application. (For more information, see here)

References

Releases

No releases published

Packages

No packages published