You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/20-dev-env/1-dev-env-setup.mdx
+33-10Lines changed: 33 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ import Screenshot from "@site/src/components/Screenshot";
7
7
8
8
Navigate to [this](https://github.com/codespaces/new/mongodb-developer/genai-devday-notebooks?quickstart=1) link. Click the **Resume this codespace** button to resume the code space you created previously.
Give the codespace a few seconds to restart. When files appear under the Explorer, click the file named `ai-rag-lab.ipynb`. This is the Jupyter Notebook you will be using throughout this lab.
13
13
14
-
<Screenshoturl="https://github.com/codespaces"src="img/screenshots/30-dev-env/1-dev-env-setup/3-nav-notebook.png"alt="Navigate to the notebook" />
14
+
<Screenshoturl="https://github.com/codespaces"src="img/screenshots/20-dev-env/1-dev-env-setup/2-nav-notebook.png"alt="Navigate to the notebook" />
15
15
</details>
16
16
17
17
:::tip
@@ -24,33 +24,56 @@ You will be working in a Jupyter Notebook in a GitHub Codespace throughout this
24
24
25
25
Navigate to [this](https://github.com/codespaces/new/mongodb-developer/genai-devday-notebooks?quickstart=1) link. You will be prompted to sign into GitHub if you haven't already. Once signed in, click the **Create new codespace** button to create a new codespace.
26
26
27
-
<Screenshoturl="https://github.com/codespaces"src="img/screenshots/30-dev-env/1-dev-env-setup/2-create-codespace.png"alt="Start a codespace" />
27
+
<Screenshoturl="https://github.com/codespaces"src="img/screenshots/20-dev-env/1-dev-env-setup/3-create-codespace.png"alt="Start a codespace" />
28
28
29
-
Let it run for a few seconds as it prepares your environment. It will clone the repository, prepare the container, and run the installation scripts. Once the environment is built, you should see a list of files appear under the Explorer.
29
+
Let it run for a few seconds as it prepares a Docker container with all the required libraries and a MongoDB cluster.
30
+
31
+
Once the environment is built, you should see a VS Code IDE with a list of files under the Explorer tab.
30
32
31
33
In the left navigation bar of the IDE, click on the file named `ai-rag-lab.ipynb` to open the Jupyter Notebook for this lab.
32
34
33
-
<Screenshoturl="https://github.com/codespaces"src="img/screenshots/30-dev-env/1-dev-env-setup/3-nav-notebook.png"alt="Navigate to the notebook" />
35
+
<Screenshoturl="https://github.com/codespaces"src="img/screenshots/20-dev-env/1-dev-env-setup/2-nav-notebook.png"alt="Navigate to the notebook" />
34
36
35
37
Next, select the Python interpreter by clicking **Select Kernel** at the top right of the IDE.
If the connection was successful, you should see the cluster and its default databases under Connections. Any additional databases and collections created during the lab will appear here as well.
During the lab, we will use GitHub Codespaces. These instructions are here just in case you can't use Codespaces or if you really, really, really want a local installation.
51
74
:::
52
75
53
-
If you want to run the notebook locally, follow the steps below:
76
+
To run the lab locally, follow the steps below:
54
77
55
78
* Clone the [GitHub repo](https://github.com/mongodb-developer/genai-devday-notebooks.git) for this lab by executing the following command from the terminal:
56
79
@@ -86,4 +109,4 @@ jupyter notebook
86
109
87
110
* In the browser tab that pops up, open the file named `ai-rag-lab.ipynb`.
The final step to build a MongoDB vector store for the chatbot is to ingest the embedded article chunks into MongoDB.
6
+
7
+
Fill in any `<CODE_BLOCK_N>` placeholders and run the cells under the **Step 5: Ingest data into MongoDB** section in the notebook to ingest the embedded documents into MongoDB.
8
+
9
+
The answers for code blocks in this section are as follows:
10
+
11
+
**CODE_BLOCK_5**
12
+
13
+
<details>
14
+
<summary>Answer</summary>
15
+
<div>
16
+
```python
17
+
collection.insert_many(embedded_docs)
18
+
```
19
+
</div>
20
+
</details>
21
+
22
+
<details>
23
+
<summary>🦹 Visually verify that the data has been imported into the local MongoDB cluster </summary>
24
+
25
+
Click the leaf icon in the left navigation bar of the IDE.
26
+
27
+
Ensure that you see a database called _mongodb_genai_devday_rag_, and a collection named _knowledge_base_ under it.
To retrieve documents from MongoDB using vector search, you must configure a vector search index on the collection into which you ingested your data. In this lab, you will programmatically create vector search indexes using MongoDB's Python driver.
4
+
5
+
Fill in any `<CODE_BLOCK_N>` placeholders and run the cells under the **Step 6: Create a vector search index** section in the notebook to create a vector search index.
6
+
7
+
The answers for code blocks in this section are as follows:
0 commit comments