Session: GenAI RAG Workshop

The “GenAI RAG Workshop” is an immersive, full-day training designed for engineers seeking to harness the power of Retrieval-Augmented Generation (RAG) for AI-driven solutions. Participants will explore foundational concepts, including embeddings, vector databases, and advanced RAG techniques while delving into practical applications of tools like MongoDB Atlas Vector Search. Through a blend of lectures and hands-on labs, this workshop equips attendees with the skills to effectively design, implement, and evaluate RAG pipelines, focusing on optimizing AI systems for precision, scalability, and relevance. By the end of the session, participants will understand how to integrate RAG with cutting-edge vector database tools and frameworks to enhance AI-driven workflows.

GenAI RAG Workshop (Requirements)

The class format will include lectures and instructor-led coding exercises. However, participation in the exercises with the instructor is not mandatory. Having your lab environment is not required for this class. The course is designed to balance concepts and code equally. Many students simply follow along with the lectures and code examples. Breaks will be provided during the exercises for review; however, we do not recommend fully engaging in the labs during the training day. We suggest following the instructor and reviewing the code during the breakout sessions. At the beginning of each new section, a Q&A will be available for questions. Due to the class size, fully hands-on labs will not be practical. As we have done in previous sessions like this, we encourage you to complete the labs after class once you’ve absorbed the material. 

Before starting the Retrieval-Augmented Generation (RAG) workshop, set up your API keys with the necessary providers, such as OpenAI and Claude (Anthropic). These keys are required to access language models during the workshop exercises. If you haven’t already, sign up for an account with OpenAI and Anthropic, retrieve your API keys from their respective dashboards, and securely store them. Ensure your keys are correctly configured in your environment, whether through environment variables, a .env file, or direct input in your application. Verifying your API access beforehand will help avoid delays and ensure a smooth hands-on experience during the workshop.

The setup guides are available in the class-provided repo; however, if you’d like to be prepared to follow along with the code examples, here’s the setup:  

Setting Up Python and VSCode

In this class, most examples will be in Python. We will provide some lecture examples in TypeScript, but most will be in Python. This class focuses not on the programming language itself; instead, the key points are how to leverage the mechanisms of RAG and, more broadly, generative AI.

Note: We will not have enough time to set up lab environments during class (i.e., installations, configurations, and verifications)

Python

We’ll set up a Python environment for these lessons using version 3.11.

System Python

macOS includes a pre-installed version of Python, but it’s typically outdated. To check the version:

/usr/bin/python3 –version

Setting Up VSCode

If you haven’t installed VSCode yet, download it here: VSCode Download. Take a moment to familiarize yourself with its interface.

Essential Extensions

To use Python in VSCode, install the following extensions:

Check if Python is correctly installed from a VSCode terminal:

python –version

Setting Up a Virtual Environment

To keep dependencies isolated, we’ll create a virtual environment. More details: VSCode Python Environments.

Creating a Virtual Environment

Option 1: Use the Command Palette:

  • Search for Python: Create Environment and choose .venv.

Option 2: Use the Command Palette:

  • Search for Python: Create Environment and choose .conda

Presenters: