Select AI for Python
Select AI for Python enables you to ask questions of your database data using natural language (text-to-SQL), get generative AI responses using your trusted content (retrieval augmented generation), generate synthetic data using large language models, and other features – all from Python. With the general availability of Select AI Python, Python developers have access to the functionality of Select AI on Oracle Autonomous Database.
Select AI for Python enables you to leverage the broader Python ecosystem in combination with generative AI and database functionality - bridging the gap between the DBMS_CLOUD_AI PL/SQL package and Python's rich ecosystem. It provides intuitive objects and methods for AI model interaction.
Installation
Install the Python package:
python3 -m pip install select_ai
Install the optional command line interface:
python3 -m pip install 'select_ai[cli]'
Documentation
See Select AI for Python documentation
Samples
Examples can be found in the /samples directory
Command Line Interface
The optional select-ai command provides an interactive chat REPL for Select AI
profiles:
select-ai chat --profile OCI_AI_PROFILE
Basic Example
import select_ai
user = "<your_select_ai_user>"
password = "<your_select_ai_password>"
dsn = "<your_select_ai_db_connect_string>"
select_ai.connect(user=user, password=password, dsn=dsn)
profile = select_ai.Profile(profile_name="oci_ai_profile")
# run_sql returns a pandas dataframe
df = profile.run_sql(prompt="How many promotions?")
print(df.columns)
print(df)
Async Example
import asyncio
import select_ai
user = "<your_select_ai_user>"
password = "<your_select_ai_password>"
dsn = "<your_select_ai_db_connect_string>"
# This example shows how to asynchronously run sql
async def main():
await select_ai.async_connect(user=user, password=password, dsn=dsn)
async_profile = await select_ai.AsyncProfile(
profile_name="async_oci_ai_profile",
)
# run_sql returns a pandas df
df = await async_profile.run_sql("How many promotions?")
print(df)
asyncio.run(main())
Help
Questions can be asked in GitHub Discussions.
Problem reports can be raised in GitHub Issues.
Contributing
This project welcomes contributions from the community. Before submitting a pull request, please review our contribution guide
Security
Please consult the security guide for our responsible security vulnerability disclosure process
License
Copyright (c) 2025 Oracle and/or its affiliates.
Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.
Metadata
Release files for select-ai 1.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| select_ai-1.4.1.tar.gz | 171.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| select_ai-1.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 236.4 kB
Release files / select_ai-1.4.1.tar.gz
| Download URL | select_ai-1.4.1.tar.gz |
|---|---|
| Size | 171.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b75cc6566d045f8ef22bb944624dc2f2080e921db971bb7118520f1e404a3d18
|
|
BLAKE2b-256 checksum How to use checksums |
e7b5f2b9bf6b0cc190350f7cfc8efd41d2cc0714326a103930c22a2a6e5b10da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.
Transparency logRelease files / select_ai-1.4.1-py3-none-any.whl
| Download URL | select_ai-1.4.1-py3-none-any.whl |
|---|---|
| Size | 65.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0400330e62e10549728a5fafbab22513e09e4ab89073e105eae5c9b8da9e54b9
|
|
BLAKE2b-256 checksum How to use checksums |
404cb0c74cd37d62493487ea367e86b9557880e41b00246b4ab7d8b0cb15c209
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.
Transparency log