# AI Agents Course from Towards AI and Decoding ML

This repository contains all the code exercises and project materials for the **AI Agents** course, created by **Towards AI** and **Decoding ML**. This course is designed for developers who want to move beyond basic LLM tutorials and build production-grade AI agents and workflows. It provides a hands-on, project-based approach to learning agentic architecture patterns, modern frameworks like LangGraph, and essential production skills like LLMOps, evaluation, and deployment.

### Repository Structure

The repository is organized to help you easily find and follow along with the course materials.

  - **`lessons/`**: This directory contains all the code notebooks (`.ipynb` files) for the course lessons. Each lesson has its own folder (e.g., `01_ai_agents_landscape/`).
  - **`utils/`**: Helper scripts and utility functions used in the notebooks.
  - **`.env.example`**: A template file for your environment variables.
  - **`pyproject.toml`**: The main configuration file for project dependencies.
  - **`uv.lock`**: A lock file generated by `uv` to ensure a reproducible environment.

### Getting Started: Running the Notebooks

To run the course notebooks, you'll need to set up your local environment. Follow these steps to get everything installed and configured.

#### 1\. Install Git and `uv`

First, make sure you have **Git** and the **`uv`** package manager installed.

  - [**Git**](https://git-scm.com/): This is used to clone the repository.
  - [**`uv`**](https://github.com/astral-sh/uv): A modern, high-speed Python package manager that will handle all dependencies for this project.

#### 2\. Clone the Repository

Use the following command to clone the course repository. It uses a fine-grained GitHub token to provide read-only access to the exercises.

```bash
GITHUB_TOKEN="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" && git clone https://oauth2:${GITHUB_TOKEN}@github.com/towardsai/course-ai-agents.git
```

#### 3\. Set Up the Virtual Environment

Navigate into the cloned repository's root directory and run `uv sync`. This will create a virtual environment (`.venv` folder) and install all the necessary packages defined in the `pyproject.toml` file.

```bash
cd course-ai-agents
uv sync
```

#### 4\. Configure Your API Key

The course notebooks use Google's Gemini models. To use them, you'll need to get a free API key from Google AI Studio.

1.  Copy the example environment file: `cp .env.example .env`
2.  Open the new `.env` file and replace the placeholder text with your actual `GOOGLE_API_KEY`.

#### 5\. Launch Jupyter Notebooks

Now you can launch the notebooks. You have two options:

  - **Web Browser:** Run the following commands in your terminal to create a Jupyter kernel and launch the user interface in your browser:

    ```bash
    uv run ipython kernel install --user --name="ai-agents-course"
    uv run jupyter notebook
    ```

    Once open, navigate to the `lessons` directory and select the `ai-agents-course` kernel.

  - **VS Code:** Install the [official Jupyter extension](https://code.visualstudio.com/docs/datascience/jupyter-notebooks). Open the course folder in VS Code, and when you open a notebook, select the Python environment from `.venv/bin/python` to run the code.