UC AI v25.7: Embeddings, xAI, OpenRouter and Toon

The current UC AI release adds support for xAI (Grok) and OpenRouter (almost all models). Additionally, embedding is supported for all providers, you can use Toon, and override URLs for all providers.

UC AI

UC AI is one of my passion projects of this year where I implement AI support for Oracle databases through PL/SQL APIs. The main theme is provider agnosticness. As there are new models evolving rapidly this means that I make sure all providers are available through a unified API allowing you to switch models by simply changing a function parameter.

UC AI, of course, supports all the advanced model features like tools, reasoning, vision, etc, allowing you to build full AI agents. Compared to Oracle solutions, I am faster to support innovations, and as it is free open-source software, you can inspect and improve the code yourself. Check out the GitHub page (and maybe give it a star). For more details, check the documentation.

What’s new

Today I am launching version 25.7 with major enhancements.

New providers: xAI and OpenRouter

xAI is Elon Musk’s AI company. Although I am not his biggest fan, I have to admit that his models are highly capable, and Grok 4 Fast is actually my daily driver for general queries to LLMs.. This model was released with a big bang, as it did the unthinkable of being smart, fast, and cheap at the same time.

The Grok models support all major features like tool calls, reasoning, vision, etc. Just PDF analysis is not yet supported by UC AI because it requires a nontraditional approach of first having to upload a PDF, and then in a separate API call you can ask questions about it.

 declare
   l_result json_object_t;
 begin
   l_result := uc_ai.generate_text(
     p_user_prompt => 'What is Oracle APEX?',
     p_provider => uc_ai.c_provider_xai,
     p_model => uc_ai_xai.c_model_grok_4_fast
   );

   dbms_output.put_line('AI Response: ' || l_result.get_clob('final_message'));
 end;
 /

OpenRouter is something I wanted to have supported for all the bleeding-edge experimentals out there. OpenRouter does not create models themselves but instead routes to all kinds of other providers. You just buy credits from them and then can use any of the almost 600 supported models from all the big providers and niche ones. For example, this allows UC AI usage with Z.AI GLM, Amazon Nova, MiniMax, DeepSeek, Mistral, Qwen, etc. Some models are even free, and big providers do secret tests with beta models under fake names with OpenRouter.

 declare
   l_result json_object_t;
 begin
   l_result := uc_ai.generate_text(
     p_user_prompt => 'What is Oracle APEX?',
     p_provider => uc_ai.c_provider_openrouter,
     p_model => 'z-ai/glm-4.6'
   );

   dbms_output.put_line('AI Response: ' || l_result.get_clob('final_message'));
 end;
 /

(More details and examples for xAI and OpenRouter)

If you want to support RAG or vector search in your applications, you need to transform the source text content into numbers you can compare/calculate with. This is called vectorization and is possible through embedding models. Most AI providers also build these models, so UC AI now has the function generate_embeddings to do so.

The following providers have embedding models:

  • Ollama: plenty of models for local embeddings
  • OpenAI: text-embedding-3 (small and large)
  • Google: gemini-embedding-001 (flexible in dimensions and task type)
  • OCI: Cohere embedding models
  • OpenRouter: currently 22 different models
  • (Anthropic and xAI don’t have their own embedding models.)

The generate_embeddings function expects an array, making it able to embed one to multiple texts in one go. It also returns a json_array_t making it work with non-23ai/26ai databases. For the semantic search implementation in our APEX Document Management product, we send the JSON array directly to the vector DB Qdrant for storage and similarity search, even on Oracle 19c databases without native vector support.

 declare
   l_result json_array_t;
 begin
   l_result := uc_ai.generate_embeddings(
     p_input => json_array_t('["Oracle APEX is a low-code development platform.", "UC AI allows you to easily use AI from PL/SQL."]'),
     p_provider => uc_ai.c_provider_openai,
     p_model => uc_ai_openai.c_model_text_embedding_3_small
   );

   -- [
   --   [0.3433434, 0.123434, ...],     first string
   --   [0.9432322, 0.402324, ...]      second string
   -- ]
   -- l_result.get(0) → JSON array of embedding values for first input

   -- convert to 23ai/26ai vector:
   -- l_my_vector := vector(l_result.get(0).to_clob);
 end;
 /

Toon support

UC AI now supports Toon. I already covered Toon in detail in my last blog post, but the takeaway is that it uses less tokens to represent data compared to JSON. It looks close to CSV but supports nested structures and includes counts.

declare
  l_json clob;
  l_toon clob;
begin
  l_json := '{
    "employees": [
      {"name": "Alice", "age": 30, "department": "HR"},
      {"name": "Bob", "age": 25, "department": "Engineering"},
      {"name": "Charlie", "age": 28, "department": "Marketing"}
    ]
  }';
  l_toon := uc_ai_toon.to_toon(l_json);
  sys.dbms_output.put_line(l_toon);
/*
employees[3]{name,age,department}:
  Alice,30,HR
  Bob,25,Engineering
  Charlie,28,Marketing */
end;

(More details on Toon support here)

Endpoint overrides for all providers

As many providers are also available through different hosters like Anthropic on Amazon Bedrock or OpenAI on Azure, UC AI needed a way to change the base URL for any providers. This is now easily possible:

 uc_ai.g_base_url := 'https://something.azure.com';

This can also be used for providers that are not yet fully supported in UC AI but have the same API endpoints like OpenAI, like DeepSeek or Perplexity.

I wasn’t able to test this exhaustively across all platforms, so feedback is appreciated.

Easier support for libraries

As we internally start to use UC AI in our products I ran into the need to make it easier to call UC AI from environments where you just let anybody configure one provider and model and let UC AI do the job behind the scenes.

Reasoning

One enhancement is a global reasoning level. Providers handle reasoning differently: Google and Anthropic use a token budget, while OpenAI uses simple levels. UC AI’s uc_ai.g_reasoning_level unifies this to make it work with any provider.

 uc_ai.g_enable_reasoning := true;
 uc_ai.g_reasoning_level := uc_ai.c_reasoning_level_low; -- low, medium, high

If you just mainly use a single model frequently in production I still highly recommend to use the provider specific settings and to consult the providers documentation on reasoning.

 uc_ai_google.g_reasoning_budget := 512;

(More details on reasoning)

APEX Web Credentials

There is also a global web credential setting now. Any called provider will use this as a fallback when no provider specific web credential is set.

 uc_ai.g_apex_web_credential := 'OPENROUTER';

(More details on web credentials)

UC AI version constant

The uc_ai package now has the current installed version in the spec. There is a string version and a numeric one that easier to compare for patches (25.7.1 is not a valid number):

   c_version     constant varchar2(16 char) := '25.7';
   c_version_num constant number := 20250700;

What’s to come

Agent improvements

The theme for next year is to make it easier to define complex agentic workflows. I’ll introduce a configuration table to store parameters like provider, model, reasoning settings, and enabled tools. This will pair with another table for system prompts and agent configs.

Building on this, I would like to make it possible for a main orchestration agent to delegate to another specialist agent with just the right context, let it do the heavy work, and report back the summary. In this theme, a native mechanism to summarize the context for long-running workflows would also be great. But this is not set in stone yet; if you have any advice on this, please let me know.

APEX plug-in and streaming

On my mind and the roadmap for a long time is an easy APEX integration. The first step would be a chat plug-in that makes it easy for APEX users to use UC AI agents. I want to allow visualizations for tool calls, which makes it nice to understand what the AI is doing.

The cherry on top would be streaming support. Thanks to APEX Message Service (our WebSocket APEX product), it would be possible to have text immediately streaming the response (like you are used to on ChatGPT) instead of having to wait the whole generation time to then see the whole response appear.

Workshop with UC AI

In February I am also doing a hands-on workshop on UC AI. If you are interested in AI but have not yet done much with it, this might be for you. We will start with LLM basics and end up with powerful AI agents by step-by-step introducing new capabilities. Check out the details page.

APEX 26.1

The next APEX release is around the corner. This, of course, means competition for UC AI, as I started this project as a result of frustration from lacking tool support. I am excited to see how the APEX team implemented some of the features and motivated to improve UC AI if I see things that can be improved. However, I feel like UC AI will always have advantages over the native APEX implementation, as I am more flexible and able to react to changes way faster.

Get started with UC AI

UC AI is free, and all you need to do is run an installation script. Check the documentation, which I also have greatly enhanced for the new release. You probably want to start with the installation guide.

Other Posts

Comments

Loading comments...
Homepage All Blogposts

AI disclaimer: I spend hours writing my blog posts by hand, adding my own thoughts and experiences to them. In my view, purely AI-generated content lacks that human depth and isn't worth publishing. I only use AI for research and editing assistance.