Do this before the session (about 20–30 minutes, mostly waiting for downloads). At the end, one script tells you whether everything works. If it says All good, you are ready.
1. Install Python
You need Python 3.11, 3.12 or 3.13. Check what you have:
python --version # on Mac/Linux you may need: python3 --version
If it is missing or older, install it from python.org/downloads. On Windows, tick "Add Python to PATH" during install.
2. Open a terminal in the main folder
Unzip the folder you received. The main folder is the one that contains 11-rag-setup and the RAG module folders (12-rag-... to 15-rag-...), that is 00-basics. Open a terminal there
(VS Code: File → Open Folder, then Terminal → New Terminal).
3. Create a virtual environment and install the libraries
A virtual environment is a private box of libraries for this course, so it does not disturb other Python projects.
python -m venv .venv .venv\Scripts\activate pip install -r 11-rag-setup/requirements.txt
python3 -m venv .venv source .venv/bin/activate pip install -r 11-rag-setup/requirements.txt
You will see (.venv) at the start of the terminal line when it is active. The install takes 5–15 minutes (it downloads PyTorch for the local models).
Activate the environment again (the second line above) before running any file.
4. Add your OpenAI API key
- Create a key at platform.openai.com/api-keys (your account needs a small amount of credit; the whole course costs a few rupees).
- Make a copy of the template, named
.env, in the main folder:
copy 11-rag-setup\env_template.txt .env
cp 11-rag-setup/env_template.txt .env
- Open
.envin VS Code or Notepad and replacesk-paste-your-key-herewith your key. Save.
Never paste your key into code, screenshots, WhatsApp or GitHub. The .env file keeps it out of your code.
5. Run the setup check
python 11-rag-setup/check_setup.py
Python 3.12.4 1) Libraries [OK] openai [OK] langchain_core ... 2) Free local models (the first time this takes a few minutes) [OK] all-MiniLM-L6-v2 (sentence embeddings) [OK] ms-marco-MiniLM-L6-v2 (reranker) [OK] glove-wiki-gigaword-50 (word vectors) 3) OpenAI API key [OK] chat model gpt-6-luna replied: 'OK' [OK] embedding model text-embedding-3-small returned 1536 numbers All good. You are ready for the session!
6. How to run the exercise files
| File type | How to run |
|---|---|
.ipynb (notebook) | In VS Code: open the file, click Select Kernel (top right) and pick .venv, then run the cells one by one (Shift+Enter).Or in the terminal: jupyter notebook and open the file in the browser. |
.py (script) | Go into its folder and run it, for example:cd 14-rag-tool-calling-basics/1_GIVE_FIRST_Starter_Codepython 1_tool_calling_from_scratch.py |
.py with a web page (Gradio) | Run it the same way, then open http://127.0.0.1:7860 in your browser. Press Ctrl+C in the terminal to stop it before starting the next app. |
Problems?
| You see | Fix |
|---|---|
'python' is not recognized | Reinstall Python with "Add Python to PATH" ticked, or use py instead of python on Windows. |
... cannot be loaded because running scripts is disabled (Windows PowerShell) | Run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned once, then activate again. Or use the Command Prompt instead of PowerShell. |
ModuleNotFoundError in a notebook, but check_setup passes | The notebook is using a different Python. Select the .venv kernel. |
OPENAI_API_KEY not found | The file must be named exactly .env (not .env.txt) and sit in the main folder. |
401 Incorrect API key / insufficient_quota | Check the key, or add credit to your OpenAI account. |
| Model downloads fail on office or college Wi-Fi | Some networks block model downloads. Try a mobile hotspot once; after that the models are saved on your laptop. |