Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ajosh0504 committed Jul 11, 2024
1 parent 321bd9e commit 1dd2a4a
Show file tree
Hide file tree
Showing 73 changed files with 645 additions and 1,012 deletions.
14 changes: 0 additions & 14 deletions docs/10-intro.mdx

This file was deleted.

3 changes: 3 additions & 0 deletions docs/10-rag/1-what-is-rag.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 📘 What is RAG?

TO-DO
3 changes: 3 additions & 0 deletions docs/10-rag/2-rag-usecases.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 📘 RAG use cases

TO-DO
3 changes: 3 additions & 0 deletions docs/10-rag/3-components-of-rag.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 📘 Components of a RAG System

TO-DO
8 changes: 8 additions & 0 deletions docs/10-rag/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Retrieval Augmented Generation",
"position": 1,
"link": {
"type": "generated-index",
"description": "Learn the basics of Retrieval Augmented Generation a.k.a. RAG."
}
}
25 changes: 0 additions & 25 deletions docs/20-docusaurus.mdx

This file was deleted.

40 changes: 40 additions & 0 deletions docs/20-mongodb-atlas/1-create-account.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Link from "@site/src/components/Link";
import Screenshot from "@site/src/components/Screenshot";

# 👐 Create your account

In this lab, you will learn how to use MongoDB Atlas as a knowledge base as well as a memory provider for RAG applications.

To use MongoDB Atlas, you will need to start by creating an account. **If you already have an account, you can skip the following steps and move on to the next section.**

## Sign up for MongoDB Atlas

Start by going to the <Link to="http://mongodb.com/try">MongoDB website</Link> and creating your account.

:::tip
Creating a MongoDB Atlas account is free and does not require a credit card.
:::

You will be greeted by a form similar to the one below.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/20-mongodb-atlas/1-create-account/1-form.png" alt="Account creation form" />

:::info
If you are doing this lab at an event, you should use the same email address you used to register for the event.
:::

Complete the form and click the **Create Your Atlas Account** button.

## Verify your email address

You will receive an email from MongoDB asking you to verify your email address. Click the link in the email to verify your email address.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/20-mongodb-atlas/1-create-account/2-verify-email.png" alt="Verify your email address" />

:::caution
If you haven't received the email within two minutes, check your spam folder.
:::

## Finish the onboarding

You will be redirected to the MongoDB Atlas onboarding wizard. Fill in the form and click **Finish** to continue.
56 changes: 56 additions & 0 deletions docs/20-mongodb-atlas/2-create-cluster.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import Link from "@site/src/components/Link";
import Screenshot from "@site/src/components/Screenshot";

# 👐 Deploy a database cluster

Now that you have a MongoDB Atlas account, you can create your first cluster for free.

Once logged in, from the Overview page, click on the green button that says **+ Create**.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/20-mongodb-atlas/2-create-cluster/1-overview.png" alt="Overview screenshot" />

On the cluster creation page, choose the cloud provider and region where your data will be stored. You can also choose the type of cluster you want to create. For this lab, we will use the free tier.

1. For the cluster tier, pick **M0**, which is the free tier. In the **Name** input box, assign a name (one word, no spaces) to your cluster.
1. Uncheck the *Automate security setup* box. You will set up security manually in the next steps.
1. Uncheck the *Preload sample dataset* box. You will import a dataset later in this lab.
1. Select your favorite cloud provider and the region closest to you.
1. Finally, click on the green button that says **Create Deployment**.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/20-mongodb-atlas/2-create-cluster/2-deploy-database.png" alt="Create cluster screenshot" />

Once you're done with the hardest part of the process (the captcha), you will be redirected to the security quickstart.

## Security quickstart

By default, your MongoDB Atlas deployment is completely locked-down. You need to configure the network settings and create a user to access your database.

While your deployment is being provisioned, you will see the security quickstart dialog.

### Network access

First, you should **Allow Access from Anywhere**. You will see a field pre-populated with the IP address `0.0.0.0/0`. This means that you can connect to your database from any IP address including the virtual environment you will use for this lab. Click **Add IP Address** to add this IP address to the network allowlist.

:::caution
It is dangerous to expose your database to the entire world. Never do this is a real production environment.
:::

### Database user

Next, you need to create a database user. Pick any username and password you want. This will be used when you want to connect to your database. Click **Create Database User** to create the user.

Atlas might create the user automatically for you if you have just created your account. In this case, the username and password will match your Atlas account credentials.

:::tip
Make sure to remember your username and password. You will need them later. For the sake of this workshop, it might be preferable to use a simple password that you'll remember over a more secure one.
:::

## Manual network access configuration

If you don't see a button to **Allow Access from Anywhere**, you should close the dialog and go to the **Network Access** tab under the **Security** section in the left sidebar. Click on the **Add IP Address** button, add the IP address `0.0.0.0/0` and click **Confirm**.

## That's all!

That's all! You have a new database cluster. If everything goes well, you should see your newly created cluster on the **Database** tab under the **Deployment** section.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/20-mongodb-atlas/2-create-cluster/3-database-deployment.png" alt="Screenshot of the database deployment screen" />
30 changes: 30 additions & 0 deletions docs/20-mongodb-atlas/3-get-connection-string.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Link from "@site/src/components/Link";
import Screenshot from "@site/src/components/Screenshot";

# 👐 Get your connection string

In order to ingest data into your cluster later in the lab, you will need to get the connection string for your cluster.

In the Atlas UI, navigate to the **Overview** page. In the **Clusters section**, select the cluster you just created and click **Connect**.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/20-mongodb-atlas/3-get-conn-string/1-connect-button.png" alt="Screenshot of the connect button" />

A modal will display several ways to connect to your database.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/20-mongodb-atlas/3-get-conn-string/2-connect-modal.png" alt="Screenshot of the connect modal" />

Select **Compass**. While we won't be using Compass to import the data, it's an easy way to see your connection string.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/20-mongodb-atlas/3-get-conn-string/3-connect-compass.png" alt="Screenshot of the connection string" />

Look for your connection string. It should look something like:

```
mongodb+srv://<username>:<password>@<cluster-url>/
```

Click the copy button next to your connection string to copy it to your clipboard. Paste the connection string somewhere safe.

:::tip
Don't forget to replace `<password>` with the password you set when you created the cluster.
:::
8 changes: 8 additions & 0 deletions docs/20-mongodb-atlas/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "MongoDB Atlas",
"position": 2,
"link": {
"type": "generated-index",
"description": "Create a MongoDB Atlas account and deploy a free cluster."
}
}
15 changes: 15 additions & 0 deletions docs/30-fireworks-ai/1-create-account.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Screenshot from "@site/src/components/Screenshot";

# 👐 Create an account

In this lab, we will use the _Llama 3 8B Instruct_ model hosted by Fireworks AI. Fireworks gives you $1 credit upon sign up which is plenty to experiment with industry-leading models on their platform.

The easiest way to use the model is via the Fireworks API. But first, you will need to create a Fireworks account. **If you already have an account, you can skip the following steps and move on to the next section.**

Start by navigating to the [Fireworks AI homepage](https://fireworks.ai/) and click the purple **Get Started Free** button to create an account.

<Screenshot url="https://fireworks.ai/" src="img/screenshots/30-fireworks-ai/1-create-account/1-homepage.png" alt="Get started" />

Click **Login With Google** and authenticate with your Google account. This will provision a new Fireworks account and API Key for you.

<Screenshot url="https://fireworks.ai/" src="img/screenshots/30-fireworks-ai/1-create-account/2-google-login.png" alt="Login" />
19 changes: 19 additions & 0 deletions docs/30-fireworks-ai/2-create-api-key.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Screenshot from "@site/src/components/Screenshot";

# 👐 Create an API key

**If you just created a new account or want to use an existing API key, skip to the last step to copy the API key.**

If you already have a Fireworks account and want to create a new API key, follow the steps below.

Upon logging in, click the **API Keys** tab.

<Screenshot url="https://fireworks.ai/" src="img/screenshots/30-fireworks-ai/2-create-api-key/1-api-key.png" alt="Select API keys" />

Click the purple **Create API Key** button. In the modal that appears, enter a name and click **Create Key** to create an API key.

<Screenshot url="https://fireworks.ai/" src="img/screenshots/30-fireworks-ai/2-create-api-key/2-create-api-key.png" alt="Create API key" />

Click the copy button next to your API key to copy it to your clipboard. Paste the API key somewhere safe.

<Screenshot url="https://fireworks.ai/" src="img/screenshots/30-fireworks-ai/2-create-api-key/3-copy-api-key.png" alt="Copy API key" />
8 changes: 8 additions & 0 deletions docs/30-fireworks-ai/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Fireworks AI",
"position": 3,
"link": {
"type": "generated-index",
"description": "Create a Fireworks AI account and API key."
}
}
45 changes: 0 additions & 45 deletions docs/30-quick-start.mdx

This file was deleted.

51 changes: 51 additions & 0 deletions docs/40-dev-env/1-dev-setup.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Screenshot from "@site/src/components/Screenshot";

# 👐 Setup dev environment

You will be working in a Jupyter Notebook throughout this lab. The easiest and recommended way to run the lab notebook is using Google Colab.

Navigate to the notebook on [GitHub](https://github.com/mongodb-developer/ai-rag-lab-notebooks/blob/main/notebook_template.ipynb) and click the **Open in Colab** badge at the top of the notebook to open it in Google Colab.

<Screenshot url="https://github.com/mongodb-developer/ai-rag-lab-notebooks" src="img/screenshots/40-dev-env/1-open-colab.png" alt="Open in Colab" />

:::tip
The notebook will open in Google Colab in read-only mode. Please **make a copy of the notebook** to keep the code changes you will make during this workshop for future reference.

To do this, choose one of the **Save a copy** options in the **File** menu.
:::

That's it! You're ready for the lab!

## Local setup

If you want to run the notebook locally, follow the steps below:

* Clone the [GitHub repo](https://github.com/mongodb-developer/ai-rag-lab-notebooks.git) for this lab by executing the following command from the terminal:

```
git clone https://github.com/mongodb-developer/ai-rag-lab-notebooks.git
```

* `cd` into the cloned directory:

```
cd ai-rag-lab-notebooks
```

* Create and activate a Python virtual environment:

```
python -m venv mongodb-ai-rag-lab
source mongodb-ai-rag-lab/bin/activate
```

* Install and launch Jupyter Notebook:

```
pip install notebook
jupyter notebook
```

* In the browser tab that pops up, open the notebook named `notebook_template.ipynb`.

<Screenshot url="localhost:8888/tree" src="img/screenshots/40-dev-env/2-jupyter-notebook.png" alt="Jupyter Notebook" />
3 changes: 3 additions & 0 deletions docs/40-dev-env/2-setup-pre-reqs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 👐 Setup prerequisites

Fill in any `<CODE_BLOCK_N>` placeholders and run the cells under the **Step 1: Install libraries** and **Step 2: Setup prerequisites** sections in the notebook.
8 changes: 8 additions & 0 deletions docs/40-dev-env/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Dev Environment",
"position": 4,
"link": {
"type": "generated-index",
"description": "Set up the Python development environment for this lab."
}
}
Loading

0 comments on commit 1dd2a4a

Please sign in to comment.