Skip to main content

How it works

The R2 connector pulls in all documents from the specified Cloudflare R2 bucket. It supports various file formats including PDF, DOC, DOCX, TXT, and more. Documents are updated every 1 day.

Setting up

Setup runs through four steps, shown in the left rail of the connector page: Credential, Connector, Space, and Advanced.

Authorization

Before configuring the connector in UtopikAI, create an R2 API token in your Cloudflare dashboard:
  1. Log into your Cloudflare dashboard.
  2. Navigate to R2 in the sidebar.
  3. Click Manage R2 API Tokens.
  4. Click Create API token.
  5. Give your token a name (for example UtopikAIR2Connector) and select Object Read only permissions.
  6. Click Create API Token.
  7. Copy the Access Key ID and Secret Access Key immediately — you cannot view the secret again after leaving this screen.
  8. Find your Account ID on the Cloudflare dashboard Overview page. It appears in the URL as the final path segment, or in the account details sidebar.
You need these three values when creating an R2 credential in UtopikAI: Account ID, Access Key ID, and Secret Access Key.

Add the connector

  1. Open AdminConnectorsAdd Connector.
  2. Under Storage, select R2.
  3. Create or select an R2 credential (see below).
  4. Configure the bucket to index.
  5. Complete the remaining steps and save the connector to start indexing.

Step 1: Select Credential

  1. Open Admin from the profile menu, then go to ConnectorsAdd Connector.
  2. Under Storage, select R2.
  3. In Step 1, select an existing credential from the list, or click Create New to add one.
Step 1: Select Credential Existing credentials are listed with their ID, Name, Created date, and Last Updated date. If no credential has been set up yet, the list shows No credentials found.
Ensure the credential you select has the proper permissions for this connector. A credential without read access to the bucket you want to index will not be able to pull documents.
Click Continue after selecting a credential.

Create a credential

If you do not have an R2 credential yet, click Create New to open the credential dialog:
  1. Optionally enter a Name to label the credential (for example Production R2).
  2. Enter your R2 Account ID, R2 Access Key ID, and R2 Secret Access Key from the Cloudflare authorization steps above.
  3. Click Create.
Create R2 credential Once the credential is created, select it from the list and click Continue.

Step 2: Configure the connector

  1. Enter a Connector Name — a descriptive name for this connector.
  2. Specify the R2 bucket you want to make searchable.
  3. Click Continue.

Step 3: Select a space

Choose the space to index the documents into. This controls which space the connector’s indexed content belongs to. Use the search field to filter the list if you have many spaces, then click Continue.

Step 4: Advanced Configuration

The final step controls how often UtopikAI syncs with your R2 bucket and how far back it indexes. The defaults work for most setups. Entering 0 or leaving Refresh Frequency blank means UtopikAI will never pull new documents for this connector. Entering 0 or leaving Prune Frequency blank disables pruning for this connector. When you are done, click Create Connector to save the connector and begin indexing. You can return to any earlier step using the Previous button or the step list in the left rail.

Understanding R2 Structure

Cloudflare R2 organizes data into buckets, similar to Amazon S3. Each bucket can contain an unlimited number of objects (files). You can think of a bucket as a root directory, and the objects as files within that directory. For more information on R2 structure, visit the Cloudflare R2 documentation.