RAG

Large Language Models (LLMs) have unlocked the potential to create advanced Q&A chatbots capable of delivering precise answers based on specific content. These systems rely on a method called Retrieval-Augmented Generation (RAG), which enhances their responses by grounding them in relevant source material.

In this tutorial, you’ll learn how to create a basic Q&A application that can extract and answer questions from given document sources.

The process can be separated out into 2 sub-processes:

  • Indexing

  • Retrieval

Indexing

Document Stores is designed to help with the whole indexing pipelines - retrieveing data from different sources, chunking strategy, upserting to vector database, syncing with updated data.

We support wide range of document loaders, ranging from files like Pdf, Word, Google Drive, to web scrapers like Playwright, Firecrawl, Apify and others. You can also create custom document loader.

Retrieval

Based on the user's input, relevant document chunks are fetched from vector database. LLM then uses the retrieved context to generate a response.

  1. Drag and drop an Agent node, and configure the model to use.

  1. Add a new Knowledge (Document Store) and define what the content is about. This helps the LLM understand when and how to retrieve relevant information. You can also use the auto-generate button to assist with this process.

  1. (Optional) If the data has already been stored in a vector database without going through the document store indexing pipeline, you can also connect directly to the vector database and embedding model.

  1. Add a system prompt, or use the Generate button to assist. We recommend using it, as it helps craft a more effective and optimized prompt.

  1. Your RAG agent is now ready to use!

Resources

Last updated