# Knowledge Base: Confluence (Basic Authentication)

### **Overview**

MangoApps AI Studio allows you to connect external knowledge sources to enhance the intelligence and accuracy of your AI assistants. One such integration is with **Confluence**, Atlassian’s popular knowledge management platform. This guide walks you through how to configure Confluence (using Basic Authentication) as an external knowledge base so your AI assistants can access and utilize your organization’s existing documentation.

***

### What You Will Need

Before starting the setup, make sure you have the necessary credentials and tools available. This ensures a smooth configuration without interruptions.

To set up Confluence as a knowledge base, you’ll need the following:

* Your Atlassian login credentials
* A Confluence API token

***

### **Atlassian Setup**

#### **Step 1. Access Your Atlassian Account Settings**

To connect Confluence to MangoApps, you’ll first need to generate an API token from your Atlassian account.&#x20;

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FMmSKOsckTV6bmmERxLm1%2Ferhew.png?alt=media&#x26;token=80cd6262-0751-47e8-9a2e-7a0d2afe316a" alt=""><figcaption></figcaption></figure>

Log in to your Atlassian account and go to **Account Settings > Security**.

Alternatively, go directly to your account security settings using this link: [Atlassian Account Security Settings](https://hub.mangoapps.com/mlink/file/NzY0NjUwMA==)

***

#### **Step 2. Generate a Confluence API Token**

The API token acts as a secure password that MangoApps uses to connect to your Confluence instance. You will need to generate this manually.

To do so, click the **Create Classic API token** button.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FjgAtTRq5sC14ERxZTOR6%2Fawegfawgr.png?alt=media&#x26;token=deba87f1-bfc6-4d06-8530-4cf5a3b10437" alt="" width="563"><figcaption></figcaption></figure>

In the resulting pop-up menu, enter a name for your token and set an expiration date.

Click **Create** to generate your token.

***

#### **Step 3. Copy and Save Your API Token**

Once generated, the API token will **only be shown once**. You must copy and store it securely, as it will be used to authenticate the knowledge base integration.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FtvjYGXRWq56FEGsSMmnp%2Frthwre.png?alt=media&#x26;token=8f8b0f00-1018-490b-979a-7b3b36e34de7" alt="" width="563"><figcaption></figcaption></figure>

Click **Copy** to securely save your new token.

{% hint style="danger" %}
**You will not be able to view the token again later.**
{% endhint %}

***

### **MangoApps Setup**

#### **Step 4. Add a New Knowledge Base in MangoApps**

With your token ready, you will now create a new external knowledge base inside MangoApps AI Studio.

To do this, navigate to **Admin Portal > Modules > AI Studio > External KBs > Create a Knowledge Base**

Select **Confluence** as your data source.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2F47DgB3VK9XDOTTiF5ufQ%2Faearrgewrs.png?alt=media&#x26;token=0bae1509-6581-4a89-84bd-c6a459bdaf7e" alt="" width="563"><figcaption></figcaption></figure>

***

#### **Step 5. Enter Knowledge Base Details**

This step involves naming your knowledge base and specifying which part of your Confluence site should be connected. These details help organize and define the knowledge set your AI assistant will use.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2Frk5Xc9Ce36B2td38oHYs%2Feahtrtjyrsse.png?alt=media&#x26;token=54b08e30-22c6-4f3c-8b7d-a817f9c14031" alt="" width="563"><figcaption></figcaption></figure>

Fill out the required fields:

* **Name**: Enter a meaningful name for the knowledge base.
* **Description**: Provide a short description for internal reference.
* **URL**: Enter the URL of the Confluence page or space you want to connect.

***

#### **Step 6. Configure Basic Authentication**

To allow MangoApps to access your Confluence content, you need to authenticate using your email address and the API token created earlier.&#x20;

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FLML3rE0lQXK4jjlPc13z%2Feahtrtjyrssea.png?alt=media&#x26;token=5b2269e0-42e3-442b-b514-743d2b594047" alt="" width="563"><figcaption></figcaption></figure>

Under **Authentication Method**, select **Basic Authentication**, then add two rows for credentials:

| Key      | Value                               |
| -------- | ----------------------------------- |
| username | Your Confluence login email address |
| password | Your API token from Step 3          |

***

#### **Step 7. (Optional) Apply Regex Filters**

If you only want specific types of documents included in the knowledge base, you can apply regular expression (regex) filters to narrow down what is crawled.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2Ff7FtRcuPSHBiOXFZlUZ3%2Feahtrtjyrsseat.png?alt=media&#x26;token=8f5aaafd-6698-4d56-9e5f-579731671273" alt="" width="563"><figcaption></figcaption></figure>

**How it Works:**

Regex filters allow inclusion or exclusion of content by matching patterns in document titles, file types, or metadata. If both inclusion and exclusion filters match a document, exclusion takes priority.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FuztZVc26nMs03yWEveqd%2F02-05-2025-02-11-00.png?alt=media&#x26;token=6b7cfc6b-5b1b-4604-b259-d5d57d2c3729" alt="" width="563"><figcaption></figcaption></figure>

**Supported Content Types:**

* **Space**: Unique space key
* **Page**: Main page title
* **Blog**: Blog title
* **Comment**: Text from blog or page comments
* **Attachment**: File name + extension

**Example:**\
To exclude PDFs with "private" in the name: `.*private.*\.pdf`

***

#### **Step 8. (Optional) Set a Sync Schedule**

To keep your knowledge base updated automatically, you can configure a sync schedule.

* You can toggle **sync scheduling** on to keep your Confluence knowledge base updated automatically.
* If disabled, the knowledge base will sync only once at the time of saving.

***

#### **Step 9. Save and Activate**

Now that all settings and credentials are in place, save the configuration to begin the syncing process. This will establish a connection between your MangoApps AI Studio and the specified Confluence space or page.

Click **Save** to finalize the setup.

MangoApps will now begin connecting with your Confluence site and start syncing content based on your filters and authentication.
