From the course: Hands-On AI: Building LLM-Powered Apps

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Retrieval augmented generation

Retrieval augmented generation - Python Tutorial

From the course: Hands-On AI: Building LLM-Powered Apps

Start my 1-month free trial

Retrieval augmented generation

- In the previous chapter, we built a simplified Chat GPT application using Chen and Chain Lit.* In this chapter, we will try to bring knowledge into our chat with PTF application via PTF document. We mentioned that in the previous video, a large language model tends to hallucinate, and we can fix that by putting information in the input context, but the contact then is not infinite to fit all of the information out there. And the solution to this problem is to augment the large language models with relevant knowledges, with regards to the question. This architecture pattern is called Retrieval Augmented Generation or RAG. What Retrieval Augmented Generation does is that it separates our application into two portions. On one hand, we have the large language model, and on the other, we have a search engine. So on the large language model side, it is responsible for generating and reasoning the answers. On the other side, we rely on the search engine to surface the most relevant…

Contents