Skip to content

Commit

Permalink
Adding more details and sections
Browse files Browse the repository at this point in the history
  • Loading branch information
ajosh0504 committed Nov 18, 2024
1 parent e8b84ab commit 8c803c3
Show file tree
Hide file tree
Showing 29 changed files with 102 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @ajosh0504
22 changes: 22 additions & 0 deletions docs/20-mongodb-atlas/1-create-account.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ In this lab, you will learn how to use MongoDB Atlas as a knowledge base as well

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.**

<details>
<summary>🦹 If you already have an Atlas account, you can use it by creating a new project</summary>

First, log into <Link to="https://account.mongodb.com/">MongoDB Atlas</Link> using your existing credentials.

<Screenshot url="https://account.mongodb.com" src={"img/screenshots/20-mongodb-atlas/1-create-account/3-login.png"} alt="Login form" />

## Create a new Atlas project

Once you're in Atlas, open the dropdown on the left-top corner of the page and select **New Project**.

<Screenshot url="https://cloud.mongodb.com" src={"img/screenshots/20-mongodb-atlas/1-create-account/4-new-project.png"} alt="Create new project" />

Enter a name for your project and click **Next**.

<Screenshot url="https://cloud.mongodb.com" src={"img/screenshots/20-mongodb-atlas/1-create-account/5-new-project-name.png"} alt="Create new project" />

On the next page, you can leave the current user as the project owner, and click **Create Project**.

Once the project is ready, continue the workshop from <a href="./create-cluster">**deploying a Database Cluster**</a>
</details>

## Sign up for MongoDB Atlas

Start by going to the <Link to="http://mongodb.com/try">MongoDB website</Link> and creating your account.
Expand Down
12 changes: 3 additions & 9 deletions docs/20-mongodb-atlas/3-get-connection-string.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@ In the Atlas UI, navigate to the **Overview** page. In the **Clusters section**,

<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.
A modal will display several ways to connect to your database. Select **Drivers**.

<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.
Look for your connection string. It should look something like `mongodb+srv://<username>:<password>@<cluster-url>/`

<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>/
```
<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/20-mongodb-atlas/3-get-conn-string/3-connect-drivers.png" alt="Screenshot of the connection string" />

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

Expand Down
2 changes: 1 addition & 1 deletion docs/30-fireworks-ai/1-create-account.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Start by navigating to the [Fireworks AI homepage](https://fireworks.ai/) and cl

<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.
Click **Login With Google** and authenticate with your Google account.

<Screenshot url="https://fireworks.ai/" src="img/screenshots/30-fireworks-ai/1-create-account/2-google-login.png" alt="Login" />
13 changes: 13 additions & 0 deletions docs/50-agent-tools/1-concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

Here is a quick overview of concepts that you will come across in this section of the lab:

## About the data

In this lab, we are using a serverless AWS Lambda function to import the data required by the agent's tools, into MongoDB. If you want to do this on your own, these datasets are available on Hugging Face:

* [devcenter-articles](https://huggingface.co/datasets/MongoDB/devcenter-articles): Markdown versions of 20 articles from our Developer Center. This dataset is imported into a collection called `full_articles`.

* [devcenter-articles-embedded](https://huggingface.co/datasets/MongoDB/devcenter-articles-embedded): Chunked and embedded versions of the articles in the `devcenter-articles` dataset. This dataset is imported into a collection called `chunked_articles`.

To learn more about chunking and embedding, here are some resources from our Developer Center:

* [How to Choose the Right Chunking Strategy for Your LLM Application](https://www.mongodb.com/developer/products/atlas/choosing-chunking-strategy-rag/?utm_campaign=devrel&utm_medium=ai-agents-devday-workshop&utm_term=apoorva.joshi)
* [How to Choose the Best Embedding Model for Your LLM Application](https://www.mongodb.com/developer/products/atlas/choose-embedding-model-rag/?utm_campaign=devrel&utm_medium=ai-agents-devday-workshop&utm_term=apoorva.joshi)

## Tool calling

Tool calling, interchangeably called function calling allows an LLM to use external tools such as APIs, databases, specialized machine learning models etc.
Expand Down
7 changes: 0 additions & 7 deletions docs/50-agent-tools/2-import-data.mdx

This file was deleted.

31 changes: 31 additions & 0 deletions docs/50-agent-tools/2-jupyter-notebooks.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 📘 Running Jupyter Notebooks in Google Colab

Jupyter Notebooks is an interactive Python environment. Cells in a Jupyter notebook are a modular unit of code or text that you can execute and view outputs for.

In this lab, we will use Colaboratory (a.k.a Colab) which is a hosted Jupyter Notebook service from Google.

To run a cell in Colab, hover over it and click the Run icon that appears against the cell.

<Screenshot url="https://us-west-2.console.aws.amazon.com/sagemaker/jupyter" src="img/screenshots/50-agent-tools/2-jupyter-notebooks/1-run-cell.png" alt="Run a cell" />

When a cell is running, you will see a loading spinner appear against the cell.

<Screenshot url="https://us-west-2.console.aws.amazon.com/sagemaker/jupyter" src="img/screenshots/50-agent-tools/2-jupyter-notebooks/2-running-cell.png" alt="A running cell" />

When a cell is finished running successfully, you will see green check mark appear against the cell.

<Screenshot url="https://us-west-2.console.aws.amazon.com/sagemaker/jupyter" src="img/screenshots/50-agent-tools/2-jupyter-notebooks/3-successful-cell.png" alt="Successful cell run" />

If an error occurred while running a cell, you will see an error traceback after the cell.

<Screenshot url="https://us-west-2.console.aws.amazon.com/sagemaker/jupyter" src="img/screenshots/50-agent-tools/2-jupyter-notebooks/4-error-in-cell.png" alt="Erroneous cell run" />

To fix errors, you may need to update previous cells. If you do, re-run all the cells following the one(s) you updated.

To interrupt a running cell, click the Stop icon that you see against the cell while it is running.

<Screenshot url="https://us-west-2.console.aws.amazon.com/sagemaker/jupyter" src="img/screenshots/50-agent-tools/2-jupyter-notebooks/5-interrupt-cell.png" alt="Interrupt cell run" />

:::warning
The UI might differ slightly if you are running Jupyter Notebooks outside of Google Colab. Refer to the appropriate documentation if running the notebook using a different service.
:::
17 changes: 17 additions & 0 deletions docs/50-agent-tools/3-import-data.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 👐 Import data

The MongoDB learning assistant has two tools- a vector search tool to retrieve information to answer questions about MongoDB, and another tool to get the content of articles in our Developer Center for summarization.

Let's import the data required by these tools into two MongoDB collections. This is as simple as making a `GET` request to a serverless function that we have created for you.

Run the cells under the **Step 3: Import data** section in the notebook to import the data required by our agent's tools, into MongoDB collections.

To verify that the data has been imported into your MongoDB cluster, navigate to the **Overview** page in the Atlas UI. In the **Clusters section**, select the cluster you just created and click **Browse collections**.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/50-agent-tools/3-import-data/1-browse-collections.png" alt="Browse collections" />

Ensure that you see a database called _mongodb_agents_lab_, and two collections namely _chunked_articles_ and _full_articles_ under it. Note the number and format of documents in both the collections.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/50-agent-tools/3-import-data/2-chunked-collection.png" alt="Chunked collection" />

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/50-agent-tools/3-import-data/3-full-collection.png" alt="Full collection" />
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ mongodb_client[DB_NAME][VS_COLLECTION_NAME]
vs_collection.create_search_index(model=model)
```
</div>
</details>
</details>

To verify that the index was created, navigate to **Search Indexes** for the _chunked_articles_ collection.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/50-agent-tools/4-create-vector-search-index/1-nav-search-indexes.png" alt="Navigate to search indexes" />

The index is ready to use once the status changes from **PENDING** to **READY**.

<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/50-agent-tools/4-create-vector-search-index/2-index-ready.png" alt="Index ready to use" />
2 changes: 1 addition & 1 deletion docs/70-adding-memory/2-adding-memory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The answers for code blocks in this section are as follows:
<summary>Answer</summary>
<div>
```python
config = {"configurable": {"thread_id": thread_id}}
{"configurable": {"thread_id": thread_id}}
```
</div>
</details>
4 changes: 0 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ const config = {
favicon: `${favicon}`,
deploymentBranch: "gh-pages",
staticDirectories: ["static"],
i18n: {
defaultLocale: "en",
locales: ["en"],
},
customFields: {
startButtonTitle: `${startButtonTitle}`,
featureList: featureList,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8c803c3

Please sign in to comment.