From the course: LLM Foundations: Vector Databases for Caching and Retrieval Augmented Generation (RAG)

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Set up Milvus for RAG

Set up Milvus for RAG

We will now proceed to build a RAG system using Milvus as the vector store for the knowledge base. The code for this chapter is available in the notebook code_06_XX RAG With Milvus. I have this notebook opened up here. In this video, we will set up the Milvus database to use it as a vector database for RAG. We first start by setting up a connection called rag_conn. We will create a new DB called rag_db. We then switch to this database as the current database for the active connection. Let's run this code now. Next, we will create the schema and the collection. For schema, we have the following fields. There is the chunk_id_field that is the primary key. We will create this chunk IDs manually, even though they can also be set up as auto-generator. The rag_text_field stores the clear text for the chunk. The rag_embedding_field stores the embedding vector for the chunk. Then we proceed to create the schema and create a collection called rag_collection. We print the available collections…

Contents