1. Introduction to Select AI for Python

select_ai is a Python module that helps you invoke DBMS_CLOUD_AI using Python. It supports text-to-SQL generation, retrieval augmented generation (RAG), synthetic data generation, and several other features using Oracle-based and third-party AI providers.

Select AI for Python bridges Oracle Database’s Select AI capabilities and the Python ecosystem. It gives Python applications a higher-level API for working with AI providers, credentials, profiles, natural language prompts, vector indexes, conversations, summarization, synthetic data, and AI agent workflows.

Select AI A2A server demo from the project README

Connect an A2A client to a Select AI agent team. Follow the A2A guide to run the server.

For a complete setup-to-query example, start with Run your first SQL query. Existing users can review What’s new in 1.5.0 and Compatibility.

1.1. What you can build

Start with the workflow you want to build:

1.2. Core concepts

Most workflows use the same building blocks:

Concept

Purpose

Start here

Connection

Connect to Oracle Database using a standalone connection or a pool.

Connection

Privileges

Grant package privileges and network ACLs required for Select AI calls.

Privileges

Provider

Describe the AI service, model, endpoint, region, or provider-specific options.

Provider

Credential

Store provider and service secrets securely in Oracle Database.

Credential

Sharing and ownership

Share profiles, vector indexes, teams, and credentials with users or roles and address objects owned by another schema.

Sharing and ownership

Profile

Combine provider, credential, database object scope, and generation options into a reusable Select AI profile.

Profile

Actions

Choose what Select AI should do with a prompt, such as show SQL, run SQL, chat, narrate, summarize, or translate.

Actions

Conversation

Keep prompt history for context-aware chat sessions.

Conversation

Vector index

Index document content for RAG over trusted source material.

Vector Index

Agent

Define tools, tasks, agents, and teams for multi-step AI workflows.

Agent

Agent2Agent (A2A)

Expose an agent team as a discoverable service for A2A clients. Choose standalone or clustered deployment and fixed or dynamic connections.

A2A server

1.3. Synchronous and asynchronous APIs

select_ai supports both synchronous and asynchronous programming styles. Use the synchronous APIs for scripts, notebooks, command-line tools, and simple services. Use the asynchronous APIs with asyncio applications, async web frameworks, and workloads that need to run many prompts concurrently.

For long-running services, create a connection pool once during application startup and close it during shutdown. See Connection, Web Frameworks, and Concurrent Prompt Processing for patterns.

1.4. Supported Python versions

The Select AI Python API supports Python versions 3.11, 3.12, 3.13, and 3.14.