About Select AI

Use natural language to interact with your database and LLMs through SQL to enhance user productivity and develop AI-based applications. Select AI simplifies and automates using generative AI, whether generating, running, and explaining SQL from a natural language prompt, using retrieval augmented generation with vector stores, or chatting with the LLM.

When you use Select AI, Autonomous Database manages the process of converting natural language into SQL. This means you can provide a natural language prompt instead of SQL code to interact with your data. Select AI serves as a productivity tool for SQL users and developers and enables non-expert SQL users to derive useful insights from their data, without having to understand data structures or technical languages.

Select AI also automates the retrieval augmented generation (RAG) process from generating vector embeddings to retrieving relevant content based on your prompt through semantic similarity search using your vector store. Other features include synthetic data generation, supporting chat history for conversations, and other features, all from a SQL interface.

The DBMS_CLOUD_AI package enables integration with a user-specified LLM for generating SQL code using natural language prompts. The package helps the LLM understand the database schema, guides it in writing SQL queries that match the schema, and supports generating, running, and explaining SQL based on natural language prompts. It also facilitates retrieval-augmented generation using vector stores and allows for chatting with the LLM. The DBMS_CLOUD_AI package works with AI providers listed in Select your AI Provider and LLMs.

Note:

Users must have an account with the AI provider and provide their credentials through DBMS_CLOUD_AI objects that the Autonomous Database uses.

Usage Guidelines

Provides usage guidelines that ensure effective and proper usage of natural language prompts for SQL generation to ensure an enhanced user experience.

Intended Use

This feature generates, runs, and explains SQL queries from user-provided natural language prompts. It automates tasks that users would otherwise perform manually using their schema metadata and a large language model (LLM) of their choice. Additionally, it facilitates retrieval-augmented generation with vector stores and enables chatting with the LLM.

While you can provide any prompt, including those unrelated to SQL query results, Select AI supports interaction with LLMs using SQL queries and PL/SQL. Specifically, it generates SQL queries from natural language based on metadata from the specified schema and tables. Additionally, it facilitates chat-based generative AI, optionally enhanced with content from vector stores through retrieval-augmented generation (RAG) for improved response quality. It also explains SQL queries based on natural language prompts and supports synthetic data generation for one or multiple schema tables. Select AI enables submitting general requests with the chat action.

Prompt Augmentation Data

The database augments the user-specified prompt with database metadata to mitigate hallucinations from the LLM. The augmented prompt is then sent to the user-specified LLM to produce the query. When using vector stores with retrieval augmented generation (RAG), content from the vector store is retrieved using semantic similarity search with the provided prompt. This content becomes part of the augmented prompt that is sent to the LLM.

The database augments the prompt with schema metadata only. This metadata may include schema definitions, table and column comments, and content available from the data dictionary. For the purposes of SQL generation, the database does not provide table or view contents (actual row or column values) when augmenting the prompt.

The narrate action, however, does provide the result of the query, which likely contains database data, to the user-specified LLM from which to generate natural language text describing the query results.

WARNING:

Large language models (LLMs) have been trained on a broad set of text documentation and content, typically from the Internet. As a result, LLMs may have incorporated patterns from invalid or malicious content, including SQL injection. Thus, while LLMs are adept at generating useful and relevant content, they also can generate incorrect and false information including SQL queries that produce inaccurate results and/or compromise security of your data.

The queries generated on your behalf by the user-specified LLM provider will be run in your database. Your use of this feature is solely at your own risk, and, notwithstanding any other terms and conditions related to the services provided by Oracle, constitutes your acceptance of that risk and express exclusion of Oracle’s responsibility or liability for any damages resulting from that use.

Supported Platforms

Select AI is supported on Autonomous Database Serverless and Autonomous Database on Dedicated Exadata Infrastructure.

  • Autonomous Database Serverless
  • Autonomous Database on Dedicated Exadata Infrastructure
  • Autonomous Database on Dedicated Exadata Infrastructure Region
  • Autonomous Database Cloud@Customer

Select your AI Provider and LLMs

Choose an AI provider and LLM that meets your security standards and aligns with your specific needs, like text or code generation.

Different LLMs excel at various tasks based on their training data and intended purpose. Some models are excellent for text generation but may not perform well in code generation, while others are specifically optimized for coding tasks. Choose an LLM that best suits your needs.

AI Provider LLMs Embedding Model for RAG Purpose

OCI Generative AI

OCI Generative AI Chat models

  • meta.llama-3-70b-instruct (default)
  • cohere.command-r-16k
  • cohere.command–r-plus

OCI Generative AI Generate text models

  • cohere.command
  • cohere.command-light
  • meta.llama-2-70b-chat

cohere.embed-english-v3.0

The OCI Generative AI Chat models are supported for all SELECT AI actions such as runsql, showsql, explainsql, narrate, and chat.

The OCI Text Generation models are supported only for SELECT AI chat action.

For more details, see Profile Attributes.

Azure OpenAI Service

  • GPT-4o
  • GPT-4
  • GPT-4 Turbo with Vision
  • GPT-3.5-Turbo

text-embedding-ada-002

Best suited for generating SQL from natural language prompts, chat action, and Select AI RAG.

OpenAI

  • gpt-3.5-turbo (default)
  • gpt-4o
  • gpt-4o-mini
  • gpt-4
  • gpt-4-0613
  • gpt-4-32k
  • gpt-4-32k-0613
  • gpt-3.5-turbo-0613
  • gpt-3.5-turbo-16k
  • gpt-3.5-turbo-16k-0613

text-embedding-ada-002

Best suited for generating SQL from natural language prompts, chat action, and Select AI RAG.

Cohere

  • command (default)
  • command-nightly (experimental)
  • command-light
  • command-light-nightly (experimental)
  • custom models

embed-english-v2.0

Best suited for chat action.

Google

  • gemini-1.5-flash (default)
  • gemini-1.5-pro
  • gemini-1.0-pro
text-embedding-004 (default)

Best suited for generating SQL from natural language prompts, chat action, and Select AI RAG.

Note:

Embedding models are also known as transformer models.