Building Intelligent Agentic RAG with CrewAI and Qdrant

Tony Kipkemboi shows how to build agentic RAG systems with CrewAI and Qdrant. CrewAI uses YAML configuration so non-programmers can define agent job descriptions, and integrates with Qdrant for memory layers. The demo builds an email assistant that watches an Obsidian vault, chunks documents, syncs vectors to Qdrant, then categorizes Gmail and drafts replies.
Chapters
Amazing. Welcome to the next webinar. And today we have a special guest, Tony Kipkemboi from CrewAI. We'll be discussing how to build agentic RAG with CrewAI and Qdrant. Tony, I'm really happy to have you here with us today. That's a great pleasure. And obviously CrewAI is one of the hottest agentic frameworks. So hopefully our viewers will be able to learn a lot of from you. So if you'd like to introduce yourself, the stage is yours.
Yeah, awesome. Thank you. Definitely. Thank you for having me here. Really good to be able to come and talk about AI agents. I know it's the biggest thing in 2025, so we'll keep it going. A little bit about me. I am a developer advocate at CrewAI. If you're not familiar with CrewAI, I'll go into it a little bit in a few minutes here. But I work at CrewAI currently, and I lead developer advocacy there. So anything to do with developers, I'm like the go-to person at CrewAI.
Perfect. Awesome. Yeah, well, definitely, we are definitely looking forward to your questions. If you happen to have any during today's webinar, please feel free to ask them. We already see many of you just greeting each other. Hi, everyone. And Yeah, I think it would be awesome if you could start with some sort of introduction to Create AI. I'm not sure if everyone in the audience today knows the details about Create AI. And I have to say, I had a real pleasure working with, with the framework because I created a small demo that we would like to showcase today. But I think it would be good to just give people some more background information of what are the basic structures in Create AI and how you should build an application using your framework. Tony, would you be able to do a small introduction to us?
Absolutely. I've been waiting for this my whole life. No, but, uh, yeah, so, um, I'm, I'm gonna do like a really high-level overview of what Kurea is, so to just kind of catch you up to speed. So if you're not familiar with Kurea, this will give you like a surface-level understanding of what CrewAI is. And I think I'll focus a little bit more on memory because, I mean, we are talking about RAG today. So memory is very important and it's very related to RAG. So that's what I'll touch on a little bit here. So let's just dive straight into it, right? So introduction to CrewAI. So what is CrewAI, right? If you have never heard about CrewAI, it's an AI agent orchestration framework that allows you to build AI agents on top of. So you've probably out there, you've probably heard of like AI agents for, I don't know, coding, AI agents for farming, AI agent for you name it, Web3. There's just vertical, right? So those are like vertical agents. So those are agents that do a specific thing with— for a specific industry. But CrewAI, think of it as a horizontal platform which you can build anything on top of it. So it's like a house foundation, right? There's different type of houses. There's one-story house, two-story houses, I don't know. I don't know, 50-story houses. So we provide that for you so you can build anything on top of us essentially. And let's go to the next slide here. There's also like another important aspect and this is what this slide covers. So if you think about AI agents and if you're not familiar with AI agents as well, with CrewAI specifically, and I'll touch a little bit about what AI agents are and how I like to think about them. So within CrewAI we have And then on the side here, you can see with the blue things there, those are primitives that I like to call them primitives. So these are the things that make up an agent in a sense. And what an agent is, is I like to think of it as an employee. All of you probably watching this are either employees at a certain company, for example, or you own a company which you have employees. So you understand the concept of an employee. So I like to think of AI agents as humans. just regular employees. So if you think about the human themselves, that's the agent within an organization. Let's say an engineering department. You have different people within engineering department. You have data scientists, data engineers, data analysts. There's just so many people in there. So each of those individual people are agents. That's how I like to think about them. And each of them has a specific job description, right? So when you get a job, you have a job description. You have things that are expected of you. So the job description, think of that as a task that they're just supposed to do. And so that's what you need to do, that's expected of you, and at the end of the day, what you end up doing. And then you have tools as well. So tools, think of it as things that you need to use to get the job done. So laptop, internet access, name it. There's just so many things within an organization that you need to do your job well. So those are tools, and this is what agents will use as well. So if you see on this circle, we have like 4 agents in there. One of them is doing research, one of them is doing analysis, one of them is summarizing the analysis, and then another one is generating a final report. That could be an entire marketing department right there. The stuff on the side, you have caching, you have memory, you have training, you have guardrails, tools, cooperation, role-playing. Those are what make up and constitute what an agent is at the end of the day. If we look at this, which is more like the anatomy of a crew in CrewAI, you can already infer crew, Crew AI, there's a crew and then there's an AI portion. So a crew, what kind of makes up a crew is what I just described before, but this will kind of solidify a little bit more. So when I ask, you know, hey, who's your crew? Who do you roll with? For example, right? So that's the people, your friends or a clique of people that you roll with. So same thing here with the crew. If you have so many agents that do specific things and you put them together, they form a crew. So for example, the one we saw, the researcher all the way to the reporter. That's an entire crew by itself. So all of them have specific AI agents that do specific things and they have tools, they have tasks that they need to accomplish. And then there's a process of how they do this job. So it could be sequential, which means, and this is the next slide here. So you have sequential, which is one agent finishes a task, passes the next agent all the way to the final reporter that kind of generates the final report. There's also different method you could build it. You can have a hierarchy. So you have maybe a manager Then you have other agents reporting to the manager. They do the job, they pass to their manager at the end of the day. Then you have a hybrid which you can remix all these different execution processes and find the one that works best for you. Another important point here, how do I get started with CrewAI? Maybe that's what you are wondering. Pretty easy. If you go to our documentation at docs.crewai.com or you can scan that QR code on the screen right now, you should be able to go to our documentation. You'll find a really easy, quick 1, 2, 3 step of how to get you started. The good thing is you can just do pip install CrewAI and CrewAI tools and it will import the CrewAI module and also the tools that the agents will need to build. Then we have different ways of building agents, but one that we usually recommend is the YAML template configuration. The important thing about this that I'd like to emphasize, it allows different people within your organization to build this crew. So with the YAML format allows, like it's very readable English. So anybody that's not even a programmer can read and actually adjust the prompts there. So that kind of stores all the prompts and then the code is separate and then you just call it from the configuration. So to build it, you just say CrewAI create crew and then the name of the crew that you want to build, maybe marketing crew, and it will create like a scaffolding of it that's kind of like a template for you that you can edit and make it personalized to you. And now let's get to the memory. So this is another cool aspect that I mentioned that I was going to talk about. So we have about 5 different types of memory in CrewAI, and I added there a snippet that says, without memories, we are nothing. That's also true for agents. So think of it as if you didn't have memory or if we didn't have memory, what would our lives look like? It would just be terrible, right? What I just said right now, I probably could repeat it again because I didn't know I just said it. And you wouldn't even remember your childhood. So that's just really terrible. You're just an empty vessel without memory. So same thing with agents in a sense. So if they don't have memory, then you'll have to go through the entire process each time. And as we know, tokens are gold right now. So if there's no memory, then you just have to use a lot of tokens and that's just going to end up costing you. So memory is very important. And so we have these different types of memory. So we have short-term memory, and if you compare it to the human, We have short-term memory right now. What I just said since we started, you've probably stored most of that in short-term memory. Some of it will probably end up in the long-term memory, but most of it is going to be in the short-term memory. And for that, we use RAG as well for retrieval and for the agents specifically for that. And then long-term memory is things that are going to persist for a while. So for example, for humans, it'll be like your childhood. You have long-term memories. Those are not going to change. They're just going to be there. Of course, unless something happens to you. And then we have entity memory, which captures the organ— it's more of like concepts together. So we have different entities that connects to different entities. It could be like a network of people and trying to connect which different people align with what. And that's another aspect of memory that CrewAI uses as well. So it could be people, places, and how they connect together. And it stores that and you could use that as well to help you answer your questions or help you solve your entire workflow of agentic process. And then we have contextual memory. So this is more of like a combination of short-term, long-term, and entity memory. And the good thing about this contextual memory is essentially instead of cramming the entire, all the memories together into like a single window, then it just takes that conceptual memory, contextual memory, which is more of like a summary of all of them and uses it to update the agent with the new task that you just gave it. And then finally we have user memory, and this is more of like your preferences. So maybe you like flying first class, you want to tell that agent, hey, maybe that's your travel concierge agent that books your travel. And if you give them your preferences, hey, I like flying first class, I like eating at 5-star restaurants, uh, all that, right? It will remember that. So anytime you tell it I want to travel to, I don't know, Madrid or Germany, it will kind of consider that to begin with and make sure that it adheres to that user preferences that you already gave it to. And just to gloss over, we also have an enterprise platform. So if you want to try it today, you go to app.crewai.com and it's pretty self-service from there. And finally, very importantly, we have a way to, you know, support our community. So if you want to join us, go to our community.crewai.com and that's where you'll find people asking a lot of questions. So troubleshooting problems together, I'm always the answering questions as well. So if you have any issues when you're doing when you're building your agents, go there, ask a question, or go through— probably somebody who's already running into the same problem, they found a solution to it. So good place to start. And also follow us on Twitter and X as well. And that wraps up my quick intro to CrewAI. Thank you.
Amazing, amazing introduction, Tony. Thanks for that. You actually already have a lot of questions, so if you would like to answer them right now, we can also do it. before switching to the demo. I have to say that your answers in your community helped me a lot to build this up. So yeah, Tony is a single-person crew doing a lot of stuff at the company. I have to say that. Yeah, if you would like to go through the questions, that's the right time to do it, I guess.
Yes, cool. Let me show here. So Dimitri would be curious to learn how CrewAI is different from other popular frameworks such as LangChain and LlamaIndex? Thank you. So yeah, very good question. I get that question quite a lot. And so I think for us, CrewAI, we, of course you've probably seen how we kind of structure our AI agents and we have flows. If you look at LangChain, for example, they have a different kind of way of handling that. They use DAGs and they use graphs and nodes to kind of have all these agents work and get to the final product. So it's just a different flavor of different understanding. So I think One thing that I see a lot and I hear a lot from folks is there's a bit of a learning curve, especially in LangChain. If you're not familiar with graphs, for example, it could be a little challenging for you to grasp the task. One thing that really makes CrewAI stand out is the ease of going from 0 to 1. It's really direct and very easy to understand and build something real quickly. Because maybe because our platform is more Pythonic in a sense, by Pythonic I mean it's very Python based in a sense. So if you look at how Python code is usually written in, uh, in a sense how it flows, so we have all the modularity in it. So example, for like the YAML files, we've separated that aside. Every— all the components are like modularized so you can understand, okay, this does this specific thing, this does these specific things. Not to say the other ones are, you know, eventually if you put in time, you'll definitely understand and figure out how it works. But I think the biggest, uh, advice I could give you is Go give it a try. You'll figure out which one you like best and you'll stick to that one. So that's always my biggest advice. I don't wanna shoo you in, but I'd say CrewAI is easy for you to get started if you wanna start there. And then let's see. And then I need to create a conversational agent to serve the public and it needs to have knowledge base with over 140 articles, medical, any tips? Yeah, so quick tips here. We just released, I think yesterday, we got a new version 0.98, I believe. We haven't shared a lot of examples, but that should be coming up in the next, this week for next week as well. And we have a conversational chat now, so conversational crew, so you can actually chat with it back and forth. And that's something that we've added on this new release that would allow you to do that. And we also have knowledge. If you go to CrewAI docs, we have knowledge which essentially allows you to pass a specific, maybe even a PDF to one agent and then another agent can have a different PDF that they can reference when they're answering the questions. Or you can put it at a crew level and the crew level is when you have all the crews together. You can just give him all that 140 articles and tell him, hey, just use this as your knowledge base to answer all the questions that I'm gonna ask you. So I think that would be a great— that's a great use case. And I think that's a good place for you to start. All right, so let's go to another question. Will we be able to view the slides afterwards? Yeah, sure. I can make this available and we'll share that at the description level as well. So that's good. I'll work with Casper here to figure out how do we get to share that with you guys.
Definitely, we'll be sending a follow-up email. So, but yeah, slides will be also put into the description of the YouTube recordings.
Awesome. And does this live stream have coding session? Yes, there's going to be a demo. Kasper is going to be showing us a really cool demo. Hopefully, um, we'll see that. And then, can, can we use Crea with JavaScript? I would say not yet. JavaScript, not yet. Um, We've been thinking about this. We've heard that a lot of people want this. So that's something that we'll be, stay tuned. We don't have any clear dates or when we are gonna build that out and send it out, but that's definitely in our roadmap for sure. All right, and can we build a RAG with Create AI and Databricks as a vector store? Ooh, can't share much, but something is in the works, especially with Databricks. I think there's a lot of really different integrations that a lot of people are asking for and Databricks is one. And yeah, there's something that we could build right now. We don't have an example for you, but yes, there should be a good way for you to build that. And that's the good thing with Create, right? You can build a tool and just literally attach to it and you could do whatever you want to do with it. So you can build any integration and add to it.
Yeah, let me also add another question, another comment actually. that I have to agree with. But yeah, there are also a lot of other questions to you. So yeah.
And why use Databricks? Use Qdrant, way better. Yeah, I agree with you. I mean, but also at the same time, you gotta understand people have different needs, different— maybe their company requires them to use that, so it could be that. Uh, but yeah, I mean, Qdrant is awesome and that's why we're here today. And then, uh, is CrewAI open source and free of billing subscriptions? Yes, the The portion we're showing you today, we do have an open source segment of it. And I essentially run the open source side of CrewAI. So we started as open source. We're always going to be open source. There's also a portion which I showed you at the end, which is the enterprise version. At the end of the day, we got to make some money somehow. And that's the enterprise version. So we have the enterprise version, which is basically a hosted version of the open source with extra whistles and bells like monitoring and scaling and things like that that you can build on top of. But yeah, we are free. You can just pip install and use it. How are CrewAI agents priced? If you go to app.crewai.com, you should be able to see and log in. You should be able to see the pricing tiers on there as well. Good place to start. I think we're going to have to cap some questions after a while because I think it's quite a lot. Let's see. What if you need using graphs and nodes, you still can do it with Crew. So with CrewAI, we don't have nodes per se. We do have flows and that's something that it allows you to have more of like a gated channel. You can, the agents or even at the crew level. So think about it as, like I mentioned, you have a crew that does specific things. So think of that crew as an engineering department and then you have a marketing department which has its crews or its agents and maybe you have sales department, engineering department, marketing department, all those departments. So what if you wanna orchestrate all of them to do something together? So maybe engineering builds a product, tells marketing it's ready, go market this. And then the sales does the selling of the product and then HR hires more engineers to build a thing, right? So you can use flows to orchestrate all of them together. So when engineering is done, it pushes it out to marketing, marketing does something and then sales, or you can have them parallel. When engineering is done, it pushes to marketing and it pushes to sales. All that happens together. So you can orchestrate them to do specific things at however really you want in a sense. And that's the beauty of flows. You can build, you're gonna stack agents on crews on top of crews. So you can build an entire organization with it, like a whole tree structure and just have flows orchestrate the entire play of how you want them to operate together. Let's see. Maybe I'll take one last one. And then we can have more time for the demo.
Sure, feel free to just— yeah.
In future, will CrewAI have UI like Langflow to manage different agents? So yeah, so, and this is something that I'm also working on. So you can build any UI really. We do have on the enterprise platform, we have a UI and we have a no-code almost at this point where you can actually just prompt like ChatGPT and it will build a crew for you. You can either download it and modify a little bit or just deploy directly and use it and it will be running on our platform. We do have a UI that you can actually build and it creates those really cool UI visualization that you can drag and drop different sections. It's really cool on the enterprise platform. I'd say that's a good place for you to explore there for those. I know there's a lot of questions. I'm probably going to just answer some of them afterwards. just being respectful of time, I'm going to pass it to Casper.
Thank you. Um, obviously, if there is enough time at the, at the very end of this session, we can also answer some more questions. So feel free to ask any questions that come to your mind. And yeah, right now I would like to switch to the demo. And first of all, I would like to introduce the basic idea of what we are going to build today. And first of all, everything starts with Obsidian. I'm not sure how many of you are familiar with this particular tool, but this is just a notes management tool. Really powerful. I mean, the basic version is just managing your notes, but there are many plugins available that actually make it really powerful. And the main benefit of using Obsidian is this is just, uh, this is a system that works just on your local file system. You can obviously sync the notes between different devices, so you can just build this knowledge base or your notes on your laptop, on your mobile, no matter where you are. But still, this is quite, quite powerful yet simple tool to build this kind of knowledge base. And I have to say, I use it on my daily basis to track different— track the progress of different projects, but also to manage my, my duties at the company and also to document some things that I want to share like article drafts that I write, etc. And I know Obsidian is really popular, and if you use Notion, actually we could possibly reproduce the same behavior we are going to build today, uh, using Notion or any different tools. And internally Obsidian works on Markdown files, which are really easy to be parsed. They can have some metadata, and this is really nice because you don't need any complex parsers just in order to extract some information, because Markdown is a pretty popular choice for those building any kind of, any kind of static websites, for example. And it's not that hard to just learn the basics. So I actually thought it would be awesome to have a system that would be taking my Obsidian notes and making them accessible in my Gmail inbox. I'm just going to share that because I think that might be pretty useful for everyone. This is the email address that I set up for the webinar today. This is not going to be active after the webinar. So if you are just watching the recordings, you won't get a response. But today it's live. So the demo I will be presenting in a few minutes is running and I will be answering all the questions you may have around CrewAI and Qdrant. I just scraped the documentation of both tools. So hopefully if you have any question related to any of the— of them, or maybe how to combine them together, you can just send me an email and the draft will be created automatically. Please be aware that your email address will be available to me. I know that that might be, uh, not the perfect, uh, idea to share it to public, but I will obviously— I won't be obviously showing that to during the webinar. But if you would like to get a response that was fully generated using the system, you can check the quality just right now. Okay, and my idea was quite simple. I have a lot of questions coming from our users, and they usually use our Discord channel, but some of them also have my email address, so they can, they can just send me some random messages. And I have to say that they are repetitive. So I can't even tell you how many times people were asking me some very basic questions just because they couldn't find the solution, or they just didn't want to read our documentation because they thought it would be way easier to just reach me directly. That happens probably. That's, that's not only my story, but that can happen to any business you might be running. Your customers might be just asking you the same questions over and over again. And Obsidian is actually a pretty nice tool to just document that, to collect all the responses you could have sent in the past, so then you can reuse them in, uh, for later communication. And I thought it would be awesome to have this kind of system that will be automatically generating drafts even when I sleep. So this is the overall idea of how to structure this kind of tool. Obviously you have a Gmail inbox And if you really want to create these drafts automatically, you need to have some kind of a listener that will be polling the new messages, some unread threads, and that will be generating the responses. And this might be obviously done, uh, with Google APIs. That's fairly easy. Uh, but then the all magic starts to happen because every single message that you receive may require or may not require your, your response. Let's say you subscribe to multiple newsletters. Obviously you don't want to even create a draft response of the response because you are not responding to newsletter. A lot of the messages may be just spam. And well, actually that might be a pretty interesting idea to start responding to spam messages just to see how it goes and what they try to do. And LLMs are pretty, well, actually pretty useful for that. Like, if you have some spare tokens, then definitely you could try it just to make sure they don't, they waste enough time just not to scam some other people. But in my case, I won't be answering to spam. The only category of emails that I want to respond to are actually some questions being sent to me by our users. So definitely LLMs are powerful to determine what is the category of a particular message, just to decide whether I should respond to it or not. And then once I have this idea, once I have a clue on what this particular message— what is the category this particular message should belong to, I can start to draft a response. Well, I could possibly automate sending those emails. That's fairly easy with Google API. However, I think that it would be really lack of respect to all the people trying to reach me. However, if I have a draft, I can easily work on it, rephrase some, some things, remove parts which are not really relevant. So there is some sort of human in the loop involved in that, because I feel that that's how things should be implemented right now. Of course, you can automate multiple things, but having— like, I don't want to be responsible for all the actions that might be performed by an agent, because LLMs still have many problems. They tend to make things up. And obviously, neither me nor my company wants to be responsible for this kind of communication. And on the other hand, we can have— we have this Obsidian vault, which is actually a directory on my local file system. There is another listener listening to all the changes happening in that directory. So whenever you create a new file, modify an existing one, or delete some files, because let's say you don't want to include that that knowledge, or maybe it's just outdated, I will be just notified about that event and I can react to it. So for example, if you deleted the file, I can easily remove all the vectors, all the facts from my knowledge base because they are no longer valid. And once I receive information that there is a new file sent, created in a directory, or a different or an existing file was modified, my another crew created in CrewAI will make sure to bring that knowledge into Qdrant knowledge base because that's the point in which both crews communicate with each other. The one on the right-hand side prepares all the data so it might be used by the one on the left-hand side. That's how the overall stack or overall flow of the processes looks like. And one thing that I decided that I tried to use in that process was to use something that was introduced by Anthropic, which is contextual retrieval preprocessing. So instead of just chunking my data into fixed length chunks, I decided first of all to let the LLM extract some meaningful pieces of information out of it. So if your documents have a lot of context switching, maybe you have some dialogues, then this naive way of chunking would definitely cut them somewhere in between. With that approach, LLM can actually analyze the whole text and divide it into multiple facts that I can store in my vector database. However, I decided to use this approach for a reason, because every single chunk has a specific role in the context of the whole document. This is also what Anthropic used their Claude model for. I also wanted to reproduce the same behavior here, so that's why This diagram presents 2 separate agents acting as a single crew. So, first of all, we'll be extracting these chunks, taking care of the semantics of the document, and then we'll be additionally adding some context to every single chunk. So, we know that's what, like, the role of this particular part of the whole document in a broader context. So this is the diagram that I took from the really great article by Anthropic. And as a result, I would like to have a mechanism that allows me to draft this kind of messages. So let's say I got an email, in what scenarios would you use CrewAI to build agentic applications? And then based on some knowledge that I already gathered in my Qdrant knowledge base, it can create this kind of draft. I can obviously change a lot, uh, here before sending that, but that's already of a great help because I can easily, uh, create a final message without having a look at my notes. Obviously, you never remember all the facts and you need to have a look, uh, at some, uh, at some notes to help your users. That's what actually happens within our company. However, if I ask it how to make a fruit salad, I don't really want the LLM to respond to this kind of message. However, I would like to have this information that it analyzed the whole thread and it just didn't want to create a response because that's not really related to what I do. That's what I would like to implement. And let me just dive right into the code because I think that might be of the most value. And let me also share the email address so you can send some messages during the webinar. So if you do not receive my response while we still talk, I will just send it just after the webinar. Obviously just need some time to review. I don't want to send you some, some promise that, uh, won't be, uh, won't be held. Um, okay, so let me just switch to my inbox first. So I have, I have 3 drafts created so you can have a clue of how these things are going to work. So first of all, I have a very basic question. What are the basic concepts of CrewAI? And because I scraped the website, I can easily ask this kind of questions. And then my crew was able to draft this kind of response. And one thing that I forgot to mention is that it is always asked to provide the sources. So whenever you create a draft of a response, you will also have some useful links that were fetched from the knowledge base so you can have a clue of what's happening inside. This kind of references are always great to have. On the other hand, if you would like to run Quadrant on-premise, you would be probably looking for an instruction of how to use Docker for that because that's the preferred way of doing that. Because it has access to our documentation, it can provide you with this useful Docker run command. It can even map directories so your data won't be gone when you just delete the container. It will be kept there. In case of any restart or updating the version, your data will be still available. It can also provide you some useful links. Again, we have some resources provided so you always know what actually, what kind of information was used to provide you that. And the last— oh, we have already some, some, some messages. I won't be showing your email addresses, that's for sure. So definitely I won't be showing your questions today. I'm not sure if I can legally do which, so, so please let me just answer these questions after the webinar because I don't want to make your email address public. And since we are streaming to YouTube, anyone could use it. So the last question that I asked just an hour ago was how to integrate Qdrant with CrewAI, because that might be something you would be looking for if you are listening to our webinar. And it does not provide you like an exact answer. Like it says that you can use Qdrant client for that. how you can use Qdrant in local mode. However, it mentions that there is no out-of-the-box agent integration mentioned in the documentation. That's right, because they're like— we are not integrated. Like, both systems may work together, and I want to prove that today. However, they're not officially integrated, and there's nothing that you have to implement on your own. And that's a great, uh, moment to just show the source code of that. Because actually integrating Qdrant and, and CrewAI is fairly simple. Uh, the only thing that you need to do is to implement Rack::Storage class, like your own implementation that would be using Qdrant to perform all the functionalities. So there are 2 key methods: search, that takes a query and produces a set of results, and those results have a very specific structure. Reset, that actually deletes all the vectors that you may have in the collection. And save, so you can store some new data in a collection. This is fairly simple. As you may see, we are just calling query points, our universal query API, and formatting the response to a format which is expected. And the same goes here. When you save, we are storing the value that was used to create this entry in your memory and also some metadata which might be pretty useful. We also extended this integration so you can delete some of the points by passing a filter. This is pretty useful for building our knowledge base. You can count how many points you have in a collection. And also some initialization to create a collection automatically. And it will automatically derive the configuration of the collection based on the EmbedderConfig you would pass. So actually, if you've already built any CrewAI system, you can easily swap the memory, at least short-term memory and entity memory, with Qdrant because it will use RAC under the hood. We create a collection, and on top of that, we also create a payload index, which is kind of useful because today we would like to integrate Obsidian with both tools. And Obsidian will generate some events that a particular location, a particular path file has been changed. And we definitely want to keep that information. This is going to be a metadata entry. So that's why we create a payload index on top of that that allows to search over your data efficiently. There are also some helper methods. Actually, the source code of this, of this agent system would be available for you. It's already public on Quadrant's GitHub, but we'll also send you a link. And what is important is how we set up the crew. I think that's a pretty, pretty interesting thing. And we are going to have 2 separate crews, so 2 separate departments as described by Tony. So first of all, those crews will share the same memory layer. I'm not sure if that's the right way of doing that, but basically an entity memory would be using Qdrant storage for that. So it will be using a specific embedder, specific model, and it will connect to Qdrant on a certain location using an API key if you decide to use our cloud. And the same goes for short-term memory. The only change here is a different storage mechanism, again, Qdrant. And what is pretty unique here, that's like an extension of, of, uh, like the memory layer of CrewAI, is that we introduce another concept which is called knowledge base. Uh, short-term memory and entity memory are fully controlled by CrewAI. So it's up to the, up to the framework to decide how to structure the data and what to put here. And we also wanted to have the knowledge base that will be managed from outside, uh, so that's why we define this knowledge base here. But it's also going to use Quadrant storage implementation that I've just shown, so nothing will be different. But that's also why we decided to extend the interface of storage, because we also want to be able to filter and delete some fields based on the metadata attributes. But all the rest stays the same. And I created both crews using the commands that Tony has presented during his presentation. Basically, the knowledge organizing crew would be acting as a search department, so to say. So basically, it will be taking some raw data, markdown files in our case, and it will be processing them so they are divided into meaningful chunks. And for that, we need to have 2 separate agents because we are implementing this contextualized retrieval like described by Anthropic. And we are using this YAML configuration, so we have some files defining agents and tasks. And we are just creating an instance of an agent, passing the config, and deciding which LLM to use. Since I decided to use this approach introduced by Anthropic, I also had to use their models. That's all. The prompt they shared is actually optimized for their models. So that's probably the best choice. Obviously, you can swap it easily. That's actually what I liked about CrewAI, swapping your model is fairly easy. You just need to provide a different API key as an environmental variable and then pass the name of the model you want to use here or at multiple places, because you can also change that globally if you would like to make a different model the default one. The same goes for the contextualizer, which actually will be bringing this additional information of what is the role of this particular chunk in the context of the whole document. The configuration is also passed in the YAML file that we are going to review in a second. I use the same model. Both agents are verbose. They're going to produce lots of messages. That's really great for debugging because you can see what are the prompts being sent to the LLMs, what are the outputs, and how actually it works. And then we have tasks. So there is— the first task will be extracting these chunks from the document, and the second one would be bringing this additional context. What is really useful if you want to build any sort of agentic system is to use structured output at the very end of the process, because that's usually what you would like to store somewhere or pass to a traditional application, and it's best to have like a structured output that you can pass directly instead of parsing it on your own. And that's fairly easy with TROI, you just need to pass a Pydantic model. And that makes sure that the output structure follows the, like the output that you would like to have at the very end. So we'll be working with Pydantic quite, quite often today. And the crew itself will be a sequential pro— using a sequential process, so it will call both agents in a sequence. And the sequence is defined based on the, on the order of the methods in this file, as far as I can tell. Obviously, it will use the entity memory as we define it, short-term memory. And yeah, and actually, majority of this code was generated by, by CrewAI commands. And let's just have a look at the configuration. So first of all, at the agents. So there are 2 agents, and each agent has a role, has a goal, and a backstory. So this actually will go directly to the prompt sent to the system. So here you are just defining the— it's like a job description. I actually like this analogy. It's like a job description. So you can just provide the expectations that you have. And here we would like the chunk extractor to act as a search expert. So big companies usually have search departments, and those search departments are responsible for making their data searchable. So improving the search engine by various methods and actually structuring the data properly is also one of the one of the methods they could use. And that's especially important when it comes to RAG. So we expect it to take a Markdown file and produce a list of meaningful chunks. We allow the model to combine different parts of the documents if they have similar semantics. And contextualizer is actually bringing this additional context to each chunk. Let's now switch to tasks. In tasks, we specifically define what has to be achieved. So our agent will get a document, document will be passed here, and it will extract those chunks based on, like, making them separate meaningful pieces of information. And this will be done by chunks extractor. So that's where we configure the agent that should perform this task. And the same goes here. And actually here, I specifically used the prompt as provided by Anthropic. So that's actually just adjusted because Anthropic calls the LLM separately for each chunk. I decided to call call it once for all the chunks just to see whether that works. And I think it would be pretty useful to have a look at— well, we have lots of questions— at Qdrant's UI. So let me just refresh it. We have our entity memory, short-term memory, which are both managed by CrewAI, but they also have knowledge base. And this knowledge base is managed by our knowledge knowledge tool that we— crew that we created to structure our knowledge. And here we have some chunks and we have a path to the file that was used to create it. We have the context. So this particular chunk has this specific role in the context of the whole document. And that actually helps a lot because when we create vectors, we combine combine both texts together, which is pretty useful. We also have some metadata because that's what we can find in the Obsidian vault. Here we have just a set of subpages from both CrewAI and Qdrant summarizing some key ideas behind both tools. And this metadata is just taken automatically. So that's how things work. Okay, so here is the knowledge base. Right now we have over 100 points, but what I would like to do now would be to open one of the subpages of Qdrant documentation, and it will be specifically on how to integrate CrewAI with Qdrant. Anoush, one of our engineers, did a great job documenting that. He described how to implement a custom storage layer using Quadrant. So actually, this page was not indexed by my, by my crew yet. And just by clicking at Obsidian Web Clipper— this is actually a plugin to Obsidian that automatically takes, extracts content from any website and brings it to my Obsidian vault. So here it has extracted all the, all the text from the website, and right now my crew has already started processing it because it received, uh, an information that there is a new, new file being created. Let me just scroll it up a little bit. Oh, we had an error with the LLM. That happens quite some time, unfortunately. However, Maybe I just have some issues with my API key, maybe just exceeded some rate limits. However, you can easily bring some new data. Let's say you read a lot of websites every single day and you would like to collect this information for further reference. Let's say you don't have time right now to just read a specific article. You can just do it in the future. So that's what you can easily do with Obsidian Web Clipper, and that will also make these articles automatically available for your crew. And the second crew that we have is the one that is creating this automatically created draft, which is defined in a very similar way. So we have the first agent that does the categorization, and this one uses Gemini. I actually tried to do everything using Gemini at the very beginning. However, I really struggled with producing drafts of a good quality. Like, so to say, probably that's more related to lack of knowledge of Gemini from my end than to anything else. However, I decided to switch to Claude because that's my daily driver, so to say. That's what I usually use. And you can actually experiment if you would like to use a different model for all the agents. You just need to change the LLM and that's basically it. And the main difference here is that the response writer is not only asked to use the LLM, but it also uses quadrant search tool. That's another part integrated for the purposes of this webinar. It's fairly simple because it takes the storage layer, our knowledge base, and then when we run it, it runs the search method on the storage layer. So it's quite well integrated here, I would say. And as a result, this agent will be able to call Qdrant directly, create a query, and then produce the response based on the knowledge base, not only based on its let's say, on the knowledge of the LLM itself. And one important thing here is that we don't want to create a response if the categorizer decides that this particular thread is spam, it's a newsletter, or maybe some sort of social media notification. Definitely, you want to ignore this kind of messages. You don't want to waste your tokens to respond to to respond to anything. So basically what you would like to— what you will have to do would be to ignore this kind of messages completely. So that's why we decided to use conditional task, and there is a condition which is is_a_question, which is just a method of the same class, and this is fairly easy. We know that the output of the task will be a Pydantic model, so you can just take it as it is and check whether there is a question tag in the list of categories, because every single, every single message may belong to multiple categories. So that's how it, how it looks like. And we can also review the autoresponder configuration. That's also a YAML file. So there is just a job description for both categorizer. There is a list of the categories we want the messages to belong to, and there is a task. And the task is to take a list of messages, because if you have an email thread, there might be multiple messages. So that's why you would like to present that to the model and The expected output is just a list of all the categories this particular thread should belong to. And for the response writing task, we are also providing messages, and the expected output is actually HTML, very simple HTML that we can pass directly as a response. What we also do here is that we allow the model not to provide a response and answer I cannot provide a response if there is not enough context or if our knowledge base didn't contain the information that is required to answer it. Okay, I see we have lots of questions, so let me just try to answer some of them right now, and then we'll just review how the implementation looks like. So, Yeah, uh, Jenny has a really cool idea of, of, uh, spamming the spammers. Yeah, that's what might be actually achieved quite easily with that setup. I definitely need to experiment with it a little bit. Um, are the categories fixed? Yeah, they are fixed for the time being. Uh, so, uh, but you can easily extend them. Like, it's not a big deal to extend the list of categories Because you can just pass another list if you prefer. That's pretty easy. It's all in a YAML file. You can also pass the list to someone who is not technical at all and everything should be working quite well as well. That's right. There is a finite number. That's a follow-up question to that. There's a finite number of categories, just 4, but that might be easily extended. Is contextual retriever processing different from MCP? Yeah, it's like those are completely separate ideas. MCP is just to bring some different tools to Cloud Desktop, so they are different. The code will be available, but this is already answered. Okay. There is a question about how CrewAI handles prompt management, and that's probably a question more for Tony, but that's something that you would need to verify. However, there is another question of what is the added value of using an agentic system for this knowledge retrieval versus a simple RAG model. Well, the main difference here is that our system can decide whether to send a message or not. And this is just a basic form of the agentiCRAC, because in a traditional simple RAC model, it would draft a message. It will take the knowledge out of your knowledge base even though the message won't be sent because you are just answering to a newsletter or a spam message. So that's not something you would like to have in a system. And definitely, agentic crack might be more complex because it may phrase your query differently. But that's actually something that already happens when you use CrewAI. I would definitely love to see the logs of our application because that might be really great and will give you some context. This is how it calls the search tool. So it doesn't necessarily take your whole message and bring it to the quadrant search, but it can rephrase it and extract, perform some sort of query expansion or actually rephrasing the query so it can derive the information based on it. So this is really useful to have this kind of logs here. And this is also how the categorization Looks like. So this is it when it comes to all everything which is related to Korea. Actually, that was fairly simple because we just used some of the existing blocks here except for the quadrant integration. However, if you are also interested in how this how this system is implemented, this is how it looks like. There is just a simple main file that runs two separate threads. There is a file system listener. That takes a location on your hard drive and then monitors for changes. There is a separate— there is a specific handler for that, and this handler is actually monitoring all the events. And when you create a new file, it will take its content and call the crew that organizes knowledge in our knowledge base. So that's basically it. So nothing really fancy here. And there is also another listener polling the messages from your Gmail inbox. And the source code of this demo would be just available for you. There is a repository. However, I would like to have a look at one of the questions that we have. So we have lots of drafts created, and, uh, let me just maybe have a look and share one of the questions and the answer. However, I would like to hide, uh, the email address of the person who sent that particular message, so let me just, uh, turn off my screen sharing for a while, um, but we'll come back. Okay, I just need to remove the email address. However, there is a question: suggest effective ways of— for improving retrieval and chunking. And you already have some chunking strategies, retrieval improvements, and performance optimizations. And this is what the responses were based on. So it's not perfect yet. That might be pretty useful for those who would like to improve it. And you already have an integration in place. So if you'd like to make sure that you can always respond to all the emails on time, I think this, this demo might be pretty useful. And here is the repository, which is already public. I just made sure to make it public just before the webinar, and it has a README describing how to set everything up, what are the requirements. And there are just environmental variables to share and some configuration from Google Cloud Console. But other than that, you should be able to set up an agentic system answering or drafting the responses to the emails sent to you in no time. By default, we are using Gemini and Claude. However, you can also experiment with different models. Maybe you are a fan of some smaller models which are cheaper, or maybe you have lots of credits that you would like to use for that. And that would be actually it. If you have any questions, please feel free to ask them right now, or feel free to reach Tony or me directly on LinkedIn, Twitter, wherever you can find us. That was a great, great pleasure to speak to you today and also meeting Tony. That's always a pleasure, and hopefully that wasn't the last time we can have you on our webinar.
Yeah, definitely. Thank you for having me. I mean, it's been great. I think definitely we probably deserve another round of this webinar to happen with more examples and I think answering more of the questions that folks are having. If I can slide in one page share that would answer a lot of questions that I've been going through and seeing. We did share insights recently and I just want to share that with folks so they can see that. We did release an analysis recently, more of insights of CrewAI because we've had a lot of people using CrewAI and we just wanted to share the insights. And I've shared the link there in the chat as well. And essentially this is more of like an industry, you know, what are AI agents looking like in production, especially CrewAI? And we surveyed over 4,500 professionals that are using right now at the moment. And just to highlight, you know, what are the main horizontals that are people using CrewAI for or AI agents? We have a lot of back office automation, coding, Support as well. And one thing with support as well that is very interesting is we see a lot of support being used by smaller companies compared to bigger companies, which is interesting. Software. So there's a lot in there. And we have this use case as well in production with PwC, PricewaterhouseCoopers. If you're not familiar with them, they're a consulting company and they jumped from a 10% accuracy to 70% accuracy in code generation using AI agents, using CrewAI, which is really interesting. You can actually watch this clip there as well. Another cool opportunity here for you all, if you're looking for ideas to where would you plug in AI agents within your company, you can come to this page, put in your email address there, like your company email address because it's going to have that domain, or just put your email address, whichever email address you want to receive the report to. Then you have the company domain, you can put maybe quadrant.com, for example. When you create— when you hit the create customized report, it's going to generate a PDF. And essentially agents are doing this in the backend. So if you put in your email address and a company, it's going to go research your company and then the agents are going to do some analysis and figure out what are the potential use cases on the ROI. And then it's just going to generate a PDF and send it to you in like a few minutes. So yeah, go try that. That's a really good way to kind of figure out what maybe some use cases that your company could consider. to consider. And then how do we compare? This is a question that I've seen a lot. How do we compare with other AI agent builders? Of course. So if you look at this, we have done different deep dives. We have features in production, a bunch of them on there as well. And then as well, one thing that we are seeing, teams that want to move fast. So production in 30 to 60 days, for example, we've seen a lot of that as well. So if you move fast, you win fast, especially in this AI agent space. That's what we're seeing a lot. And then as well, customers using CrewAI for high precision use cases. So there's the crew that I just defined and there's hooks and guardrails making sure that it doesn't go off rail. Somebody was talking about that in the questions in the chat. And then so more flow's gonna give you more precise guardrails in a sense. And we also released guardrails which essentially guides your agent so it doesn't go off the rail. You can add more logic to it and verification as well. That's another something that you should look at. We have that in our docs as well. And then if we go like a deep dive comparison with LangChain, flows are much faster compared to the traditional graph-based automation. And you can try that. We have demos here as well. You can try them there as well and do a comparison of them. And then there's the imports and checking executions comparisons. And then we have best practices for implementing multi-AI agents. So of course, Pretty technical teams will move fast and build more stuff, but no-code is coming eventually. And then we have a lot of companies as well that have been hiring for Crew AI experience, which I think if you go to our latest job description, if you're in our docs, you'll see a lot of new companies and I have a crew that automatically updates daily the jobs that are asking for Crew AI experience. So that's a really good place for you to look. And then we have most popular LLMs powering AI agents. So we have OpenAI, of course, Ollama for open source ones. I think feedback a little bit there for you, Casper, when you were showing that demo. One thing that maybe somebody could try is for the LLMs, before you're passing the LLM, you can turn the temperature to 0 so that way it's more grounded. There's an LLM class that you can define on actually passing the temperature. I think you did a really wonderful job building that. By the way, I don't think I have any extra things that I would have done differently in a sense. I think you did a really good job building that. One thing maybe is just that, play around with that temperature and see maybe if you get better answers in that sense.
Yeah, definitely. Thanks a lot for your comments. That would be definitely really helpful, especially if you really want to send those drafts as they are. Thanks a lot, Tony. That was a pleasure. And yeah, hopefully that wasn't the last time we see each other in this kind of session. Thanks everyone for joining us today. The recordings will be available probably tomorrow, and we'll put the links to all the materials we shared today. And you can also expect to have a follow-up email being sent to your inbox, but please do not generate drafts automatically. We are looking forward to your feedback. Thanks again, and hopefully see you soon.
All right.
More from Tony

Summarize Videos and Research Companies with CrewAI + Gemini Models [Quickstart Guide]

How to Make Your AI Agents More Reliable with CrewAI Task Guardrails (Step-by-Step Tutorial)








