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/10-mongodb-atlas/2-create-cluster.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,6 @@ If you don't see a button to **Allow Access from Anywhere**, you should close th
55
55
56
56
## That's all!
57
57
58
-
That's all! You have a new database cluster. If everything goes well, you should see your newly created cluster in the database deployment screen.
58
+
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.
59
59
60
60
<Screenshoturl="https://cloud.mongodb.com"src="img/screenshots/10-mongodb-atlas/2-create-cluster/3-database-deployment.png"alt="Screenshot of the database deployment screen" />
Copy file name to clipboardExpand all lines: docs/10-mongodb-atlas/3-get-connection-string.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ import Screenshot from "@site/src/components/Screenshot";
5
5
6
6
In order to ingest data into your cluster later in the lab, you will need to get the connection string for your cluster.
7
7
8
-
In the Atlas UI, navigate to the **Overview** page. In the **Clusters section**, selct the tab for the cluster you just created and click **Connect**.
8
+
In the Atlas UI, navigate to the **Overview** page. In the **Clusters section**, select the cluster you just created and click **Connect**.
9
9
10
10
<Screenshoturl="https://cloud.mongodb.com"src="img/screenshots/10-mongodb-atlas/3-get-conn-string/1-connect-button.png"alt="Screenshot of the connect button" />
Copy file name to clipboardExpand all lines: docs/20-fireworks-ai/1-create-account.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ import Screenshot from "@site/src/components/Screenshot";
2
2
3
3
# 👐 Create an account
4
4
5
-
In this lab, we will be using_FireFunction V1_, a free and open-source function calling model from Fireworks AI.
5
+
In this lab, we will use_FireFunction V1_, a free and open-source function calling model from Fireworks AI.
6
6
7
7
The easiest way to use this model is via the Fireworks API. But first, you will need to create a Fireworks account. **If you already have an account, you can move on to the next section.**
* Clone the [GitHub repo](https://github.com/mongodb-developer/ai-agents-lab-notebooks.git) for this lab by executing the following command from the terminal:
6
6
@@ -30,12 +30,4 @@ jupyter notebook
30
30
31
31
* In the browser tab that pops up, open the notebook named `notebook_template.ipynb`. This is the notebook you will be working in for this lab.
* Under `Step 2: Setup Pre-requisites`, replace `<CODE_BLOCK_1>` with the MongoDB connection string, `<CODE_BLOCK_2>` with the Fireworks API key and run the cells.
Copy file name to clipboardExpand all lines: docs/40-agent-tools/1-knowledge-base.mdx
+7-23
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,12 @@
1
1
# 👐 Create the agent's knowledge base
2
2
3
-
One of the tools that the AI research agent has access to is a question-answering tool for the agent to answer questions based on information in its knowledge base. But first, we need to create the knowledge base.
3
+
One of the tools that the AI research agent has access to is a question-answering tool that retrieves information from a knowledge base (MongoDB collection) and uses it to answer questions. But first, we need to create the knowledge base.
4
4
5
-
## Download the dataset from Hugging Face
5
+
Fill in any `<CODE_BLOCK>`s and run the cells under the **Step 3: Create a knowledge base** section in the notebook to download a dataset of Arxiv papers from [Hugging Face](https://huggingface.co/datasets/mongodb-eai/arxiv-embeddings) and ingest it into a MongoDB collection which will serve as our agent's knowledge base.
6
6
7
-
We will use a dataset consisting of a subset of Arxiv papers, to build our knowledge base. The data is available on [Hugging Face](https://huggingface.co/datasets/mongodb-eai/arxiv-embeddings).
7
+
The answers for code blocks in this section are as follows:
8
8
9
-
👐 Run the first **TWO** cells under "Step 3: Ingest Data into MongoDB Atlas" to download the dataset from Hugging Face and preview it.
10
-
11
-
Notice that the dataset already has an `embedding` column, which consists of embeddings of the paper abstracts.
12
-
13
-
## Ingest data into MongoDB Atlas
14
-
15
-
Let's use the **PyMongo** Python library to ingest data into MongoDB Atlas. Fill in `<CODE_BLOCK_3>` to `<CODE_BLOCK_6>` and run the cells containing these code blocks.
16
-
17
-
👐 **CODE_BLOCK_3**: Initialize a MongoDB Python client
Click **JSON Editor** under Atlas Vector Search to create your index
14
+
15
+
<Screenshoturl="https://cloud.mongodb.com"src="img/screenshots/40-agent-tools/3-json-editor.png"alt="The 'Create Index' page with the 'JSON Editor' tab highlighted" />
16
+
17
+
18
+
Select the `mongodb_agents_lab` database and the `knowledge` collection, change the index name to `vector_index`, and add the following index definition in the JSON editor:
19
+
20
+
```python
21
+
{
22
+
"fields": [
23
+
{
24
+
"type": "vector",
25
+
"path": "embedding",
26
+
"numDimensions": 1024,
27
+
"similarity": "cosine"
28
+
}
29
+
]
30
+
}
31
+
```
32
+
33
+
:::info
34
+
The number of dimensions in the index definition is 1024 since the Arxiv dataset we used to create the knowledge base uses Mixedbread AI's open-source [mxbai-embed-large-v1](https://huggingface.co/mixedbread-ai/mxbai-embed-large-v1) model for embeddings.
Let's instantiate the chat completion LLM to use as the "brain" of our agent and for any of the tools if required.
4
+
5
+
We will use Fireworks AI's free AND open-source _firefunction-v1_ model via the _ChatFireworks_ API in LangChain.
6
+
7
+
Fill in any `<CODE_BLOCK>`s and run the cells under the **Step 5: Instantiate chat completion LLM** section in the notebook to create an instance of _ChatFireworks_ with the _firefunction-v1_ model.
8
+
9
+
The answers for code blocks in this section are as follows:
0 commit comments