Conclusion / Learn

Video Transcript (English)

Congratulations and awesome job on completing this unit. In this unit you learned what RAG is and created a simple question and answering application.

Now you can implement Atlas vector search using the RAG technique to improve the accuracy of information generated by a large language model.

Let's recap what we covered. First, we learned that RAG combines embedding models, vector retrieval, prompting, and generative models to pull relevant information from a data set and generate detailed responses based on that information.

Remember the data used can come from multiple sources. Once the data has been identified it's sanitized and split up into chunks.

After that vector embeddings are generated for each chunk.

Finally, the chunks and embeddings are stored in Atlas. But if you recall, this is only the first piece of a RAG app. Let's revisit how the chunks we created are used. First, our user will provide a query which we vectorized and then use to perform a vector search. This returns any relevant chunks stored in the Atlas cluster.

Next, a prompt is assembled which includes the retrieved chunks as relevant context and the original query. The LLM will then use the provided chunks as context to generate a response. After learning how RAG works behind the scenes, we took a short detour to explore some of the AI integrations and frameworks that can be used to help us develop GenAI apps. This included Amazon Bedrock, llama index, Microsoft semantic kernel, and langchain.

Then we began creating our own RAG app using the langchain framework. We started off by identifying which data we wanted to use. Once we determine the data, we sanitized it and split it into chunks.

Finally, we generated embeddings for each chunk and stored them in Atlas. After that, we turned our attention to the retriever component. We learned how to apply pre and post filters to improve the retrieval of our chunks. Last but not least we implemented the component that generates the response based on the context provided by the retriever. Now that you know about retrieval augmented generation you might wanna check out our videos on chunking and ingestion.

You can also visit MongoDB's documentation and dev center for more information on RAG and vector search.

We hope you enjoyed learning about RAG as much as we enjoyed teaching it. Until next time, keep learning.