1 min read
RAG Systems
Learning about RAGs
One of my coworkers has a youtube channel called AI Roundtable (link below). I am interested in learning about AI systems (might do a masters later), and decided to start watching his videos. His third video is about RAG, which is something used at Brilliant Harvest.
What RAG is: RAG (Retrieval-Augmented Generation) is a series of processes to get answers from an AI model. Instead of uploading a hundred documents every time you ask a question, you ingest the documents once into a vector database, the relevent chunks are retrieved, and finally the model has enough context to answer.
In Detail:
Phase 1. Ingestion.
First the documents have to be loaded obviously. After that these docs are broken up into chunks. After that the embedding (list of numbers that represents the meaning of a piece of text) and the original text of the chunks are stored in the vector database.
Phase 2. Retrieval First the question itself is embedded with the same embedding model used during ingest. Then the search is applied with this embedded to the vector database. After that each chunk is scored. That way the top K chunks with the highest score get selected. These are the contents important to the question.
Phase 3. Generation. In this step the LLM is used. The LLM only sees the instruction (LLM's are only suppose to answer from the retrieved chunks and not its own knowledge) and the chunks that are retrieved and the question
Excited to learn more about ai systems.
AI Roundtable: https://www.youtube.com/@airoundtable
Soban