_See our **Medium blog post to learn more about our journey building on Forge!_**
Overview
MagicLinks is a Forge AI app built for Confluence users that uses Confluence data along with chat GPT to predict which words in a Confluence page should be linking out to other relevant pages within the Confluence space. It then auto-magically updates the page to insert those links. With MagicLinks, users can seamlessly connect related information and unlock the power of interconnected knowledge without the manual hassle.

Category: AI Apps for Data-Driven Insights. MagicLinks belongs in this category since it is using existing Confluence data and using this to predict which pieces of text should link to which Confluence pages.
User journey and features
- MagicLinks Forge App: MagicLinks is available through the context menu on any given Confluence page. Utilizing OpenAI's ChatGPT, MagicLinks scans selected batches of text within a Confluence page to suggest potential links based on data from titles and descriptions of other pages within the Confluence space.
- Suggested Links Panel: Users are presented with a list of AI-suggested links, showing the word or phrase in the selected text that can be replaced with a link to the relevant Confluence page. Users have the ability to ccept or reject these suggestions.
- One-Click Insertion: With the “Insert links” button, accepted suggestions are instantly transformed into actual links on the page, enhancing the wiki's interconnectivity and user navigation.
The problem
In expansive Confluence spaces, valuable information often gets siloed due to the absence of interconnected links. Users spend unnecessary time searching for related content or miss out on vital connections altogether. A manual approach to linking relevant content is tedious and lacks precision, especially in Confluence spaces that are very large with hundreds of pages. So the default state is that pages don't always link out to other relevant pages, disconnecting the knowledge graph.
Our solution
We built MagicLinks to address this issue within Confluence with the power of AI. We use user-generated content within Confluence - specifically the titles and first few words of each page - and combine it with OpenAI's ChatGPT API (underlying model is GPT-4) to return to the user a list of suggested page links based on their selected text within a page, along with a confidence level from the AI on how exact it thinks the match is. Users can simply accept the link suggestions that they think makes sense and have them automatically inserted into the page using Forge's Confluence APIs.
Impact for Atlassian users
MagicLinks has the potential to drastically reduce the time users spend searching for related content. By creating a more interconnected web of knowledge, it can boost productivity, encourage exploration, and foster a more holistic understanding of topics. Organizations can ensure that critical information is effortlessly accessible and always in context. It makes Confluence an even more powerful source of knowledge and it applies for Atlassian users beyond Confluence since we plan to include links to relevant JIRA tickets, Bitbucket repositories, and more.
Technical overview
Forge APIs used: Magic Links uses numerous Forge APIs and features to work:
@forge/uiand@forge/react: These Javascript libraries were used to create the entire front-end UI of the Confluence contextMenu app (buttons, tables, etc).@forge/api: We used the API library for two purposes: (1) to make product REST calls to Confluence's APIs to gather the information from each page in the space, and (2) to call OpenAI's ChatCompletions API to utilize AI as a core feature of the application.
Technical approach 1: Embeddings-based matching
Leveraging OpenAI's embeddings AI model, we initially attempted to embed each page's title and description (first 100 characters). We were able to get this data through the Confluence /pages endpoints. We then sought to find non-common words within the user's selected text from the page, embed those words, and compare the embeddings to each page's embeddings to see if any of those words were strongly related to one of those pages (and thus should be suggested as a link).

Though embedding-based matches are very powerful, in practice we found that it did not result in good matches for words and pages. We believe the reason is that embedding a single word out of context did not have enough embedded information to compare it to a much more robust embedding of a page's title & description. We're trying more experiments to see how we can leverage embeddings along with ChatGPT to provide more accurate matches.
Technical approach 2: ChatGPT with prompt engineering
We tried another method. We still extracted the title and first 100 characters of every Confluence page in the space, but instead of embedding them we gave them to ChatGPT as part of a much more robustly engineered prompt and asked ChatGPT to find its own matches within the user's selected text.

This ChatGPT-based approach worked surprisingly well, though it needed significant prompt engineering to get the AI to do what we needed it to for the app. This (again) proved to us the sheer power of Large Language Models to interpret our tasks and incorporate relevant outside context (from Confluence) into its answer.
Future enhancements
We had a blast building Magic Links on Forge's API for the hackathon but we have some low-hanging fruit enhancements to make this even better for Atlassian users:
- Incorporate more Atlassian products: The power of Atlassian comes from the interconnectedness of its products (JIRA, Confluence, BitBucket, and more). For the hackathon we focused on just Confluence pages to find relevant links for the user's selected text, but we'll make MagicLinks better by incorporating JIRA issue links and Bitbucket links to give the AI more links to choose from.
- Scale with Forge's async events API: Right now we're using one single API call to OpenAI with all of the selected text and pages to look through. This will become infeasible for situations where there are a lot of pages within the Confluence space since we'll exceed our prompt token limit. To scale MagicLinks we'll parallelize our calls to OpenAI for chunks of text at a time using Forge's async events API.
- Improve the accuracy of the link matching: There are numerous tricks we can use to wrk with ChatGPT to increase the accuracy with which it suggests page links. One thing we're excited to incorporate is the combination of embeddings and ChatGPT to allow the AI to have access to much more context from which to create its link suggestions.
MagicLinks redefines the way users interact with Confluence, breaking down silos and seamlessly connecting knowledge. We're passionate about using AI to enhance how teams operate and had a blast working with Forge's API.
Built With
- forge
- javascript
- openai

Log in or sign up for Devpost to join the conversation.