This is actually a fun first time project trying to create a RAG (Retrieval Augmented Generation) application. I was curious on how we could task LLMs (Large Language Models) to do something specific for us as in with our own custom knowledge. So, I decided to try and task a LM (Language Model) to answer any question related to a game i usually play (League of Legends).
Firstly, the user would attempt to query the LM, but before giving the prompt to the LM we adjust the prompt by adding context. To get context we refer to a vector store (A database storing document embeddings and the documents stored in this case are from the League of Legends Wiki). We perform a similarity search between the user query and the document stored in the vector store to retrieve the most relevant documents. These relevant documents are the context that will be added in our prompt and would be given to the LM. Finally, with LM generative abilities it would then be able to answer our question since we gave it some context, even though the LM wasn't initially trained to answer such questions.
You are a helpful assistant that can answer questions about League of Legends champions based on the data given to you.
Answer the following question: {question}
By looking through the following data: {docs}
Only use the data available to you to answer the question.
If you feel like you don't have enough information to answer the question say "I don't know"
Your answers should be verbose and detailed.