LinkedIn pixel

By Srikanth Chakali, Lead Consultant at Centroid

Many customers who use Oracle Database, such as those using Oracle E-Business Suite, PeopleSoft, or JD Edwards, find Oracl APEX to be an efficient low-code tool to build custom applications. Oracle APEX includes Generative AI capabilities that can be extended with custom tools. In this tutorial, we will demonstrate how to use the APEX AI Assistant with the Oracle AI Data Platform agent APIs to build advanced integrations with minimal or no code.  

The APEX AI Assistant is configured to route user requests to an AIDP Chat Agent, so that responses come from the agent deployed on Oracle AI Data Platform (AIDP) rather than from the general knowledge of a language model. A custom Generative AI Tool uses PL/SQL to invoke the deployed AIDP Agent endpoint, while users continue to work with the standard APEX Assistant experience. This article walks through the web credential, agent configuration, system prompt, tool setup, endpoint call, page-level enablement, and a working result in an AR Aging Summary application. 

Solution Flow 

A question typed into the assistant travels through six components before the answer returns to the same dialog. Each component has a single, clearly separated responsibility. 

Step  Component  Role in the integration 
1  APEX AI Assistant  Captures the question entered by the user and sends it to the configured Generative AI Agent. 
2  Generative AI Agent  Interprets the request and calls the configured tool, guided by a restrictive system prompt. 
3  AIDP_CHAT_AGENT tool  On-demand Retrieve Data tool that receives the complete user question as its QUESTION parameter. 
4  PL/SQL endpoint call  Invokes the AIDP Agent endpoint, authenticating with the APEX Web Credential. 
5  AIDP response  The deployed AIDP Agent processes the request and returns its answer to the tool. 
6  Assistant output  The agent receives the tool result and displays the answer in the APEX AI Assistant. 

 

Image 1

Figure 1. Integration flow from the user question to the assistant response, using the AIDP Chat Agent. 

Step 1: Configure Secure Web Credentials 

Start by creating the Web Credential that authenticates the outbound request from APEX to the AIDP endpoint. In this implementation, the credential uses OCI Native Authentication. Keeping endpoint credentials in Workspace Utilities avoids embedding secrets directly in application code. 

Image 2

Figure 2. Web Credential configuration used by the integration. 

Step 2: Create the Generative AI Agent 

In the application, open Shared Components and select Generative AI Agents. Create the agent that orchestrates the Assistant interaction and makes the AIDP tool available to the model. Here the agent is named AIDP Agent and uses the ApexAssistant Generative AI service. 

 Image 3

Figure 3. Generative AI Agent configuration under Shared Components. 

Step 3: Use a Restrictive System Prompt 

A key design decision is to prevent the Generative AI model from answering from its own general knowledge when the AIDP system must remain the authoritative source. The implementation uses restrictive system instructions along these lines: 

You are an assistant that answers questions exclusively by using the AIDP_CHAT_AGENT tool. 

For EVERY user message that contains a question or request, call the tool. 

These instructions establish deterministic routing: requests are sent to the integration tool rather than answered independently by the model. Because routing depends on model instructions, test a range of question types to confirm the tool is called every time. 

Step 4: Configure the AIDP_CHAT_AGENT Tool 

Add a Generative AI Tool to the agent so the APEX Assistant can invoke the AIDP integration. The tool is the bridge between the conversational experience and the PL/SQL code that calls the external endpoint. 

APEX validates incoming parameter values against the declared data type and required flag. As the tool definition itself reminds developers, on-demand tools are called by the AI service, so validate inputs and return only the data the model needs. 

Image 4

Figure 4. Generative AI Tool registered on the agent as an on-demand Retrieve Data tool. 

Image 5

Figure 5. Tool identification, execution point, and the QUESTION parameter. 

Step 5: Invoke the AIDP Endpoint with PL/SQL 

The tool implementation uses PL/SQL to call the deployed AIDP Agent endpoint and return the remote agent response to the APEX Generative AI flow. This keeps the external service integration within the database-driven APEX architecture and allows credentials and request handling to be centrally controlled. 

The PL/SQL receives the QUESTION value from the tool, sends it to the endpoint using the Web Credential from Step 1, and returns the AIDP response as the tool result. Response parsing and error handling belong in this block, so failures surface as clear messages rather than as an empty answer. 

Step 6: Enable the Assistant in the Application 

After the agent and tool are configured, expose the assistant on the target page. In the AR Aging Summary application, this uses a button and a dynamic action, as summarized below. 

Component  Configuration 
Button  Named Aging_Assistant, labeled AR Aging Assistant, using the Text with Icon template and the fa-ai-prompt icon. 
Button behavior  Action is Defined by Dynamic Action; static ID aging-assistant. 
Dynamic action  Fires on Click of the Aging_Assistant button. 
True action  Show AI Assistant, using the AIDP Agent, displayed as a Dialog titled “Ask in plain English”. 

Image 6

Figure 6. Creating the AR Aging Assistant button on the page. 

Image 7

Figure 7. Button appearance and behavior, with the action defined by a dynamic action. 

Image 8

Figure 8. Dynamic action that is initiated when the button is clicked. 

Image 9

Figure 9. The Show AI Assistant action, pointing to the AIDP Agent and displaying it as a dialog. 

Step 7: Validate the End-to-End Result 

Run the application, open the assistant from the AR Aging Assistant button, and submit a question. A successful test confirms the complete path: APEX accepts the user request, invokes AIDP_CHAT_AGENT, PL/SQL calls the Deployed AIDP endpoint, and the agent response is returned to the assistant dialog. 

Image 10

Figure 10. The AR Aging Summary page, with the AR Aging Assistant button that launches the assistant. 

Image 11

Implementation Checklist 

  • Create the Web Credential in Workspace Utilities and confirm the authentication type matches the AIDP endpoint requirements. 
  • Create the Generative AI Agent under Shared Components and apply the restrictive system prompt. 
  • Add the aidp_chat_agent tool as an on-demand Retrieve Data tool with a required QUESTION parameter. 
  • Implement the PL/SQL endpoint call using the Web Credential; keep secrets out of the code. 
  • Add the button and the Show AI Assistant dynamic action, and select the AIDP Agent. 
  • Test that every question triggers the tool, and validate both tool execution and the final rendered response. 
  • Review error handling, endpoint timeouts, and response parsing before production deployment. 

Business Value and Responsible Use 

The pattern gives business users a familiar conversational experience inside the applications they already use, while the answers remain grounded in the enterprise data and logic held in AIDP. Routing every request through the AIDP Chat Agent keeps a single authoritative source and avoids answers that mix in unverified general knowledge. 

Because the assistant returns whatever the agent returns, confirm that the agent applies the access rules appropriate for the people using the APEX application, keep credentials in Web Credentials, and monitor tool errors and timeouts once real users are asking questions. 

Operational principle: treat the AIDP Agent as the authoritative source, keep secrets out of code, and verify both tool execution and the final response before release. 

Closing 

This approach lets Oracle APEX provide a native conversational experience while delegating enterprise question answering to the AIDP Chat Agent. The integration combines an APEX Generative AI Agent, a custom tool, secure Web Credentials, and PL/SQL into a clear, reusable pattern for connecting APEX applications to an external AI service. 

Because each layer has one job, the pattern is easy to extend: another agent, tool, or page can be added by repeating the same steps, without changing the way users interact with the assistant. 

Lets Get Started 

Ready to bring governed enterprise AI into your Oracle APEX applications? 

Partner with Centroid to Accelerate Your AI Data Platform Journey. Centroid enables and empowers organizations to modernize their data and analytics landscape through the strategic adoption of Oracle AI Data Platform (AIDP), Oracle Autonomous Database, Oracle Data Integrator (ODI), and Oracle APEX. Our expertise helps enterprises design and implement scalable, governed, and business-ready data platforms that transform operational data into actionable insights. From building modern Medallion Architectures and enterprise data pipelines to delivering advanced analytics, governance, and AI-driven business solutions, Centroid helps organizations unlock the full value of their data assets while accelerating digital transformation initiatives. Connect with our specialists to discover how a modern AI-powered data platform can enhance business intelligence, improve operational efficiency, and support data-driven decision-making across your organization. 

Whether you are looking to: 

  • Connect Oracle APEX applications to AIDP agents 
  • Implement Medallion Architecture on Oracle AIDP 
  • Build conversational assistants over governed enterprise data 
  • Enable AI-driven insights and automation 
  • Establish enterprise-wide data governance and lineage 
  • Accelerate cloud and data platform modernization initiatives 

Our experts can help you design, implement, and operationalize a future-ready analytics ecosystem tailored to your business needs. 

Contact Centroid today to discover how Oracle APEX and AIDP can unlock the full value of your enterprise data and accelerate your AI and analytics transformation initiatives. Learn more about our Oracle Data and AI solutions and schedule a consultation with our experts to get started. 

Explore More Insights

Get your customized JDE cloud migration roadmap

Unlock a clear path to a more efficient, scalable Oracle JD Edwards environment with OCI. Sign up for a consultation with our experts, and we’ll provide a cloud migration roadmap designed for your business needs. 

You're one step closer to AI-powered insights.

Fill out the form to request your complimentary software assessment. Our experts will review your Oracle EBS environment and provide personalized recommendations to help you maximize its value with EBS VisionIQ.

Subscribe to the Centroid BlogWire

Get the Latest Cloud and IT Insights—Delivered Right to Your Inbox Every Month!

By submitting this form you agree to receive communications from Centroid. You can opt-out at any time. Privacy Policy. Please enter a valid company email to ensure delivery.