??100 Days of Generative AI - Building Your First RAG Application using AWS Bedrock Knowledge Bases - Day 9 ??
Prashant Lakhera
Lead System Engineer @ Salesforce | Ex-Redhat, GenAI, Author of 3 books, Blogger, YouTuber,kubestronaut, MLOps, AWS Bedrock, Hugging Face
Yesterday, we explored how to create an Retrieval Augmented Generation(RAG) application using open-source tools like Hugging Face, GPT-2, and VectorDB. However, as you might have noticed, this approach requires some coding skills and familiarity with various tools. But what if you could have your RAG application up and running with just a few clicks?
First, let's start with AWS Bedrock, a managed service provided by AWS for working with large language models (LLMs). The Knowledge Base is a feature within the Bedrock service that simplifies the creation and management of knowledge bases to enhance the capabilities of foundational models for various tasks, such as RAG.
Here is the step by step process
3. Provide a name for your knowledge base and create an IAM role for it.
4. This is where you can select the data source to upload your documents.
NOTE: All data source options except S3 are currently in Preview state.
Keep the settings at their default and click "Next."
5. In the next step, you'll need to specify the S3 bucket where your documents will be uploaded.
Supported Document Formats
NOTE: AWS Bedrock currently supports specific document formats, with a maximum file size of 50MB
If you stick with the default configuration, the chunking strategy will split the content into chunks of up to 300 tokens.
If you opt for custom chunking and parsing configurations, you can use a foundation model (currently, the only supported model is Claude). However, note that in advanced parsing, only PDF files are supported.
AWS offers five different chunking strategies, but you'll need to write your own Lambda function to implement them.
6: In this step, you'll select the embedding model. Currently, only the Titan and Cohere models are supported. If you choose the Titan model, you'll also have the option to set the vector dimension.
Note: This will incur a cost.
7. Review all the settings and click "Create" to finalize your knowledge base.
NOTE: Knowledge base creation is not supported for root users. You must be logged in as a regular user to create a knowledge base.
8. Once your knowledge base is created, you’ll see it listed. Don't forget this crucial step: Go to the data source and sync the data. This ensures that the newly uploaded documents are indexed and made available for retrieval by the foundational models.
NOTE: You need to perform a data synchronization (data sync) every time you upload new documents to the knowledge base in AWS Bedrock. This ensures that all new documents are indexed and accessible.
9. Before using your data, you need to select a model. Currently, only the Anthropic model is supported.
Here you go
Your knowledge base is now ready! One of the features I appreciate most is the "Show source details" option, which provides source information when you click on it.
As you can see, AWS makes it easy to get started with RAG without requiring any coding expertise.
Feedback for AWS:
While the service is still in its early stages, there is great potential for improvement. As a customer-centric company, I’m confident AWS will listen to customer feedback and continue to enhance its offerings.
?? If you’d like to learn more about this topic, please check out my book. Building an LLMOps Pipeline Using Hugging Face
Enterprise Local AI developer
1 个月**Generate Meaningful Responses with RAG** Chunking supports RAG in generating context-aware and relevant outputs. #RAG #chunking #generation #NLP https://www.artificialintelligenceupdate.com/boost-llms-rag-performance-with-chunking/riju/ #learnmore