﻿# Configure integration of BRIX with BRIX AI

> [HTML Version](cortex-integration-solution.html)

After installing BRIX AI, set up its connection with your BRIX company. To do this:

1. [Upload the solution for integration with BRIX AI into your BRIX company](#install-solution).

2. [Set up user authentication in BRIX AI](#configure-oauth).

3. [Establish a connection with BRIX AI](#connect-to-system).

## Step 1. Upload the integration solution for BRIX AI

1. Request the **Integration with BRIX AI** solution file from your BRIX rep.

2. Go to **Administration > Solutions**.

3. In the upper-right corner, click **+ Solution** and select **Upload File**.

4. Select a solution file in the **.e365** format.

5. In the window that opens, click **Next** and wait for the [solution import](upload-solution-file.md) to complete.

As part of the solution, a module used to integrate BRIX with **BRIX AI** will be uploaded to the company.

## Step 2. Set up user authentication in BRIX AI using OAuth 2.0

Set up OAuth 2.0 authentication in **BRIX AI** on the BRIX side to:

- Check the current user permissions. When an AI agent or AI action needs to perform an action in the system, user access to app items, process start buttons, and other elements is verified.

- Enable administrator sign-in to **BRIX AI** if you use [authentication via BRIX](cortex-auth-settings.md#system-auth).

To configure authentication:

1. Go to **Administration > Modules** and select the **Integration with BRIX AI** module.

2. Add an OAuth 2.0 client. To do this, expand the **Tokens** section at the bottom of the module page and click **+ Create OAuth2/OIDC Client** on the right.

3. In the window that opens, fill in the fields:

- **Name\***. Enter a name for the client.

- **Template\***. Leave the default value.

- **Redirect URI\***. Enter the path to your **BRIX AI** server in the following format: **https://<BRIX\_AI\_Domain>/api/pub/v1/security/sessions/callback**.

4. Click **Save**.

5. In the window that opens, copy and save the application client ID and client secret. You will need them to set up administrator sign-in to **BRIX AI** if authentication via BRIX is used, as well as to establish a connection to BRIX when creating AI agents and AI actions.

6. If you [configure administrator authentication via BRIX](cortex-auth-settings.md#system-auth), go to configuring the environment variable file and specify the application client ID and client secret.

## Step 3. Establish a connection with BRIX AI

Once the **BRIX AI** server is installed:

1. Sign in to **BRIX AI**. Your login credentials depend on the configured [authentication method](cortex-auth-settings.md). To sign in Via BRIX enter your system username and password.

2. In the left panel, click the key icon **(cortex-api-keys-icon.png) **to go to the **API Keys** page.

3. Click the plus icon next to the page name.

4. In the window that opens, enter a key name, select the **Integration** access type, and then click **Add**.

5. Copy the generated key.

6. Go to BRIX and open **Administration > Tokens**.

7. [Create a token](360016488452.md) by selecting a system administrator as the user, and copy the token.

8. Go to **Administration > Modules** and select the **Integration with BRIX AI** module.

9. On the **General** tab, fill in the fields:

- **URL\***. Enter the address of your **BRIX AI** server.

- **API Key\***. Paste the API key copied from **BRIX AI**.

10. Click **Reconnect** to establish a connection with the **BRIX AI** server.

11. In the **BRIX Token\*** field, paste the token created in BRIX.

12. Make sure the integration works correctly by clicking **Check Connection**.

13. In the **Default Chat Language** field, select the language AI agents use to communicate with users.

14. At the bottom of the page, click **Save**.

Integration with **BRIX AI** is now configured. Next, [connect large language model providers](cortex-llm-providers.md) to set up AI agents, AI actions, and smart search.