Skip to content

UC AI Introduction

A comprehensive Oracle PL/SQL framework for integrating AI models (OpenAI GPT, Anthropic Claude, Google Gemini) with function calling capabilities directly in your database.

You often hear that Python is the best language for AI development, but I don’t think that has to be true! Python doesn’t have some magic secret sauce you can’t get with other languages.

The most important part of AI integration is really just calling an API to access Large Language Models (LLMs). Plus, I believe it makes the most sense to put AI features directly into your database, right where your data lives.

It’s true that Python (and other languages) have better ways to connect with AI models and frameworks, which definitely makes building AI apps easier. While Oracle is moving in that direction, they only offer this in their 23ai database, which is currently cloud-only. I think it’s time we take control and make it easy to access AI models directly in our Oracle databases.

Multi-Provider Support

Support for OpenAI GPT, Anthropic Claude, and Google Gemini models with unified API interface.

Function Calling

AI models can execute PL/SQL functions with type-safe parameter passing and JSON schema validation.

Unified API

All AI providers have a consistent interface for text generation and function calling. This allows you to switch providers without changing your code.

Runs on older DBs

It’s just PL/SQL! This framework should work on Oracle Database 12.2 and later!

This framework is specifically designed for Oracle Database developers who want to:

  • Integrate AI: Add AI capabilities directly to database applications and procedures
  • Automate Tasks: Let AI models execute database functions based on natural language prompts
  • Build Smart Apps: Create applications that can reason about data and take actions
  • Extend Functionality: Give AI models access to custom business logic and database operations
  • Maintain Control: Keep AI interactions secure with validated parameters and controlled execution
  • OpenAI: GPT-4, GPT-4 Turbo, GPT-4o, GPT-4o Mini, GPT-3.5 Turbo, o1 series…
  • Anthropic: Claude 4 Sonnet, Claude 3.5 Haiku, Claude 4 Opus…
  • Google: Gemini 2.5 Flash, Gemini 2.5 Pro, …
DECLARE
l_result JSON_OBJECT_T;
BEGIN
-- Let AI calculate something using a custom tool
l_result := uc_ai.generate_text(
p_user_prompt => 'How many open tickets do I have?',
p_system_prompt => 'You are a helpful assistant to an ticketing system.
Use the provided tools to access the database.
You are currently talking to the user "John Doe"',
p_provider => uc_ai.c_provider_openai,
p_model => uc_ai_openai.c_model_gpt_4o_mini
);
-- Get the AI's response
DBMS_OUTPUT.PUT_LINE('AI Response: ' || l_result.get_string('final_message'));
-- You have 5 open tickets.
END;
/