Loading video player…

Introducing the Project

00:00 In this lesson, you’ll start building a RAG query engine, or rather you will be preparing for it, I should say, because we have to talk about the project first before you can dive in.

00:11 So this project means that you work for Steven’s Pythonistas Limited, which is a fictional company for the avoidance of doubt, and you are to build an interactive chatbot that analyzes Steven’s Pythonistas Limited’s secret Code of Conduct policy, and then allows staff to ask questions about this Code of Conduct.

00:33 And again, just to reinforce that RAG isn’t just about secret documents, of course. RAG allows the LLM to consult information that it wasn’t trained on, and that information could be secret, but it doesn’t have to be.

00:45 It could be any kind of information.

00:48 So when you download the code, you will find the following structure. There is the company_policy.txt file, that’s our secret document, and that sits in a data subfolder, in case you’re looking for it.

01:02 And then there are a number of versions of the policy_bot.py file. Those are just the examples you will be going through step by step throughout the course.

01:13 At the bottom, there is policy_bot.py without a version number, and that is your working file. So that is a file in which you can code along.

01:23 And at the very bottom, there is a README.md file that you can use to set up your environment.

01:30 Now, this is the secret company policy. So it’s a Code of Conduct for Steven’s Pythonistas Limited, and there are three rules. First one is that staff are not allowed to wear a hat in the office.

01:41 Secondly, swearing is not allowed and it will result in a fine, which is a $1 contribution to the swear box. And thirdly, staff are not allowed to work weekends.

01:53 The idea, therefore, is that this Code of Conduct is fed into the LLM as a secret document, in which case it becomes the context of this LLM, and then we can use the LLM to query this document and ask questions about the company policy. In the next lesson, you will build a basic example, and then later on you will refactor that example and add persisting to the example.

Become a Member to join the conversation.