In case you missed the memo, RAG is all the rage in the AI world these days. If you don't know what RAG is, here's the TLDR;
RAG stands for Retrieval Augmented Generation, it all makes sense now right?
Okay so probably not. I'll go a step further and I think you'll see that RAG isn't actually all that complex, at a high level. RAG is the process of feeding specific data to an LLM so it is referencing what you consider to be highly relevant data (external data that you feed in) to allow for higher accuracy (and less hallucinations) in responses to prompts.
Over the last few months I've had more people ask me about RAG than ever before and I keep sending them to one article or another. I finally decided it was time for me to write my own article, and for me, I find I learn the best by doing, so I thought I'd put together a little tutorial and show RAG in action for something that I myself would find useful.
So here we go.
This is definitely going to be a multi-part series so to kick things off I'm just going to share the high-level goal for my RAG project. I want to use RAG to make it easier to find snowshoeing trails where I live, Lake Tahoe. Right now when you use an LLM like ChatGPT to find snowshoeing trails it gives pretty generic results, and it's tricky to drill down into specifics like difficultly level.
Lake Tahoe likely has thousands of snowshoe trails, but it's safe to say LLMs like ChatGPT don't know about most of them. I want to change this, I want to leverage the awesome horsepower of an LLM, coupled with lots of specific data about snowshoe trails in Tahoe, so that's what I'm going to build.
So what do I need to get started? Well the high-level components of a RAG system are:
- All the additional data you want to feed the model
- User inputs
- A similarity measure between the data and the user inputs
As for what I'll be using to code this. While I'm the most comfortable in Python, I've been trying to expand my JavaScript chops lately so I'll be using React and Node to make this happen.
And that's enough for now. I want to keep each post in this tutorial series short and sweet, and I know for people that don't know much about RAG, this was already probably quite a bit to take in.
If you want to do a deeper dive into RAG before my next post, I would highly recommend reading this article from NVidia, aptly titled - What Is Retrieval-Augmented Generation, aka RAG?
Now, it's time for me to go snowshoeing in Tahoe!