Private AI for Confluence

Documentation and Knowledge Base

Functional Overview

Private AI for Confluence enhances content creation and collaboration within your Confluence environment by integrating ANY cloud or private AI model. This app is designed to integrate seamlessly with your internal systems, ensuring maximum privacy for your data.

Key features include:

  • Instant Summarization: One-click summarization of pages or blog posts, delivering concise key points in seconds.
  • Content Generation: Generate new content or ideas with ease, helping users kickstart their writing process.
  • Tone Editing: Edit the tone of your content to match your intended audience, ensuring clarity and effectiveness.
  • Action Item Identification: Automatically detect and highlight action items within your content to keep teams organized.
  • Question Assistance: AI helps in formulating relevant questions, clarifying complex points, and improving content.
  • Many More: Discover additional powerful AI-driven features designed to improve content quality and team collaboration.

Private AI for Confluence allows you to integrate an internally hosted AI model, which means all processing occurs within your internal network, ensuring data privacy and security.

Architectural Overview

Private AI for Confluence integrates with an AI model through a Groovy script. This enables integration with ANY internal or external models. Using a private model ensures no data is sent to the Internet. This can be visualized as follows:

Private AI Integration Diagram

Integration process triggers whenever the user interacts with any of the AI Assistant features.

Requirements

The following conditions must be met in order to use Private AI for Confluence:

  • An internally or externally hosted AI model must be available and reachable from all Confluence cluster nodes

Installation

Private AI for Confluence is installed as a standard application through the Universal Plugin Manager (UPM).

Follow these steps:

  1. Login as a system administrator
  2. Navigate to Confluence Administration -> Manage Apps
  3. In the Search the Marketplace field type Private AI for Confluence
  4. The app will be filtered In the results panel. Click the Free Trial or Buy Now buttons
  5. Accept the terms and conditions
  6. Once app is installed, click on Get license and follow the instructions
  7. You will need to configure the app before you can use it. To do that, navigate to the Manage Apps screen, open Private AI for Confluence and select the Configure button. Reference the Configuration section on this page for more information on which mode to choose. 
Note that Private AI for Confluence uses standard Atlassian licensing model. Trial period is available.
 

Configuration

Private AI for Confluence requires that you configure the app before you can use it.

There is a separate configuration page available, with all configuration options. To navigate it, go to to the Manage Apps screen, open Private AI for Confluence and select the Configure button.

The following configuration settings are available:

  • Integration script – defines the connection protocol with the Private AI model (additional details available below)
  • Enable AI Page Summarization – Enable or disable Summarize button for pages and blog posts in View mode.
  • Enable AI Editor Assistant – Enable or disable AI Assistant button for pages and blog posts in Edit mode.
  • AI Editor Assistant prepared queries – Prepared AI queries that will be displayed to users while using the AI Editor Assistant feature. Input 1 query per line.
Private AI Integration Script

To use the app you will need to configure a simple Groovy integration script, that defines the communication protocol with the AI engine. Without configuring the script, the app will not function properly. By default, a sample script is available that serves as example – it can be modified or adapted. 

The script will be invoked every time when a user interacts with the app. 

Script invocation lifecycle is as follows:

  1. User interacts with the app
  2. Groovy script execution is triggered
  3. Groovy script integrates with a Private AI model over HTTP or other means
  4. Groovy script returns a single String result, which contains the generated output

For proper execution the following best practises must be followed:

  • The script must always return the text response from the AI engine as a String result.
  • A Groovy parameter query is passed. It contains the AI query – it must be forwarded or adapted to the AI engine. it contains the user query, selected text and other parameters
  • In case an error occur, an Exception should be thrown. Example: throw new Exception(“An error has occured…”)
  • Always ensure you put a timeout to all blocking operations, especially HTTP calls.

The following variables are available for use within the script:

  • query – Pre-built AI context with selected text and query to send to the AI model
  • prompt – User query to send to the AI model
  • selectedText – Selected text from a Confluence page to send to the AI model. Could be empty.
  • executionContext – Execution context that specifies where the AI request is coming from. Possible values are: page-editor-assistant; navbar-assistant
  • httpClient – used to easily send HTTP requests
  • logger – may be used for logging. Use as: logger.info(“message”) | logger.debug(“message”) | logger.error(“message”). The resulting logs will be available in the standard log files – please ensure you enable the required level of logging for the com.deview_studios.atlassian.confluence.private_ai package from the Logging and profiling menu.
It’s recommended to enable DEBUG logging while developing the script to see if you’re receiving errors. Please see section Logging. 
If you need help developing the script, don’t hesitate to reach to a Deview Studios representative through our standard channels. No additional charges apply.

The following is an example integration with OpenAI GPT-4o through the Groovy script:
/* MODIFY THIS SCRIPT TO INTEGRATE YOUR AI MODEL. THIS IS JUST AN EXAMPLE. */
import com.atlassian.json.jsonorg.*;
import org.apache.http.entity.StringEntity;

def messagesArray = new JSONArray();
messagesArray.put(new JSONObject().put("role", "user").put("content", query));

def payload = new JSONObject() // Prepare body as per API specification
    .put("model", "gpt-4o")
    .put("messages", messagesArray)
    .put("temperature", 1.0)
    .toString();

def post = httpClient.newPost("https://api.openai.com/v1/chat/completions"); // Create a new request to specified URL

post.setEntity(new StringEntity(payload, java.nio.charset.StandardCharsets.UTF_8)); // Set HTTP payload
post.addHeader("Content-Type", "application/json"); // Set HTTP header
post.addHeader("Authorization", "Bearer REPLACE_ME"); // Set HTTP header

JSONObject json = new JSONObject(httpClient.sendRequest(post)); // Parse response as JSON
def result = json.getJSONArray("choices").getJSONObject(0).getJSONObject("message").getString("content"); // Traverse JSON tree

return result; // This script must always return the produced result
 

Usage

Private AI for Confluence provides the following functionality:
 
  • Page Summarization
Navigate to an already existing page or blog post. If enabled, an additional “Summarize” button will be available in the actions panel. Once clicked, the contents of the page or blog post will be briefly summarized for the user in a separate panel.
Private AI for Confluence - Summarize Screenshot
 
  • AI Editor Assistant
The AI Editor Assistant enables enhanced content editing for existing pages or blog posts. When enabled, an “AI Editor Assistant” button will appear in the action panel. Upon selection, a dedicated panel will open, which can be used alongside the page to assist in content modifications. This tool serves as a versatile assistant, allowing users to generate or modify content efficiently.
 
Users can select text from the page and submit it along with a query to the AI Assistant for specific actions. Queries may also be submitted without selecting any text. Additionally, a set of predefined, configurable queries will be available for users to choose from, streamlining the editing process and improving productivity.
 
Private AI for Confluence - AI Editor Assistant Screenshot

Limitations

Private AI for Confluence has the following limitations:

  • N/A

Logging

To enable logging for Private AI for Confluence, go to Confluence Adminsitration -> Administration -> Logging and Profiling and click on Add New Entry. Add the following entry: com.deview_studios.atlassian.confluence.private_ai and set the logging level to DEBUG.

Known Issues

Private AI for Confluence has the following known issues:

  • The following error message is displayed when Generate Issues is clicked – “License for this feature is not set or has expired. Please contact your system administrator”. Please ensure your app is licensed.
Deview Studios Logo

 

Contact Us

Copyright © 2022 Deview Studios