Select AI for Python

Select AI for Python integrates generative AI capabilities into Autonomous AI Database workflows. Select AI for Python provides a client library, select_ai, that enables you to use DBMS_CLOUD_AI capabilities in Autonomous AI Database from Python. Select AI for Python supports enhanced generative AI workflows, summarization, feedback mechanisms, consistent metadata management, and agentic AI capabilities. It also supports Python 3.14 and includes an updated HTML documentation site (New)

What You Can Do

  • NL2SQL: Use natural language to query your database through AI-based SQL generation. This includes generating SQL queries, running the generated queries, explaining generated SQL, and narrating query results.

  • RAG: Create and update vector indexes for automated Retrieval Augmented Generation (RAG) workflows that retrieve relevant content and include it in generative AI responses.

    You can monitor refresh cycles using vector_index.get_next_refresh_timestamp() to retrieve the UTC timestamp of the next scheduled refresh.

  • Chat: Create and manage conversations with prompt history to support chat-style interactions with generative AI models.

  • Synthetic Data Generation: Generate synthetic data for testing and analysis using generative AI

  • Summarize: Summarize text or query results

  • Feedback: Record and manage model feedback

  • Translate: Translate text between languages

  • AI Agents: Create autonomous and interaction AI agents. See Select AI Agent for Python for details.

  • Sync and Async connections: Connect to the database using synchronous or asynchronous connections

    You can use select_ai.create_pool() and select_ai.create_pool_async() to create shared connection pools for improved concurrency and resource sharing.

  • AI Profiles: Create and manage AI profiles to enable using AI models from a wide range of AI providers

Supported Platforms

Select AI for Python is certified for Autonomous AI Database 26ai and 19c. Select AI for Python may work on other platforms, however, it is not certified.

Click https://github.com/oracle/python-select-ai/issues to report issues.

Supported Functions for Select AI Profile (Synchronous and Asynchronous)

When you send prompts through a profile, you can choose among several functions defined for AI profile objects. Some are as follows:

For a complete list of functions, see Select AI for Python guide. See also Use AI Keyword to Enter Prompts for more information on the Select AI actions.

Supported Classes

The library includes classes to manage providers, profiles, conversations, vector indexes, synthetic data, and agentic workflows. Both synchronous and asynchronous versions are available.

  • Provider Classes: Define AI provider: OpenAIProvider, AzureProvider, OCIGenAIProvider, AWSProvider, GoogleProvider, AnthropicProvider, CohereProvider, HuggingFaceProvider.

  • Profile: defines the generative AI profile to process prompts (provider, credentials, metadata, options) and supports synthetic data generation.

  • ProfileAttributes: profile configuration details such as provider, credential name, max tokens, temperature, object list, or vector index.

  • ConversationAttributes: manage conversational context across prompts.

  • VectorIndex and VectorIndexAttributes: create and manage vector indexes for RAG.

    The create() API supports a wait_for_completion parameter. Use this parameter to control whether the call waits for completion before returning. For more information, see CREATE_VECTOR_INDEX Procedure for more details.

  • SyntheticDataAttributes: create synthetic datasets for testing and development.

  • Class-level delete methods: These class-level methods delete database objects directly without requiring initialization of a proxy object.

    • Profile.delete_profile(profile_name)

    • VectorIndex.delete_index(index_name)

    For Select AI Agent related class-level delete methods, see Select AI Agent for Python.

Asynchronous equivalents exist for Profile, Conversation, and VectorIndex classes.

Async Select AI Support

Select AI for Python provides asynchronous APIs that enable interaction with Autonomous AI Database. These APIs use Python’s async and await constructs and support coroutine-based applications.

Async APIs are available for the following key objects in the library:
  • AsyncProfile

  • AsyncConversation

  • AsyncVectorIndex

Use select_ai.create_pool_async() to manage connections in asynchronous workflows.

These classes provide functionality equivalent to their synchronous counterparts. Async APIs are useful in applications that require concurrent operations or event-driven workflows.

For complete API reference, see Select AI for Python guide.

API and Attribute Update Enhancements

The following enhancements are available:

  • All proxy objects support fetch() to retrieve existing objects.

  • All proxy objects provide set_attribute() and set_attributes() for consistent updates

  • All tool creation APIs support an instruction parameter to define precise run behavior.

Privilege and HTTP Access

Privilege management is separate from HTTP access configuration.

Privilege APIs:

  • select_ai.grant_privileges
  • select_ai.revoke_privileges
Privileges are updated to include:
  • DBMS_CLOUD
  • DBMS_CLOUD_AI
  • DBMS_CLOUD_AI_AGENT
  • DBMS_CLOUD_PIPELINE

HTTP access APIs:

  • select_ai.grant_http_access
  • select_ai.revoke_http_access

Other Enhancements