GeorgiosIoannouCoder commited on
Commit
3c34409
1 Parent(s): 77cd2ef

Update mongodb_atlas_vector_search_setup.md

Browse files
Files changed (1) hide show
  1. mongodb_atlas_vector_search_setup.md +78 -72
mongodb_atlas_vector_search_setup.md CHANGED
@@ -1,73 +1,79 @@
1
- # Author : Georgios Ioannou
2
- #
3
- # Copyright © 2024 by Georgios Ioannou
4
-
5
- # Setting Up MongoDB with Atlas Vector Search
6
-
7
- ## Initial Setup
8
- 1. Create and log in to your MongoDB account at [mongodb.com](https://mongodb.com)
9
-
10
- 2. Create Organization and Project
11
- - Create a new MongoDB organization
12
- - Name your organization as desired
13
- - Create a new MongoDB project
14
- - Name your project as desired
15
-
16
- 3. Create Cluster
17
- - Select M0 (FREE) tier
18
- - Wait 1-3 minutes for cluster creation
19
-
20
- ## Security Setup
21
- 4. Create Database User
22
- - Create username and password
23
- - **Important**: Save these credentials securely
24
-
25
- 5. Configure Network Access
26
- - Navigate on the left menu to Security -> Network Access
27
- - Add IP Address: `0.0.0.0/0` (Allows access from anywhere)
28
-
29
- ## Database Creation
30
- 6. Set Up Database and Collection
31
- - Click "Browse Collections"
32
- - Click "Add My Own Data"
33
- - Create database (e.g., "txts")
34
- - Create collection (e.g., "txts_collection")
35
- - Click "Create"
36
-
37
- ## Vector Search Configuration
38
- 7. Create Vector Search Index
39
- - Click "Search Indexes" (This will bring you to "Atlas Search" tab)
40
- - Click "Create Search Index"
41
- - Select "JSON Editor" under "Atlas Vector Search"
42
- - Click "Next"
43
- - Configure index settings:
44
- ```json
45
- {
46
- "name": "vector_index", // Adjust it to your desired name.
47
- "type": "vector",
48
- "path": "embedding", // Adjust it to your index/embedding column.
49
- "numDimensions": 384, // Adjust based on your model. (e.g., 384 for all-MiniLM-l6-v2)
50
- "similarity": "euclidean" // Adjust it to your desired similarity function.
51
- }
52
- ```
53
- - Optional: Add filter fields if needed:
54
- ```json
55
- {
56
- "type": "filter",
57
- "path": "source" // Adjust it to the column you would like to filter with.
58
- }
59
- ```
60
- - Assign your index to the collection name created in step 6 using the drop down menu on the left.
61
- - Click "Next"
62
- - Click "Create Search Index"
63
- - Wait for status to change from "Pending" to "Active"
64
-
65
- **Note**: While vector search index creation can be done programmatically, the GUI method described above is recommended for simplicity.
66
-
67
- ## Connection String
68
- 8. Get Your MongoDB URI
69
- - Click "Clusters" under DATABASE on the left menu
70
- - Click "Connect" next to name of your cluster
71
- - Select "Drivers"
72
- - Copy the connection/MongoURI string at the very end of the modal that just opened
 
 
 
 
 
 
73
  - Replace `<password>` with your database user password
 
1
+ # Author : Georgios Ioannou
2
+ #
3
+ # Copyright © 2024 by Georgios Ioannou
4
+
5
+ # Setting Up MongoDB with Atlas Vector Search
6
+
7
+ ## Initial Setup
8
+ 1. Create and log in to your MongoDB account at [mongodb.com](https://mongodb.com)
9
+
10
+ 2. Create Organization and Project
11
+ - Note that
12
+ - Create a new MongoDB organization
13
+ - Name your organization as desired
14
+ - Create a new MongoDB project
15
+ - Name your project as desired
16
+
17
+ 3. Create Cluster
18
+ - Select M0 (FREE) tier
19
+ - Make sure to uncheck "Preload sample dataset"
20
+ - Keep everything else default.
21
+ - Wait 1-3 minutes for cluster creation
22
+
23
+ ## Security Setup
24
+ 4. Create Database User
25
+ - Create username and password
26
+ - Then, click on continue.
27
+ - Then, just close no need to choose a connection method.
28
+ - **Important**: Save these credentials securely
29
+
30
+ 5. Configure Network Access
31
+ - Navigate on the left menu to Security -> Network Access
32
+ - Add IP Address: `0.0.0.0/0` (Allows access from anywhere)
33
+
34
+ ## Database Creation
35
+ 6. Set Up Database and Collection
36
+ - Click "Clusters" on the left under "Database".
37
+ - Click "Browse Collections"
38
+ - Click "Add My Own Data"
39
+ - Create database (e.g., "txts")
40
+ - Create collection (e.g., "txts_collection")
41
+ - Click "Create"
42
+
43
+ ## Vector Search Configuration
44
+ 7. Create Vector Search Index
45
+ - Click "Search Indexes" (This will bring you to "Atlas Search" tab)
46
+ - Click "Create Search Index"
47
+ - Select "JSON Editor" under "Atlas Vector Search"
48
+ - Click "Next"
49
+ - Configure index settings:
50
+ ```json
51
+ {
52
+ "name": "vector_index", // Adjust it to your desired name.
53
+ "type": "vector",
54
+ "path": "embedding", // Adjust it to your index/embedding column.
55
+ "numDimensions": 384, // Adjust based on your model. (e.g., 384 for all-MiniLM-l6-v2)
56
+ "similarity": "euclidean" // Adjust it to your desired similarity function.
57
+ }
58
+ ```
59
+ - Optional: Add filter fields if needed:
60
+ ```json
61
+ {
62
+ "type": "filter",
63
+ "path": "source" // Adjust it to the column you would like to filter with.
64
+ }
65
+ ```
66
+ - Assign your index to the collection name created in step 6 using the drop down menu on the left.
67
+ - Click "Next"
68
+ - Click "Create Search Index"
69
+ - Wait for status to change from "Pending" to "Active"
70
+
71
+ **Note**: While vector search index creation can be done programmatically, the GUI method described above is recommended for simplicity.
72
+
73
+ ## Connection String
74
+ 8. Get Your MongoDB URI
75
+ - Click "Clusters" under DATABASE on the left menu
76
+ - Click "Connect" next to name of your cluster
77
+ - Select "Drivers"
78
+ - Copy the connection/MongoURI string at the very end of the modal that just opened
79
  - Replace `<password>` with your database user password