The Oracle AI Optimizer and Toolkit is a free and open-source tool designed to make it easier for developers and data engineers to build, benchmark, and optimize AI workflows running on Oracle Database.
It provides a modular framework for experimenting with model selection, prompt engineering, agents (tool calling), retrieval-augmented generation (RAG), and hybrid query optimization.
In this article, we’ll set up a local, containerized test environment for the AI Optimizer and Toolkit – enabling you to develop and test AI with Oracle Database without writing a single line of SQL.
Prerequisites:
- Docker-compatible container runtime
docker-composeutility for managing Oracle Database Free and AI Optimizer containers.
Download and build the AI Optimizer container
First, clone or download the source code from GitHub. Then, Build the optimizer image from the root of the cloned repository:
git clone https://github.com/oracle/ai-optimizer.git
cd ai-optimizer
docker build -f src/Dockerfile -t ai-optimizer-aio .Configure a minimal docker-compose.yml script for Oracle Database Free and the optimizer image:
services:
ai-optimizer:
image: ai-optimizer-aio:${TAG:-latest}
container_name: ai-optimizer
ports:
- 8501:8501
oraclefree:
image: gvenzl/oracle-free:23.26.0-slim-faststart
container_name: oraclefree
ports:
- 1521:1521
environment:
- ORACLE_PASSWORD=Welcome12345
volumes:
- ./oracle:/container-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "lsnrctl status | grep READY"]
interval: 15s
timeout: 10s
retries: 5
start_period: 30sCreate an oracle directory and place the following grant_permissions.sql script inside it:
-- Set as appropriate for your database.
alter session set container = freepdb1;
create user testuser identified by testpwd;
grant create session to testuser;
grant unlimited tablespace to testuser;
grant connect, resource to testuser;Then, start the containers with docker-compose:
docker-compose up -dOnce the containers start, navigate to the AI Optimizer and Toolkit Streamlit UI in your browser at http://localhost:8501/config:

Configure the AI Optimizer with Oracle Database Free
We’ll now configure the optimizer container so it’s connected to the Oracle Database Free container.

From the optimizer config window, select the “Databases” tab and enter the following information:
- Database User:
testuser - Database Password:
testpwd - Database Connect String:
oraclefree:1521/freepdb1
Then, click “Save Database”. You should see the message “Current Status: Connected” displayed below the database configuration.

The database container is now ready to use for AI development! Check out the next article, Connect LLMs and use your data, for an example of LLM configuration and RAG with private data.

Leave a Reply