From the course: Advanced RAG Applications with Vector Databases
Demo: Querying
- [Instructor] Querying the vector database is part of what goes on behind the scenes in a RAG application. The LLM queries the vector_store to get some context back to create a response. When we interact with the RAG app, we never see this query. In this video, we're going to take a peek behind the scenes to see what the LLM sees. When we query a vector database, we get some top_k results back. For langchain FAISS, the default k is 4, as shown here. The first step to perform a vector_store query in langchain is to take our vector_store and call the as_retriever function on it. This prepares the vector_store to be queried with strings and abstracts out the necessity of turning a string into an embedding and calling a query function directly. Then, we call the invoke function of the retriever and pass a string. The result is the top four results that are in our vector_store as according to the embedding model we defined earlier.
Contents
-
-
-
Introduction to preprocessing for RAG4m 57s
-
Chunking considerations5m 12s
-
Chunking examples4m 32s
-
Introduction to embeddings9m 50s
-
Embedding examples2m 57s
-
Metadata3m 12s
-
Demo: Chunking2m 32s
-
Demo: Metadata1m 23s
-
Demo: Embed and store2m
-
Demo: Querying1m 8s
-
Demo: Adding the LLM2m 1s
-
Challenge: Cite your document sources47s
-
Solution: Cite your document sources59s
-
Challenge: Change the chunk size44s
-
Solution: Change the chunk size55s
-
-
-
-