DSP Blog

Integrating OCI Generative AI within your Oracle APEX Reporting

Written by Ben Jackson | 24-Nov-2025 16:15:45

Introduction

Generative AI is reshaping how modern applications interact with their data, enabling users to uncover deeper insights through natural language. With Oracle APEX and OCI Generative AI, developers can embed these features directly into their reporting modules, allowing users to receive meaningful context.

In this blog, we’ll explore why you should integrate the OCI Generative AI service into your Oracle APEX applications and the easiest way you can get started.

 

Why add Generative AI to your APEX application?

One of the main advantages of Oracle APEX is the speed at which you can build data-centric applications. This is due to a plethora of factors, such as its low-code approach to development, seamless integration with Oracle database and other data sources, not to mention a variety of native regions and features that make it incredibly easy to produce professional charts and reports with minimal effort and time spent.

Adding the capabilities of the generative AI service to the mix will enhance this tenfold, allowing features such as:

  • Generation of report summaries
  • Natural Language querying
  • Trend and anomaly detection
  • Enhanced exports and reports
  • AI chat assistant

Let’s jump into some scenarios where this selection of features can be explored.

 

Practical Use Cases

Utilisation of AI-generated summaries in exports

When leveraging tools such as APEX Office Print (AOP) or PLPDF, users can easily generate custom, branded documents that display data derived from queries or reports within your APEX application.

Adding a tag within the template, which correlates to a specific column or region relying on generative AI, will enable the addition of a dynamic summary section that contextualises the data being exported.

This AI-generated summary can highlight key trends and targets or provide interpretations of the data directly within the document. When sharing these reports with external stakeholders or non-technical audiences, this added context makes the information far easier to understand, helping them to grasp the story behind the statistics.

 

Conversational Reporting Assistant

By integrating OCI Generative AI with your APEX reporting pages, you can enable users to query data through natural language instead of filters or SQL queries.

A simple text area or chat-style interface can capture user input and use the integration to interpret the question, query the relevant data, and present the results all directly within APEX.

This approach empowers non-technical users to explore the data and interact with reports conversationally, improving both accessibility and engagement.

 

Enhanced Data Validation and Commentary

The trend and anomaly detection capabilities of the Generative AI service can also be used to validate or interpret newly entered data.

For example, when users submit a large dataset, AI can review the input, identify any unusual trends, and produce commentary such as: “The number of support tickets for July appears high compared to the monthly average.”  

This allows users to identify irregularities or anomalies within the data. By introducing this feature, data integrity is strengthened, and potential business risks can be detected early.

 

How to Set up OCI Generative AI in Oracle APEX

Please note – The method I’m about to demonstrate is the quickest and most straightforward way to integrate OCI Generative AI with Oracle APEX. It’s ideal for getting started or for simple use cases, but it may not be suitable for every scenario. There are several more advanced approaches, such as using AI Agents or Retrieval-Augmented Generation (RAG), that offer greater flexibility, scalability, and control, but may come at a cost.

While the native APEX AI Assistant works well for basic conversational interactions, especially when combining clear prompts with contextual SQL queries, it may fall short for more complex requirements. If you need to summarise detailed reports, guide users who may not be asking the “right” questions, or implement more sophisticated logic, you may find this approach alone isn’t viable.

If that is the case, my colleague Lee Burgess has written a fantastic blog on the other options you can delve into.

However, if this would fit your requirements, let's dive into how we can configure it now that we know what it can offer:

 

Oracle Cloud Infrastructure (OCI)

The main prerequisite before setting everything up in OCI is to ensure that the generative AI service is available in your region. This can be verified by following this link.

Once you’re confident it is, please follow the steps below:

 

Set up a group and a user for the Gen AI service

1. Navigate to Identity & Security → Domains → Default Domain → Groups (under User Management)
2. Create a new user for the group you’re about to create.

3. Now, create the group and add the new user to it.



Set up access to the Gen AI service (IAM)

Now that the user and group have been created, we need to assign a policy to allow access to the gen AI service. This can be done by:

Navigate to Identity & Security > Policies > Create Policy and use the manual editor to allow for the policy rule shown below.

Generate the API credentials

Using the credentials of your newly created user, navigate to the user settings within the dropdown under the user icon and add an API key within the Tokens and Keys tab.

Be sure to download both the public and private keys and copy the information shown within the file preview, as this is all needed for the next step with APEX.

 

Oracle APEX

Configure Gen AI Service

1. Within your app, either navigate to:
  a. Workspace Utilities → Generative AI
  b. Shared Components → AI services (Under the Generative AI module)
2. Create a new service
3. Fill in the relevant information. If you saved the info from previous steps, you can paste it straight in; otherwise, here is where to find each field:
  a. Compartment ID – Identity → Compartments → Select relevant compartment → OCID


 b. Region – A list of regions is provided under the textbox within the APEX screen. Clicking on the various options will populate the textbox with the relevant code. If you’re unsure of the region your tenancy is in, look in the top right of the OCI console.


 
  c. Model ID – this should be pre-populated; however, it can be changed to match your preference.
  d. OCI User ID – the OCID can be found within the user settings, which is located within the profile tab on the navigation bar (user icon in the top right).


  e. OCI Private Key – This is advised to be downloaded when you create a key pair, as OCI does not retain it for you.
  f. OCI Tenancy ID – Found within your tenancy details under the profile tab.


  g. OCI Public Key Fingerprint – This is also housed within the user settings; however, it is located within the Token and Keys tab.

4. After completing the steps above and ensuring everything is filled out, click Test Connection. If everything is configured correctly, you will see the "Connection Succeeded" message. Then be sure to save the details.
5. An additional step to ensure the AI assistant has data from all necessary tables is to navigate to Utilities → UI Defaults → Table Dictionary and add any missing tables or press synchronize to ensure they’re all up to date.



Now that the Generative AI service is configured in both OCI and APEX, developers can begin integrating it directly into their applications. You can utilise the new AI-related Dynamic Actions, make direct API calls to the service, or implement custom PL/SQL logic to generate summaries, respond to user prompts, or enhance reports, allowing you to fully harness the model’s capabilities within your APEX environment.



Conclusion

Integrating OCI Generative AI with Oracle APEX transforms traditional reports into intelligent, interactive insights. By combining APEX’s low-code flexibility with AI-driven capabilities such as natural language querying, anomaly detection, and automated summaries, developers can deliver more meaningful and accessible data experiences.

This integration not only enhances reporting efficiency but also empowers users to better understand their data, turning raw information into clear, actionable insights.

If you’d like to speak to one of our experts about integrating the OCI Generative AI service into your Oracle APEX applications, please don’t hesitate to get in touch.