Build an End-to-End RAG API with AWS Bedrock & Azure OpenAI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to AI anytime channel in this video we are going to explore Amazon Bedrock on AWS Cloud so Bedrock basically helps you build generative AI powered applications faster scalable as well because you know it's kind of helps you build production level Solutions and we're going to see how we can you know build a rag solution using Amazon Bedrock or AWS Bedrock Services Bedrock has great capabilities when it comes to building agents knowledge bases using n number of large language models both open source and the closed ones so you can just deploy or select a model over there and just use use that as an API endpoint or also completely serverless through just using that uh on AWS Bedrock or any other services on Amazon so we're going to see how we can build a production level rag you know here using Amazon Bedrock I'll also show you that how you can retrieve from Amazon bitrock uh uh based models like Titan one or the other embeddings model of that has been given by Amazon I also show you that once you have the retriev chunk how can you use azur open AI for example or any other model outside of the AWS ecosystem it's going to it's going to be an an interesting video so if you look at here on my screen uh I on Amazon Bedrock uh it says the easiest way to build and scale gen applications with Foundation models or foundational models which is right because you know AWS is now uh Amazon is now really competing well when it comes to other big giants like open Ai mistel and things like that so Amazon has a partnership with anthropic as well so the cloud model is available the other open source model you can also use it through bedrock Services the let's talk about the data now because I think that is very important and right now if you look at if you look at in our country right India is going through elections uh and we we call it LO SAA elections by the way you know to select our prime minister and uh it it's happening in different phases because we are very big country and uh large population so this happens in phases and we have completed few phases already so the source document is going to be the Manifest manifestos of uh two big political parties one is uh you can see it over here it's uh the current government that we have in country uh BJP B J party or the NDA government you know which is like different alleys or alliances that we have and the other one is uh Inc India National Congress party so like the India they also have alliances with different Regional parties and the other National parties as well so we'll we'll take these two and we'll try to build a retrieval system that will retrieve based on your query and then once we have the retrieved chunk we'll pass it to a large language model to uh synthesize the responses from it okay now on bed on Bedrock uh you need an account uh on AWS so let's go into get started once you go into get started on Amazon bitra guys and you need you need first of all you need uh if you are on IM access or if you're working in your organization you need all the policies attached to use Amazon Bedrock okay you need permissions to use that so if you have an IM rooll you have to ask your admin to go to IM or then attach policies or give you permission so you can work with Amazon bedro that I'm not showing that part that's very easy to do just go to IM uh select the role or also the user Group whatever you want and then just uh click on uh you know attach policies or give permissions and give Amazon Bedrock full access okay just for now okay for bedrock and also S3 S3 full access because we're going to put our data in Amazon S3 so if you look at here let me give you a quick walk through of Amazon bitro guys and this is going to be a bit lend the video guys so feel free to skip the part if you are not interested in now if you look at here on bedrock let me just minimize all of this I'll just show you so they have everything that you need to build J applications they have Foundation models they have playgrounds they have safeguards because we're going to talk about the rails and guards and rails and whatever then they have orchestration and we're going to be interested in orchestration today in this video so for the orchestration they provides the knowledge basis and agents they also gives you how to evaluate model and provision throughput you know just for the evals because I that's very important for model evaluations monitoring and things like that okay now you can find out the foundation models over here the it you can use Titan which is Amazon proprietary models clawed by anthropic entropic is one of the partner of AWS command by coher command has done really well on the evaluation benchmarks llama 3 by meta recently has created havoc on the on the leaderboards guys one of the most uh one of the most Fantastic Model when it comes to reasoning capabilities uh so far we have Mel by m AI a French startup and stability AI a London based company for stable diffusion you have chat you have text you have images you can play around it that's the landing page you can request model access for the new for the bestas model let me show you how you can you know go to model access when you click on that model access you can see I have like I have only I need know few models and I got access to that very easy to do that now you can look at a a AI 21 Labs has Jurassic models Amazon has bunch of model and I only need Titan embeddings G1 for text if you are building a multimodel Solutions where you have images tables and things like that I will recommend you to go with multimodal embeddings G1 you can see access has been granted for that as I'll show you how you can get access if you want to use any of the cloud model you need to put your business case or the use case details in the form and then they will they will have a look at that and then they will give you that now coher as command R command R plus blah blah blah meta has all the Lama 3 and Lama 2 models ml has the instruct and uh 7B Moes and stability has HD XL one if you want uh access you have to click on manage model access click on that once you do that the selection will be available how to select or choose your model so for example if I need uh let me show you now if I need mixl ATX 7B I'm just going to click on Save changes once I do that you will see that this model has been access granted because it does not require any additional information to give it to AWS so they can review it it's it's just click on that and they will you can immediately get the access now and you can read that it says to use Bedrock you must request access to bedrock FMS to do so you need to have the correct IM permission as I said you need permissions to kind of work with this you may first need to submit use Cas for the for cloud more information information about these models is available on the provid space so I'm not going to go inside this now let me just yeah now we're going to be interested in knowledge basis guys so let me bring you to knowledge base now imagine if you have millions of documents 100 millions of document let's think like that because people have gone Gaga about that I have petabytes of data even they don't have to be honest okay but they say I have 1 million because other competitors are doing 1 million so I also have 1 million documents come on you have thousands of documents 1 million is a huge amount of document that you need to digitize or whatever but even even in that case if you have that is fine now if you have 1 million of documents guys you cannot do that with fast chroma or those kind of databases even on the open source kind of vector databases like W8 cant uh mver and some others right it's difficult to work with them to be honest uh you need something scalable you can scale that the volume can be handled in pabes of data or GBS of data and you need a hypers scalers to work with guys because you are you are working in an Enterprise and that's where Bedrock comes in now knowledge basis means that you go and and create an S3 bucket so let me just show you that let me go to S3 I'll open S3 let me just give me a minute I'll just delete this I'll just delete this bucket so let me let me open S3 here so let me just go to S3 once I go to S3 you will see it says store and retrieve any amount of data from anywhere so we're going to put all of all of our data here in S3 and so let's create a bucket first see this as a database storage it's not an actual RDS or relational database or a no SQL database the bucket basically helps you you can put any kind of data here any kind of data formats images videos audios blah blah blah okay the G files everything over here now it's really fantastic one of the best out there in the industry so I know at least you aware of S3 I'm not going to talk more about it once you see this it going to ask me bucket type I'm going to keep this general purpose so let's keep this and I'm going to say demo bucket probably and always remember guys S3 is global okay so you have to keep this in mind I'm going to call it demo AI anytime this is what I want to call all this looks good and I'm going to block all public access this is fine let's block all public access this is good this is good this is good and you can see it says successfully created bucket demo AI anytime now inside demo AI anytime you can upload over here okay so you can upload your uh you can create a folder also so let me first create a folder here so I'm going to call this data sets so let's create a data set this is fine this is fine this is fine create folder now I'm going to put my I just created data set folder is better to you know organize it in a better way because if you have more folders you can bring it up over here you can create different data set different knowledge bases on Bedrock if you have different types of document now I don't know why I clicked on this inside data sets I'm going to bring up my files so let's click on upload add files and let me go to document let me go to data and just copy this two come over here and upload on once I upload it it will take a bit of time and you can see it's taking a bit of time to get that done and let's just close this now okay so I'll just close this this and I'll go to demo AI anytime so if you look at let me just go to buckets now on S3 we have demo AI anytime inside demo AI anytime we have a data set folder inside data set folder we have two files you can bring millions of files over here depending on if you have the compute budget to afford that that's that's the point now we are done with this guys okay so let's now move to uh knowledge based thingy yeah just bringing up my monitor now in the knowledge base let's create knowledge base I'll just I'll just probably keep this as default but you can change the name but I'll just keep this as default here okay uh in the orchestration you can also you can also orchestrate through agents but I'm not going to orchestrate that okay uh here and cool uh this is fine you can give some options like demo KB demo KB is done and then come down come down you can put some TXS I'm not going to do that these are all fine just click on next and it says Amazon S3 provide datails to connect Amazon Bedrock to your S3 data source keep that as default I'm not going to make any changes you can also bring from other AWS account if you have your database in some other account because in the large Enterprises you have multiple accounts so you can also bring it from there uh let's click on here okay so this is all fine and I'll show you something here so let me just put go inside demo AI anytime and just click on data sets and choose make sure you are taking the path uh attentively because you should not keep only the main folder you have to go into the sub folder where because you have n number of folders now once you select that you have chunking strategies so in chunking strategies it's better to go with default chunking but but if for example if you want to keep chunk size as th chunk overlap as you know 100 you can also do that for that you have to click on fixed size chunking but I'm going to keep this as default but guys always remember chunking is a trial and error experimentation there is no uh thumb rule that you have to follow 1,00 it all depends on what kind of documents you have and how does the data looks like within the document do you you want to split on headers sub headers you want to create key values pay blah blah blah so it depends on how you do that according to your data so never you know just go with popular opinions of saying I will just do uh 1, 100 of Chunk size and chunk overlap it never it never works like that here so these are all fine let's click on next now once you do that you'll see embedding models and these models will be listed because we have the model granted in the model access I'm going to go with G1 text uh this is by Amazon the Titan name meing model and now here are the things when you look at the vector database and it's not store the difference between Vector store and databases are like databases are scalable you can put millions of vectors into it and you can retrieve faster the latency will be not a problem but when you use a vector store it's good for hobby project like Fast chroma it's not at all good for production level guys never use that if you are selling a product or or you are building a vertical SAS you have to go with something that that you can scale up later okay now it says create a new Vector store so what I will do I will select this recommended because Amazon has something called Amazon op search service AOSS which basically is a vector database on AWS which is fascinating which is fantastic so I'm going to say that okay my data is in S3 create a vector store using Titan embeding model and put that in a OSS my data is not going anywhere else it's everything there in the VPC of course you can configure that private Network whatever but my data is there okay now I'm going to click recommended which is already clicked but if you want to try something else like pine cone red mongodb Atlas Amazon a or whatever you can also select that now when you click on that it asks you to select for example so you have to configure you know pine cone mongod Atlas or blah blah blah but I'm going to click on create a new Vector store and that will be server list so I'm not going to configure the vector database I'm asking AWS that hey okay I don't have knowledge how to configure this but I want to build something faster to retrieve some information then you go with the server list because it is fantastic not only from a knowledge standpoint but also let AWS handles all the server complexity you just focus on Building Products what I'm going to do is and of course it it's going to be a bit costly guys they I show you the pricing but let me just click on next Once you click on next it will it will ask you to review and create so let's click on create knowledge base and it will take a bit of time so because it's going to you know spin up an instance create all the vectors stor it blah blah blah so I'm just going to click on create knowledge base okay it will not right now create the vectors but it will create the knowledge base we have to sync the data I'll show you in a bit but let me first hit this and then I'll take a pause guys after this you can see it has started it says preparing Vector database in Amazon open search server list this process may take several minutes to complete let me go to S3 and in the services and I'll show you here uh open search and let me just right click and open this when you open this it will show you that you know we are creating something you know right now it's not but it will take a bit of time you go to server list and you can see it's it's now accessing it it will create here uh here in the serverless it's creating and this is what Amazon Open Source service is okay you can completely inest directly from dashboard as well here you have an inje thingy you can see this here inje dashboard pipelines blah blah blah okay and you can also integrate with other services third party services or data source as well now we'll take a pause here guys and we'll come back once this is done all right guys as you can see that our knowledge base is created successfully uh it it has been printed that knowledge base the name of the knowledge base is created successfully think one or more uh data sources to start testing now go to data source we'll go to data source not required let's just click that set model I'll just click on cancel for now I want to show you the retrieval first okay now come here on the data source and you have to click on this you can see this is your data source overview let just go back now once you come down you have to click on this part once you click on this part then you click on this button called sync now you have to sync your data source with the vector database that has been created in Amazon open search service and server list AOSS serverless okay now click on sync once you click on sync it will start syncing your data chunking everything creating the embeddings and store that in Amazon open search service AOSS I'm a big fan of it guys by the way and it will get stored over there and then you can start retrieving it okay so the retrieval will be you can test it out here we'll test that in a bit and this is going to take a bit of time depending on how lengthy your documents are okay but anyway let's go to and you can see it's almost done it says available now when you click on this knowledge uh base it's completed sync history we have synced it one time let's go back here in the knowledge base and it will get refreshed I'll just click on configure your retrieval yeah you can also do that I'm not going to do it okay you can see this is how you can how many documents you want number of documents means number of it's like the page content in Lang chain how many documents so n which is K so k equal to five means number of documents has five so by default it's five and I think this is fine enough you can also do a hybrid search you can do a default search you can do a semantic search blah blah blah okay now Amazon Bedrock decides the search strategy for you okay so basically for you can again this is completely on domain expertise you know if you want to I think you should Baseline on which retrieval is working fine because Ral is a key guys if your retrieval system is not retrieving the right context then llm will always hallucinates because it has it does not have the information right that you need so it should be a bit careful here to uh how to select a search type depending on if you want a hybrid search which is like bm25 retriever the fast uses it uh and all others as well semantic and text or you need only semantic you just Vector embeddings to deliver relevant results okay it says combined relevancy scores from 7 and Tech search to provide greater accuracy now when you click on hybrid search now you can also do that okay now let me just ask the question for example so here you can enter your message and let's try it out so let's first keep the default search and see if that is making any different come to the BJP Manifesto v j party you know our prime minister s Narendra Modi G has done a great job for the country guys but I leave up to you to decide whom to vote uh in this ongoing election uh let's ask some questions what kind of questions we can ask uh let me [Music] see uh I'm trying to ask a difficult question and [Music] see okay let's ask this question tell us about you are Vat now when you click on run you can see how fast it has retrieved okay so it says it has given you five content of course uh you can s Source details you know when you click on Source details it give you the source chunks basically the metadata that you need right that's what you will be printing at the source document if you have n number of document uh n number of files you can see this is the file that it has retrieved from the value and we'll see that later on this is not a problem so it basically gives you the source citation so it basically cites that the references okay now this is fine okay so we are not that worried about this okay now uh you can see height Source detail when you click on this uh this will be like this now uh go a bit up T knowledge Source now let's just go back here okay and let's write out a hybrid search and I'm going to ask the questions like from Congress probably uh minority right Tana is the synonym of gangaa culture blah blah blah whatever okay let me ask this question here no basically that's not the right question because that that will be not the right question okay I'm just thinking something H so and put more documents guys related to government if you are building something for the government policies and other things uh tell me about Labor Department or things like that once you do that and you can see it it gives you in seconds okay it gives you something related to uh it has given you what you need labor department and then you can pass this to llm and it will look at all these chunks and then synthesize the response for you so the retrieval this is how you build a retrieval so you have hybrid search you have default search I will recommend you go with hybrid search when you have a complex data okay so I think hybrid search works good in that because if that's not in the vector embedding then it can go to the keyword search and retrieve that so that's very important as well to keep in mind now I think we are good with I think we are good with the retrieval guys I hope you understood how to retrieve at Le so so far we have built the retrial okay you can run it out here you can test it I'll also show you now how you can use this programmatically we we'll create cre a Lambda function and then we'll use it from there I'll I'll keep it very minimal guys but it's all you how you have to decide you can create an API Gateway create a function youl blah blah blah okay I'm going to create a Lambda function for this okay but now so far what we have done let me summarize that so we have few documents in S3 we created a knowledge base on uh bedrock and then we have a vector database in Open Source service and so far we have completed this now let's build or let's create a function now for this all right guys so let's create the Lambda function now Lambda uh it says lets you run code without thinking about servers so Lambda function is again serverless let AWS handles all the servers complexity Lambda if you are building a low latency Solutions you should orchestrate through Lambda which is fantastic we're going to create a Lambda function you can create this in different languages net Java nodejs python Ruby and custom runtime you can also configure custom run times let's click on create a function author from scratch we're going to do this from scratch if you have if you have a cloud formation template or a CFT template you can also do that I'm not going to do that here you also have a container image option where you have a container image you can also deploy that okay uh but let's keep it default I'm going to call this demo Lambda I'm going to select python 3.11 as runtime and I'm X 860 this is fine this is fine this is fine oh you can create a function URL if you want I'm not going to do that here okay when you click on enable function URL this is same like aure functions and Cloud functions on gcp and Azure function on Microsoft Azure I'm not going to do that uh if you do that you have to click buffer stream and you have to configure some course uh this is fantastic function URL versus API gateways can be an other video I have a video earlier you can check that out I'll give the link in description create function what happening it takes a bit of time I don't know uh let's see yeah so creating the function now you have your function over here let's just get rid of this code thingy uh I'll make a bit bigger so you can read this Lambda function code I'm just going to paste this from my GitHub I'll give this code of course uh let's come back paste I'll explain that what I'm doing okay and here we are passing uh one thing which is knowledge based ID and I'm going to put that in environment but let me just first copy this here knowledge base ID copy come and what I'm doing here let me explain that so we are saying okay import OS and boto 3 which is then hdk to basically program you know programmatically through python or anything else and I'm saying create a boto 3 session and initialize the bedro client that's what we are doing it over here then we are retrieving the knowledge based ID from environment variable which is KB ID Environ doget we'll put that in environment I'll show that in a bit and then we have a retrieve function where we are passing the input text and the KB ID okay which is in params now KB ID KB ID blah blah blah and then saying response where we are using the bid roore agentcor runtime clan that we have in line number six that we have initialize and we using the retrieve function it has three different types of function retrieve and invoke retrieve and there was one more only invoke or something we have to see that and then we are passing the knowledge based ID as the KB ID retrial query equal text input text and some configurations I'm only getting the you can also probably number of results five you can also increase that if you want you can put some filter and blah blah blah and then I have a Lambda Handler where we are just handling it passing the event questions retrieving query KB ID in the function and then just getting it done now once you do that I'll make it a bit small now 100% this is cool this is cool this is cool now let me show you a few things go to configurations scroll down you will see environment variables click on envirment variables edit and I'm going to edit knowledge based ID but I need that from bitrock let me just go to bedrock here and I'm going to just close this of course after this video I will you know uh I will delete that anyway so that is fine okay let's come here in knowledge base and take this knowledge based ID so I just copied it come here paste and just click on save so now you have saved the environment variable uh General configurations increase the Time Out 3 second is too less we going to make this at least 1 minute 3 seconds save let's go to let's go to permissions now and it will show you a role name click on demo Lambda Ro it will open in a new tab it will open in an I am identity access management and you can see I don't not have the permissions but I'll give that permission anyway that is not fine but let's come back to demo here Lambda okay and you can see this is code this is where the Lambda code written I will test it out let me first give this access guys for that I have to log in with my root AIS not the IM on the root credentials let me do that and I'll come back in a bit all right I have logged in with my root access uh the root credentials and I'm going to click on some permissions thingy now let's go on configuration permissions click on this role name it will open in a new tab let's get rid of this now here you can add permissions Let's uh attach policies and I'm going to do Bedrock full access click on this uh full access add permissions and you can see it says policy was successfully attached to the role now we can go back to Lambda okay to and now once you go back to I I think we are in the Lambda here so let's just come back refresh once you refresh this you will see now two things so we have Bedrock full access now okay so this is fine okay now we can see all resources Bedrock blah blah blah now here you have to add permissions for the invoke function so let's do that Services function URL should we do the function URL principal ID statement ID Grant permission to invoke your function through the function you to another AWS account us a rule we can do both uh let me get that here invoke function invoke function URL is not required here I'm going to select invoke function so let's select that and I'm going to click on Lambda inoke function this is what you need and here you're going to ask about your Arn now this Arn is nothing but we have to go to bedrock again so let me just or do right click too much of back and forth guys so you should keep all the tabs open now here on the Bedrock ah I'll go to bedrock again I'll go to knowledge basis you need the Arn from your vector database that you created so the this is the AR and I'm talking about the collection Arn let's just copy this come back past it here and you can just click something like allow Bedrock here the statement ID you want to allow Bedrock so this is very important guys you know to do that oh it didn't ask me principal didn't ask me about the the a in for account it should ask me about the principle I mean the a in for account let me try it out okay all right not this so the principal should be Bedrock do Amazon AWS doc excuse me yeah that is fine not the Arn but I think the will be automatically taken so that is fine uh but we have passed that let me see that here allowed conditions none statement ID Bedrock Amazon aw.com this is fine allow effect is fine action uh the conditions if I edit not the conditions let me see action is fine Source are in oh all right this is what I was thinking okay now when I copy this let me see here if that makes sense absolutely now this makes sense now to me yeah now when you click on yeah this is fantastic I think we're done now I have shown you because the previous videos on AWS AWS is my favorite Cloud but when I created a lot of videos on AWS deployment you guys have asked me how to add permissions policies blah blah blah so I think we are good so you have to do two things here you have to add permission and I have shown you how to do that and then here you have to uh in this role name you have to add the permissions to uh full access to bed come back on code this is what the code is and what I'm going to do now probably I just I will also show you I'll just get out of this sign out from this and I'll log back in uh in a moment let me do that all right guys uh we are done with our Lambda also I'm logged in with my IM again because I wanted to S it from IM and root both right because root will give you the AIS the Privileges and in the IM IM Ro we will be executing that at your workplace or at your wherever you work right so that's how it is now let's go to test when you come to test I have edit I have already a test that I was testing it out but you can create a new event but you can see I created created an event called demo test and then I'm putting a Json and this Json payload has a question I'm asking a question what is 75 Milestone and this question is here you can look at this right I'm trying to retrieve this 75 milestones for India at 75 you know our prime minister NRA Modi G's photo is here and I'm asking this question 75 milestones for India at 75 come here and and just click on test once you click on test you will get that details and you can see status code 200 I'll make it a bit bigger so you can read this let me just do that now here you can find out your where did it go man okay here you can find it out your retrieval results the context the text and the text comes up with the metadata like location S3 locations blah blah blah and score also it gives you a score and you can find out 46% of the matching you can also do a hybrid search as I was showing now this has basically this this has been able to retrieve the chunks right now what we can do we can take all of this retrieved chunks the context the information whatever you call it and just give it to a large language model of course you have to write a prompt you write a rag prompt or take it from Lin Hub or you want do whatever you want to do but you can take a prompt and you can take this and just give it to an llm open source close sour doesn't matter to retrieve or to generate responses so rag has retrieval and generation two different steps this is what I wanted to show you in this right so far the retrieval is retrieval has been done now let's do it programmatically right because that that's what you would be interested in how to do this programmatically and I'm going to show you now how we can build this programmatically in a python app or streamlet app so let's let's do that now if you look at here on my screen guys I have a fast I uh already created you know probably I'll I'll give the link in description of course the GitHub link which will have all the codes but I'll show you how you can now bring up programmatically I'll show you a few things okay now let me go to my vs code on the vs code you will see a few things one is called EnV now this EnV kind of contains everything that we need all the secrets and credentials and then we have a requirements txt now if you look at the requirements txt we have open a because I'm going to use Azure open a because I want to combine bedrock with other llm see Bedrock llm like it's easy to just use it from there right but if you want to use Azure open AI with the Bedrock Services how can you do that that's the plan open AI then we have fast API uh then we have uvon because fast API needs uon server to run uon is like a web server that helps you run fast API code python. EnV just to uh load through EnV Secrets multiart just to handle some uh API methods Lang chain open AI Community boto 3 boto 3 is like the hdk to connect with AWS Services let me give you a quick walk through I'm not going to write this code I'm just going to give you a walk through of this because it's bit easy we are importing whatever we need from Fast API HTTP exception status query Json response and redirect response probably you can use redirect response for directly directly go to 8,000 uh or the Swagger UI or the other uis that redock whatever now bordo 3 Json OS some ilities from we are using aure chat open so I have my own personal aure account where I have deployed some GPD 3.5 and gp4 models then we have prompt template and we have llm chain you can use retrieval chain conversational chain any chain you want it's up to you guys to do that now I have loaded all the enem that I need and then I have initiated the app fast API and now I have a Lambda client where I'm initiating the boto 3. client Lambda region name so which region so my region was Us East one and then you give your access key ID and secret access key now these are being generated from AWS here let me show you now these are being generated from these uh credentials that you see access Keys here you have to click on create access key if you do not have one and then you put that in EnV you know in a key value pair and you can see access key ID and secret key uh secret access key I'm printing the Lambda client I just printing it for something and then get context I have a function which connect with your Lambda invoke the Lambda function read the Lambda functions response this is nothing but the same thing that we have in the Lambda function code guys navigate to the retrieval result so what I'm doing I'm just retrieving the result and passing it to open I'll show that to you the Azure open a you can find out here now this is my Azure chat open a thingy I'm pass I have a simple prom template here and I'm saying that this context is coming from the Bedrock uh knowledge base that we have created through the embedding model and then I'm using this llm chain just getting it out query and just passing the result Once I pass the result I'm just putting it here chat with knowledge based get answer from KB juston response and that's what I'm doing and once I run this code this is how it looks like guys okay I'll come back here I'll just close these all of now okay not required okay let me just close this I'll give all probably ask a question the same question let me ask this question 75 milestone for India okay so I'll just expand this try out and put this question what is I'm just going to say milestone for India and let's just execute once you execute it here you'll find out the answer in a bit you can see that we got our answer let me just copy this here okay probably I'll put this in a word file let me put this in a word file here and once I put it in a word file you can find out here it says the 75 mileston for India are a set of goals and achievement that the country aims to fulfill by 25th 75th anniversary of Independence in 2022 blah blah blah so you got an answer guys I'm not retrieving I'm not swing the metadata here but you can do that you know it's up to you you can show The pce docu Source document you can show the metadata you can show the confidence score as I was showing in the Lambda function now if you look at the Lambda function we are printing it everything you can just print it here as well if you want this is what I wanted to show you guys in this video an end to end drag you can also deploy this fast API if you want do that you can just let me show how you can do it quickly so I'm going to show that how how easy it is to do that now you go to render click on New Wave service once you click on Wave service you can do it in Free by the way it asks you build and deploy from a git repository let's click on next Once you click on next you can just add your repository over here from GitHub I'm not going to do that I already have videos on that please check that video out how to link your GitHub repository to render netlify you know uh Railway blah blah blah there are other as now this is what I wanted to do guys in this video AWS Bedrock your own knowledge base using an embedding model using a large language model and building an end to endend rag you know and show that to you in a fast API endpoint as well you can build a very goodlooking UI now okay I leave up to you how do you want to consume this for your end user yeah but this is what it is guys I hope you now understood how to set up your knowledge base on Bedrock how to attach policies give permissions build a Lambda function use that in a python code build an API and now you can take this and build an application as well on the front end okay if you have any question thoughts feedback please let me know in the comment box if you like the content I'm creating please hit the like icon guys that motivates me to create more such videos and also subscribe the channel if you haven't subscribed yet share the videos and the Channel with your friends and to peer thank you so much for watching see you in the next one
Info
Channel: AI Anytime
Views: 5,560
Rating: undefined out of 5
Keywords: ai anytime, AI Anytime, generative ai, gen ai, LLM, RAG, AI chatbot, chatbots, python, openai, tech, coding, machine learning, ML, NLP, deep learning, computer vision, chatgpt, gemini, google, meta ai, langchain, llama index, vector database, AWS Bedrock tutorial, Azure OpenAI guide, vector database AWS, FastAPI Python API, AWS Lambda function, end-to-end RAG system, AWS OpenSearch Service, machine learning AWS, Azure AI applications, AI system design, bedrock, open search service, aoss
Id: r6AeD-CH1Uw
Channel Id: undefined
Length: 42min 58sec (2578 seconds)
Published: Sat May 04 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.