Skip to content

Using Marqo Cloud

Exploring console.marqo.ai

Login

Login to your marqo cloud console account. To register for Marqo cloud, apply here.

Indexes

You'll be presented with a table of your indexes and on a separate section you can see your Marqo Endpoint Details.

Each Marqo Endpoint URL is unique.

Below is how the overview page looks:

Overview Page

To view graphs on Data size, Count of documents, Total search count, and Primary shards, select the Monitor tab for the index page.

Navigating to Index Monitor Page

API Keys

Your API Keys are used to access indexes through the marqo client.

  • Up to four API keys are allowed.

Here is an illustration on how to create an API key:

API Keys Page

Example

Say you created the API Key below:

secret key

Plug the Secret key and Marqo endpoint URL in to your code to connect to the marqo client.

pip install marqo
import marqo

marqo_endpoint_url = "https://qa33x63nv1.execute-api.us-east-1.amazonaws.com/prod"
api_key = "oCmxAvL7ht6hlmzRoTYwv4eqNsZunysK9EFgJZ0l"
mq = marqo.Client(url=marqo_endpoint_url, api_key=api_key)

mq.index("my-first-index").add_documents([
    {
        "Title": "The Travels of Marco Polo",
        "Description": "A 13th-century travelogue describing Polo's travels"
    },
    {
        "Title": "Extravehicular Mobility Unit (EMU)",
        "Description": "The EMU is a spacesuit that provides environmental protection, "
                       "mobility, life support, and communications for astronauts",
        "_id": "article_591"
    }],
    device="cuda"
)

results = mq.index("my-first-index").search(
    q="What is the best outfit to wear on the moon?"
)
  • Remember to specify device="cuda" on the cloud in order to take advantage of accelerated inference
  • mq is the client that wraps themarqo API
  • add_documents() takes a list of documents, represented as python dicts, for indexing
  • add_documents() creates an index with default settings, if one does not already exist
  • You can optionally set a document's ID with the special _id field. Otherwise, marqo will generate one.
  • If the index doesn't exist, Marqo will create it. If it exists then Marqo will add the documents to the index.