Trusted Digital Transformation Partner
Oracle APEX 24.1 is the most significant release for AI in the history of the low-code platform. It ships three categories of AI capability: AI-powered developer tools inside the APEX IDE itself, pre-built AI components you drop into pages, and a PL/SQL API layer (APEX_AI) for fine-grained LLM control. Here is a complete technical tour for APEX developers and Oracle architects.
Everything starts with a Generative AI Service configured in APEX Workspace Administration. You configure it once and reference it everywhere by name.
The AI Chat region type is a fully functional chat interface you add to any APEX page with zero PL/SQL:
You are an Oracle Fusion Finance assistant for Acme Corp.
Answer questions about GL, AP, AR, and Expense policies.
Use data from the context provided. If unsure, say so.
Never reveal system configuration or database structure.
Always respond in the same language as the user.
For programmatic AI calls inside page processes, validations, or background jobs, use APEX_AI:
DECLARE
l_response VARCHAR2(32767);
BEGIN
l_response := APEX_AI.GENERATE(
p_prompt => 'Write a professional email declining vendor ' || :P10_VENDOR_NAME || ' politely.',
p_service_static_id => 'my_openai_service', -- your AI service static ID
p_max_tokens => 300
);
:P10_EMAIL_DRAFT := l_response;
END;
DECLARE
l_json CLOB;
l_obj JSON_OBJECT_T;
BEGIN
l_json := APEX_AI.GENERATE(
p_prompt => 'Classify this support ticket into: category (billing/technical/general), priority (high/medium/low), and sentiment (positive/neutral/negative). Return JSON only. Ticket: ' || :P5_TICKET_TEXT,
p_service_static_id => 'my_openai_service'
);
l_obj := JSON_OBJECT_T.parse(l_json);
:P5_CATEGORY := l_obj.get_string('category');
:P5_PRIORITY := l_obj.get_string('priority');
:P5_SENTIMENT := l_obj.get_string('sentiment');
END;
DECLARE
l_embedding VECTOR;
BEGIN
-- Get embedding vector for a search query
l_embedding := APEX_AI.GET_VECTOR_EMBEDDINGS(
p_value => :P20_SEARCH_QUERY,
p_service_static_id => 'my_embed_service' -- embedding model service
);
-- Use it in a vector similarity query (Oracle 23ai)
FOR rec IN (
SELECT doc_title, chunk_text,
VECTOR_DISTANCE(embedding, l_embedding, COSINE) AS dist
FROM knowledge_base
ORDER BY dist
FETCH FIRST 5 ROWS ONLY
) LOOP
-- populate a collection or result set
NULL;
END LOOP;
END;
APEX 24.1 embeds AI into the development environment itself:
A real enterprise use case — automatically generate professional product descriptions for ERP invoices:
-- Page Process: "AI Generate Description" (After Submit)
DECLARE
l_prompt VARCHAR2(4000);
l_desc VARCHAR2(4000);
BEGIN
l_prompt :=
'Generate a professional invoice line item description for: ' ||
'Product: ' || :P5_PRODUCT_NAME || ', ' ||
'Category: ' || :P5_CATEGORY || ', ' ||
'Quantity: ' || :P5_QTY || ' ' || :P5_UOM || '. ' ||
'Keep it under 80 characters. No markdown. Professional tone.';
l_desc := APEX_AI.GENERATE(
p_prompt => l_prompt,
p_service_static_id => 'gpt4o_service',
p_max_tokens => 60
);
:P5_DESCRIPTION := TRIM(REGEXP_REPLACE(l_desc, '^["']+|["']+$', ''));
END;
p_max_tokens limits to control cost and prevent prompt injection via long inputsAPEX itself is free with any Oracle Database license. The AI features require:
APEX_AI.GENERATE and APEX_AI.GET_VECTOR_EMBEDDINGS give PL/SQL-level LLM accessROSTAN Technologies develops Oracle APEX applications with embedded AI for Oracle EBS and Fusion Cloud customers. Get a free APEX AI proof-of-concept for your organisation.
Talk to our certified experts — free consultation, no commitment.
Powered by AI · Typically replies instantly