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

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

1h 33mAdvanced2024-02-23

Authors

Kumaran Ponnambalam

Kumaran Ponnambalam

Working with data for 20+ years

Course details

As large language models grow in popularity, the infrastructure to be used around them also becomes vital to reduce costs, generate accurate responses, and improve efficiency. Vector databases play a vital role in several LLM use cases to help alleviate LLM shortcomings, reduce costs and latency. Knowledge of its basics and applications are vital for any engineer building applications with LLMs, and in this course, Kumaran Ponnambalam teaches you the basics of vector databases and how to use them in LLM caching and retrieval-augmented generation (RAG).

Kumaran begins with a discussion on the basics of vector databases and their applications. He then explores specialized databases for storing vectors and uses the Milvus database as the reference example, and demonstrates read and write operations with the Milvus database. Learn how to use vector databases for LLM caching, with an example use case, along with examples of RAG use cases. Finally, Kumaran concludes with a discussion on optimizing vector databases.

Skills covered

Natural Language Processing (NLP)Machine LearningArtificial Intelligence FoundationsDatabase DevelopmentDatabase ManagementFoundationsArtificial Intelligence (AI)Software Development

Concepts

Introduction

  • GenAI with vector databases
  • Course coverage and prerequisites

Introduction to Vector Databases

  • What is a vector
  • Vectorization in NLP
  • Vector similarity search
  • Vector databases
  • Pros and cons of vector databases

Milvus Database Concepts

  • Introduction to Milvus DB
  • Milvus architecture
  • Collections in Milvus
  • Partitions in Milvus
  • Indexes in Milvus
  • Managing data in Milvus
  • Query and search in Milvus
  • Set up Milvus and exercise files

Milvus Database Operations

  • Create a connection
  • Create databases and users
  • Create collections
  • Insert data into Milvus
  • Build an index
  • Query scalar data
  • Search vector fields
  • Delete objects and entities

Vector DB for LLM Query Caching

  • LLMs and caching
  • Prompt caching workflow
  • Set up the Milvus cache
  • Inference process and caching
  • Cache management

Introduction to Retrieval Augmented Generation (RAG)

  • LLMs as a knowledge source
  • Introduction to retrieval augmented generation
  • RAG - Knowledge curation process
  • RAG question-answering process
  • Applications of RAG

Implementing RAG with Milvus

  • Set up Milvus for RAG
  • Prepare data for the knowledge base
  • Populate the Milvus database
  • Answer questions with RAG

Vector Databases Best Practices

  • Choose a vector database
  • Combine vector and scalar data
  • Distance measure considerations
  • Tune vector DB performance

Conclusion

  • Continue with LLMs
40,000 Toman