Build an End-to-End RAG API with AWS Bedrock & Azure OpenAI
ฝัง
- เผยแพร่เมื่อ 6 ก.ย. 2024
- In this tutorial, I show you how to build an end-to-end Retrieval-Augmented Generation (RAG) tool. I've used AWS Bedrock Service for the embedding models and knowledge base, Amazon OpenSearch Service for the vector database, and Azure OpenAI models for the language model. I'll walk you through setting up a Lambda function and creating a Python API using FastAPI to tie everything together into a seamless system.
Don't forget to like, comment, and subscribe to stay updated with more content like this. Let's dive right into it!
Join this channel to get access to perks:
/ @aianytime
To further support the channel, you can contribute via the following methods:
Bitcoin Address: 32zhmo5T9jvu8gJDGW3LTuKBM1KPMHoCsW
UPI: sonu1000raw@ybl
GitHub Repo: github.com/AIA...
#aws #ai #llm
Awesome tutorial and a very important use case. Just one thing you forgot to give the lamda function code in the repo. Thanks for everything Sir.
Must have forgotten to download it from the original creator ...... 🤣🤣🤣🤣🤣
Fascinating! Could u make a vid to show how to do it all programmatically? Like, upload data to S3, trigger bedrock to process the new data using the knowledge base ID. Basically set up a chat app for users to upload files, let bedrock process it, update the vector storage and finally we call the lambda and get results. Thx!
lamda function code is missing...please upload in description or make it publicly available in repo
@AI Anytime, Thank you for the great video and demo. Wanted to reiterate that the code for the Lambda function is missing on Github. Thanks.
Whoever uses basically in a tutorial is not an expert at it. Just my experience...
Thanks for the video! :)
Interesting video. Please make similar E2E tutorial videos using Vertex AI
I have one in RAG playlists. Check it out.
Hii how can i improve the rag retrievals i am using cohere reranking but can plz make a video on how make a pipeline on how to make RAG better !!
I have many of these in RAG playlists.
@@AIAnytimecan you please give the lambda function code
Please make a video on creating Sidebar like CHATGPT. please
Can you create a reactjs+ fastapi project without using openai, that is, using llm running locally (example: lama2)?
Cool with the explanation! But two questions
Is the LLM calling not available in bedrock ?
if it is available, Can we use Azure OpenAI models over there ?
OpenAI model isn't available. You can call LLM in bedrock also. I wanted to show different ways like how LLM can be called from outside AWS.
Hi Bro could you mention what role we need to give for an IAM user when we need to use Amazon OpenSearch Serverless vector store
cant we deploy rag chatbot in aws is there a way like hosting the chatbot?
Is this better than NVIDI’s rerank RAG with the inference
Very helpful
Great video
Glad you enjoyed it
Brillaint thanks a lot
Thanks
request you to make more videos on Amazon Bedrock projects
This is the video. It's on bedrock .
nice tutorial bro
Glad you liked it!
import os
import boto3
boto3_session = boto3.session.Session()
bedrock_agent_runtime_client = boto3.client('bedrock_agent_runtime_client')
kb_id = os.environ.get("KNOWLEDGE_BASE_ID")
def retrieve(input, kb_id):
response = bedrock_agent_runtime_client.retrieve(
knowledgeBaseId=kb_id,
retrieveQuery={
'text': input_text
},
retrievalConfiguration={
'vectorSearchConfiguration': {
'numberOfResults':1
}
}
)
return response
def lambda_handler(event, context):
if 'question' not in event:
return {
'statusCode': 400,
'body': 'No Question Provided'
}
query = event['question']
response = retrieve(query, kb_id)
return {
'statusCode': 200,
'body': {
'question': question.strip(),
'answer': response
}
}