in this video we will make a rack application.
we will make an ai agent or a few agents that are linked together and one agent is trained on our own dataset.
i hope that you already know what a rack application is, so please remember from the beginning we can train an llm on our own data.
we will use vector databases, we will need embedding models, and all of this will work relatively nice.
you can train, for example, one agent on your writing style, you can train another agent on specific knowledge about your company, on specific knowledge about whatever you want.
and in this video we will do it relatively easy.
because most rec applications you can simply upload a pdf and you are ready to rock.
but if the rec application needs to get a little bit better, you need to prepare your data.
and we will prepare our data in the next two videos, because we can use things like firecrawl and llama parse in order to make our data a lot better.
the real world data is messy and this is not perfect for our rack application.
the most people don't tell you this.
most people simply tell you, hey, you can give a link to a pdf, hey, you can give a link to an api, a link to a website.
and yes, this is true.
and to be honest, we will also do this in this video, but in the next two videos i will show you how you can make this better.
so 1st, let's just start to make a simple rack application, a simple rack agent.
we go on agent frameworks, we start with plus and we need as always a supervisor and some workers.
so this is basically always the same thing.
so i use a supervisor and let's just say we use free workers, then we need a chat model and we use the open ai chat model.
so chat models, chat open ai and we do until now of course, always the same thing.
we will connect these nodes, also the supervisor, we connect the supervisor with this workers, and now we start to integrate also the direct technology, because we will need it.
but 1st, of course, we will use our credentials.
we use the model that we like and the temperature that we need.
i think 0.5 is perfect because this agent should be precise on our knowledge that we train it on.
and now we will include something for direct technology.
so we press plus, we scroll down until we have our tools, and in the tools we find something that is called the retriever tool.
so this right here.
and you see on the retriever tool we can specify the name ourselves.
and we will do this.
and you see that we need to insert also other things.
but before we do this, we simply connect these with these tools right here.
so we connected it to the worker and now we start to develop our prompts.
1st, we need to save this chat flow.
and i simply call it recapp agent.
i press save.
now we go back and of course we go on our prompt engineering team.
so it's the prompting team.
i press chat, we delete the old things here, so clear chat.
i insert my new prompt and use something like this.
i want free agents.
the 1st agent should search through an uploaded knowledge and use a tool called docreader.
you know, we can specify the name of our retriever tool ourselves and we call it docreader.
then the 2nd agent should write a blog post and five short tweets from the uploaded knowledge.
so we simply want to publish stuff from our uploaded knowledge.
the 3rd agent should structure and summarize everything well and in the end use a tool to save my data locally.
and the tool is of course the write file tool.
and i can also tell this right here, but i think this will work.
so i simply sent this out and now we wait until we have the prompts and of course i will do this and you have not to look at this with me.
i have my prompts of course saved up, so i clear this, we go back, we go on our agent flows of the rack app, and then we simply insert these.
knowledge explorer and here the prompt.
and of course lastly is always this included.
this report will be passed to the content creator.
content creator and here the prompt and of course also here, lastly, that it will be passed on to the data organizer.
data organizer and here's the prompt for the data organizer and we press save.
then the supervisor, you start with the knowledge explorer, pass it to the content creator and lastly to the data organizer.
and then we are ready here and now we need to make more, of course.
so let's just press on this 1st thing here, because you see that we use a tool that is called the doc reader.
so we should absolutely copy this name and we call our retriever tool doc reader.
then the description.
this can be really easy.
use this tool to search info about dogs for example.
yes, i have a pdfs about the dog training.
and yes, i use this pdf for a lot of examples because i think it's funny.
it's a small pdf about dog trainings and we will make an ai agent that can make content about dog training and that is trained on our pdf.
and that's why i tell this retriever tool that it will be used as soon as we ask something about docs.
now, remember, you always need to insert stuff where these red stars are.
so we need a retriever tool.
so we press plius, we scroll down until we have vector stores.
so here are the vector stores and we can include whatever we want.
we can include astra, chroma and so on.
some of these vector data stores, they need an api key.
for example, the pinecone vector store.
so here you need to insert api keys.
i just want to use the in- memory vector store because this is natively in flowwise, we don't even use an api key.
and we connect this retriever with this thing right here.
and then we are basically ready.
but if you see this right here, of course we need the documents and we need embeddings.
so we need to insert some other stuff.
i want to start with the embeddings models.
so we press plus, we go on the embeddings and we use the open ai embeddings because they work really nice.
so here are the open ai embeddings.
so we insert this.
then we need to connect here these embeddings and of course the model name.
so what model should we use?
we should eventually use this text embedding ada two.
this is nice, this is easy, this is cheap.
we can also use bigger models, but i think this works completely fine.
then we need to give our credentials.
we already have credentials, so we simply use our credentials.
and i hope you already know what these embeddings models do.
they make numbers out of your data so that they can be stored as vectors in our in- memory vector store.
now we need to insert our documents.
and in order to do that we need document loaders.
so we press on plus, we go on document loaders and in our case this is a pdf.
but i want to show you that we can include everything that we want.
we can include air tables, we can include api loaders, so load data from an api.
apify website content crawler, so we can also crawl content from different websites.
then the card your webscarper, so you load data from web pages.
if you want to use data from a normal web page, you can also use this thing right here.
then confluence, csv files.
so if you have tables, use the csv files.
custom document loaders if you want to write this thing for yourself, then the document store, the docx file, figma, firecrawl, so you can also load stuff using the via crawl.
we will talk about firecrawl also in the next video.
then folder with files.
so if you have a local folder with a lot of different files, you can also use this.
gitbook, github, json files, json line files, files, notion database, notion folder, notion page, pdf file, normal plain text, playwright, web card or and so on.
so you see, you can really include every single thing that you want.
search api for web search.
the serp api.
document loaders, so scarp and crawl the web with spider.
text file.
you see, you can include whatever you want, but we start of course with a simple pdf file.
so we simply include this note right here and then we need to connect our node of course here with this document.
and now we go on because we need to upload this thing.
so we need to use our pdf.
and then we also need eventually text splitters.
so 1st, i want to upload my files.
we simply press upload files and i use my pdf that i have on my desktop.
i have uploaded my dogger pdf and now i want to show you what these text splitters do.
i would recommend you to use these text splitters and over the next video so i will go into more details what this text splitter do exactly.
here on usage i would recommend you to use one document per file.
and now we include a text splitter.
this is not necessary, but this makes the output better.
so we press plus, we go on text splitter, and i like the recursive character text splitter.
so we simply insert this right here.
and now we connect this node with this text splitter.
then we have chunk size and chunk overlap.
and here i would recommend you to use, it depends of course on the output that you want to make and i will go into more detail in the next videos.
but we just work with a chunk size of 1000 and an overlap, let's just say of 100, i think this is fine for our document.
like i said, more details will follow.
i want to give you some quick information about text splitters.
you already know llms have a token limit and this text splitter, they simply make chunks of our text.
just imagine if we upload a big pdf, maybe the context window is too small for our pdf.
of course, with these big models, we can eventually do this.
and then they get split that up of course in these vectors and it should work.
but i have to tell you, it works better if we make chunks of our text.
we will make chunks that are roughly 1000 tokens big and we have some overlap with these chunks.
and then our text embeddings will work better and our application will be better in finding the right output for us.
more information in the next videos.
so we simply include this thing right here.
we leave it at 1000 and the overlap at 100. this works for our pdf and like i said, i will give you more info about shank size and overlap in the next videos.
now our application is relatively big and this worker is done.
we need to make our last worker.
and of course we press plus because the last worker will save the stuff locally, you already know this.
so we scroll down until we find the right tools.
so tools, we use write file to disk of course, and we connect the write file with this thing.
and here we need to give once again the path to our folder on our pc.
i use once again this folder, so i simply copy the path, we go back into flowwise, we insert the path here and now also this worker should be done.
now we have to do a few important steps in order that this application is working.
1st, we need to save it.
so we press save right here and then something like this will appear.
you see this right here and you need to press on it.
what is this absurd vector database?
until now our pdf is not absurd in our vector database.
so the vector database is empty.
the text embedding models did not its shop.
so we press on these and then you see the recursive character text splitter will split our texting chunks.
it will split this pdf files with this dogo pdfs.
this open ai embeddings will embed all of this in the in- memory vector store.
and then we simply press absurd and it will be absurd.
and you can see also here, like these are the chunks.
so the chunks are perfect and everything is absurd.
so we added 32 chunks here and it should work, at least how i see it, perfectly.
so we press close.
now i want to show you what this application is doing.
so we start here.
the open ai models, so the gpt for omnimodels power all of these workers.
of course, you can include different models for different workers, you already know this.
then the supervisor triggers the right order.
so it starts, of course, with the knowledge explorer, then the content creator and lastly with the data organizer.
then our worker, this is the most important worker because he has access to our private database.
we have connected here this retriever tool.
and this retriever tool will work as a search file, so our workers can search through this retriever tool.
this retriever tool is connected with our vector database.
this vector database doesn't even need an api key.
this vector database gets filled with our knowledge because we have inserted also these document loaders and in this document loader is our pdf.
this pdf gets inserted in this vector database with our open i embedding models.
and in order that all of this works a little bit better, we have this recursive character text splitter.
so as soon as we press this right here, we have already done this.
then our retrieval tool is trained on our data about dog training.
then the next worker will go on and of course make content from all of this stuff.
and the last worker will go on, make a summary and save these things locally on our pc.
as soon as you have pressed observed, you press save once again.
now this is saved and now we can test this.
in order to test this, i want to open up this docker pdf and we search for something that our llm will most likely not know.
so for example, the three categories of dog trainers.
so we could ask what three categories of dog trainers are out there.
so we go right here.
i make this pick so that we can see it a little bit better.
what are the three categories about dog trainers?
now i sent this out.
supervisor triggers the knowledge explorer.
and he should do function calling to our vector database and brings us the right information.
you see, the supervisor has used the doc reader and our content is that we have the 1st, the 2nd and the 3rd category and we have some informations.
we will simply look at this later if it's true.
then the supervisor triggers the content creator.
now we have of course our content with also the tweets for later, so the content is perfect.
and lastly, the supervisor triggers the data organizer and this thing should organize every single thing a little bit better and save it locally on our pc as a text file in the folder that we have specified.
and there we have it.
so this should be the output and also the tweets and it should be saved in our file.
so let's just see if this is true or not.
if we go on to flow by test agent, you see that we have, so these are the old things, dog trainer tweets and dog trainer blog posts.
if i go on the blog post, i have this blog post right here.
and if i go on tweets, we have these tweets: discover the three main types of dog trainers and so on.
so this should be working fine.
now let's just see if this is right.
so i want to make this a little bit bigger.
so we have three different types of dog trainers.
the 1st dog trainers, they rely heavily on offering food or toy rewards to get their dogs to perform these actions.
then the 2nd thing is the yank and crank trainers.
they force the dogs to comply, also with physical corrections.
then the 3rd trainer is the balanced approach.
so it's a balance between the 1st two methods.
and then some conclusions.
and now let's just go into our pdf.
so we have one category that is offering food or toy reward.
so this is perfect.
the 2nd category is called the yank and crank trainers, just like our llm has told us.
and the 3rd category is the middle of the two categories.
it's the balanced approach.
so i think this output was perfect.
and i want to go one last time right here so that you can see that we have also used these things correctly.
the knowledge explorer used the doc reader and if we press on it, you can see.
we called this tool doc reader, the input was categories of doc trainers, then the tool output was of course all of this text.
so we searched the right chunks.
i think this was completely perfect.
then the supervisor did its stuff and everything was perfect and it got saved locally and we have everything.
i want to show you one last time how all of this application is working.
supervisor with this model that powers all of these workers.
then of course we use the retriever tool with the vectors or the embeddings models, here the document loader and you can use whatever document loaders you like, and then a text splitter.
and then our worker is trained on this knowledge and if we give here this role, so use this tool to search info about the dogs, this thing will get used as soon as this is necessary.
then the 2nd worker will make content out of all of these things and the 3rd worker simply saves this stuff locally with a good summary on our machine.
and i think this is perfect.
and please don't forget to press at this point right here in order to upload this in your vector database.
it only works if you do this.
in this video, we have made a simple rack application.
we have trained one of our workers with direct technology.
and i have to tell you with it not to do this completely perfect.
but over the next videos i will show you how you can structure your data a lot better.
you have a lot of different document loaders and you can improve your rack application if you structure your data perfectly.
generally speaking, some of these document loaders are already in a way that they use perfect data, that they can instruct this stuff, that they can use data, for example, from web pages and crawl the right links.
but some of these document loaders like the pdf tool is maybe not perfect.
if you have a pdf with messy data, you need to make your messy data a lot better.
this is really important, so see you over the next videos where i show you how you can improve your rack application.
see you in the next one.