This document provides clear steps on how to use and integrate MongoDB with Superlinked.
Project Data Access Admin
role is required. More about how to create that can be found below.
Note: When using that API, you will needproject_id
andcluster_name
, how to find this information is also described below.
MongoDBVectorDatabase
class and include it in the executor. Here’s how you can do it:
Project ID: to find your Project ID, select you organization in the top left corner of Atlas UI. Afterward, find your project (don’t click on it). In the last column (“Actions”) expend the menu by clicking on the ellipses (…), then select “Copy Project ID” which will paste it to your clipboard.Alternatively, click on your project on Atlas and in the URL you will find the id:
https://cloud.mongodb.com/v2/12755aca606daa697d3e30b9#/overview
where the 12755aca606daa697d3e30b9
before the #
and after the https://cloud.mongodb.com/v2/
is your project ID. The organization ID is very similar to this string, but please make sure that you copy the ID after you selected the project!
Extra parameters: extra params can be passed in to the PyMongo client called MongoClient. Please read the documentation for more information.Once you have configured the
MongoDBVectorDatabase
, set it as your vector_database
in the RestExecutor
:
Set up MongoDB Atlas account and create cluster
Create database and collection
Database
option in the left menu column. Once the cluster is created, click on its name and then go to the collections tab or click on the Browse Collections
button.Click on Add My Own Data
and provide a name for your database and collection. The database name will be required for the configuration above.Configure database access
Database
option on the left. Click the Connect
button next to your cluster’s name.In the pop-up window:Allow access from Anywhere
or select the Add a different IP address
and insert your VM’s or
local IP address.Create API key for Superlinked
Access Manager
selector at the top left corner next to your organization selector and select your project.Go to the API Keys
tab.Provide a name for the API key and select the Project Data Access Admin
role in the Project Permissions
selector.Private Key
as it will not be accessible again. The Public key
and Private key
will be your admin_api_user
and admin_api_password
in your connection in this order.