You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Select AI Agents on Oracle Autonomous AI Database
1
+
# Using Select AI Agent on Oracle Autonomous AI Database
3
2
4
3
## Overview
5
4
6
-
This repository provides a **generic, extensible framework for building Select AI Agents on Oracle Autonomous AI Database** using the **Select AI Agent framework**.
5
+
This repository provides a set of extensible AI agent templates built using Select AI Agent on Oracle Autonomous AI Database.
6
+
7
+
Select AI Agent enables natural language interactions with enterprise data by combining large language models (LLMs), database-resident tools, and orchestration logic directly inside your database. Agents can reason over user input, invoke tools, and return structured, explainable results while keeping data governance, security, and execution within the database.
7
8
8
-
Select AI Agents enable natural language interactions with enterprise data by combining large language models (LLMs), database-resident tools, and orchestration logic directly inside Oracle Database. Agents can reason over user input, invoke tools, and return structured, explainable results — all while keeping data governance, security, and execution within the database.
9
+
The agents in this repository are templates that you can create and customize for enterprise use cases. While some examples interact with Oracle services, the Select AI Agent framework is not limited to a specific domain and can support many types of agents and workflows.
9
10
10
-
The agents in this repository are **generic Select AI agents**. While some examples may interact with Oracle services, the framework itself is not limited to any specific domain or platform and can support many different types of agents and workflows.
These concepts are represented as database-managed objects in the Select AI Agent framework.
46
+
47
+
| Concept | Definition |
48
+
|------|------------|
49
+
| Agent | An actor with a defined role that performs tasks using the LLM specified in the AI profile. |
50
+
| Task | A set of instructions that guides the LLM to use one or more tools to complete a step in a workflow. |
51
+
| Tool | A capability invoked by a task to perform actions, such as querying databases, calling web services, or sending notifications. |
52
+
| Agent Team | A group of agents with assigned tasks, serving as the unit for deploying and managing agent-based solutions. |
34
53
35
54
---
36
55
37
56
## Design Principles
38
57
39
-
### 1. Two-Layer Architecture
58
+
### Two-Layer Architecture
40
59
41
60
Each agent implementation follows a two-layer model using separate SQL scripts.
42
61
43
-
| Layer | Script Pattern| Purpose |
44
-
|--------------|-----------------|---------|
45
-
| Tools Layer |`*_tools.sql`| Installs core PL/SQL logic and registers Select AI tools |
46
-
| Agent Layer |`*_agent.sql`| Creates a sample Task, Agent, and Team using those tools |
62
+
| Layer | Script Pattern | Purpose |
63
+
|------|----------------|---------|
64
+
| Tools Layer |`*_tools.sql`| Installs core PL/SQL logic and registers Select AI tools |
65
+
| Agent Layer |`*_agent.sql`| Creates sample Task, Agent, and Team objects using those tools |
47
66
48
67
This design provides:
49
68
50
-
-**Tools** that are reusable across multiple agents
51
-
-**Agents** as examples for customizable behavior
52
-
53
-
The clear separation between tools and agents allows infrastructure logic to remain stable while agent behavior can be easily adapted or extended.
69
+
- Reusable tools across multiple agents
70
+
- Agent templates that can be customized for new domains and workflows
71
+
- Clear separation between infrastructure logic and agent behavior
54
72
55
73
---
56
74
@@ -59,56 +77,64 @@ The clear separation between tools and agents allows infrastructure logic to rem
59
77
The repository is organized to align with the Select AI Agent framework:
60
78
61
79
- Tools scripts define and register reusable PL/SQL functions
62
-
- Agent scripts demonstrate how those tools are composed into tasks, agents, and teams
80
+
- Agent scripts compose tools into tasks, agents, and teams
63
81
- Additional agents can be created without modifying existing tools
64
82
65
83
---
66
84
85
+
## Common Prerequisites for All Agents
86
+
87
+
Before installing any agent in this repository, ensure the following baseline prerequisites are met:
88
+
89
+
- Oracle Autonomous AI Database is provisioned
90
+
- Select AI and `DBMS_CLOUD_AI_AGENT` are enabled
91
+
- You are using `ADMIN` or another user with required privileges to create packages, grants, and agent objects
92
+
- Required network access and credentials are available for any external integrations used by the agent
93
+
- A Select AI profile is created using `DBMS_CLOUD_AI.CREATE_PROFILE`
94
+
95
+
Each agent subfolder may include additional service-specific prerequisites.
96
+
97
+
---
98
+
67
99
## Creating a Select AI Profile
68
100
69
-
Before using Autonomous Database AI agents, you must create a Select AI profile using DBMS_CLOUD_AI.
101
+
Before using Select AI Agent objects, create a Select AI profile with `DBMS_CLOUD_AI.CREATE_PROFILE`.
70
102
71
-
Oracle provides several examples demonstrating how to create AI profiles for different providers and models. See the documentation below and follow one of the examples to create your profile:
103
+
A Select AI profile is a configuration object that defines the AI provider and models (LLM and transformer) used by Select AI. It also stores provider metadata, credential references, and behavior settings used at runtime.
Start by reviewing the examples in this documentation and create a profile appropriate for your environment (OCI Generative AI, OpenAI, Azure OpenAI, etc.). The profile name you create will be used later when configuring AI agents.
108
+
Create a profile appropriate for your environment (OCI Generative AI, OpenAI, Azure OpenAI, and others). The profile name is provided later when creating agent objects from `*_agent.sql`.
109
+
110
+
---
77
111
78
112
## Agent Configuration (`SELECTAI_AGENT_CONFIG`)
79
113
80
114
### Overview
81
115
82
-
Select AI agents use a shared configuration table named `SELECTAI_AGENT_CONFIG` to store **agent-specific configuration parameters**.
83
-
84
-
The table is generic and can be used by any Select AI agent (for example, NL2SQL data retrieval agents or other domain-specific agents). Each agent persists only the configuration keys it requires, while default behavior applies when values are not provided.
116
+
`SELECTAI_AGENT_CONFIG` is a shared configuration table used by agent installers and runtime code to store agent-specific parameters.
85
117
86
-
---
118
+
Each agent stores only the keys it needs (for example, credential names, feature flags, compartment names, or integration endpoints). Defaults can still be applied by tool logic when optional values are not present.
87
119
88
120
### Column Description
89
121
90
122
| Column | Description |
91
123
|------|------------|
92
124
|`ID`| System-generated unique identifier |
93
125
|`KEY`| Configuration parameter name |
94
-
|`VALUE`| Configuration value (stored as CLOB) |
95
-
|`AGENT`| Logical name of the Select AI agent(Available in tools)|
126
+
|`VALUE`| Configuration value (stored as `CLOB`) |
127
+
|`AGENT`| Logical agent name used to scope configuration|
96
128
97
129
Configuration entries are uniquely identified by the combination of `KEY` and `AGENT`.
98
130
99
-
---
100
-
101
131
### Writing Configuration Entries
102
132
103
-
Configuration values are written during agent installation or setup.
104
-
Only explicitly provided values are persisted; agents apply internal defaults when values are absent.
105
-
106
-
---
133
+
Configuration values are written during installation or setup.
134
+
Only explicitly provided values are persisted.
107
135
108
136
### Example Configuration Entries
109
137
110
-
#### NL2SQL Data Retrieval Agent
111
-
112
138
```sql
113
139
INSERT INTO SELECTAI_AGENT_CONFIG ("KEY", "VALUE", "AGENT")
Agent installers may accept configuration as JSON input.
148
+
Agent installers may also accept configuration as JSON input:
123
149
124
-
Example:
125
-
126
-
```{
150
+
```json
151
+
{
127
152
"use_resource_principal": true,
128
153
"credential_name": "MY_DB_CREDENTIAL"
129
154
}
130
155
```
131
156
132
-
The installer parses the JSON and stores the relevant values in SELECTAI_AGENT_CONFIG.
157
+
The installer parses the JSON and stores relevant values in `SELECTAI_AGENT_CONFIG`.
133
158
134
159
### Reading Configuration at Runtime
135
160
136
-
At runtime, agents read their configuration from SELECTAI_AGENT_CONFIG and consume it as structured JSON. This allows configuration changes without modifying agent code.
161
+
At runtime, agents read values from `SELECTAI_AGENT_CONFIG` and consume them as structured JSON. This allows configuration changes without modifying agent code.
137
162
163
+
---
138
164
139
165
## Supported Use Cases
140
166
141
-
This framework can be used to build Select AI agents for:
167
+
This framework can be used to build Select AI Agent solutions for:
142
168
143
169
- Natural language to SQL (NL2SQL)
144
170
- Data retrieval and analytics
145
171
- Database administration and monitoring
146
-
- Operational workflows
147
-
- Custom enterprise automation
148
-
149
-
Agents can target database-only workflows, service integrations, or mixed enterprise use cases.
172
+
- OCI and enterprise operational workflows
173
+
- Custom automation with database-native controls
150
174
151
175
---
152
176
153
177
## Compatibility and Release Support
154
178
155
-
Select AI capabilities vary by database release. For details on supported features across Autonomous Database and compatible non-Autonomous Database releases, refer to the official Select AI Capability Matrix:
179
+
Select AI capabilities vary by database release. For supported features across Autonomous Database and compatible non-Autonomous releases, see the Select AI Capability Matrix:
The demo walks through a practical inspection workflow where the agent accepts natural-language prompts, identifies relevant database objects, retrieves metadata and dependencies using tools, and returns structured responses that help developers analyze and troubleshoot code faster.
194
+
195
+
---
196
+
161
197
## Getting Started
162
198
163
199
1. Run the Tools layer scripts to install and register Select AI tools.
164
200
2. Run the Agent layer scripts to create sample tasks, agents, and teams.
165
-
3.Customize existing agents or create new ones by composing available tools.
166
-
4.Extend the framework by adding new tools and agent definitions.
201
+
3.Validate with test prompts for your selected AI profile.
202
+
4.Customize existing templates or build new agents by composing available tools.
167
203
168
204
---
169
205
@@ -177,11 +213,10 @@ This repository is intended for:
177
213
- Platform teams
178
214
- AI practitioners working with Oracle Autonomous AI Database
179
215
180
-
Anyone looking to build secure, database-native AI agents using Select AI can use this repository as a starting point.
181
-
182
216
---
183
217
184
218
## License
185
219
186
-
This project is licensed under the **Universal Permissive License (UPL), Version 1.0**.
220
+
This project is licensed under the Universal Permissive License (UPL), Version 1.0.
Copy file name to clipboardExpand all lines: autonomous-ai-agents/database_inspect/README.md
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
## Overview
4
4
5
-
Select AI Inspect is an AI-powered inspection tool built using the **Select AI Agent** framework. It enables users to explore, understand, and interact with database objects and their metadata using natural language.
5
+
Select AI Inspect is an AI-powered database inspection tool built using the **Select AI Agent** framework. It enables users to explore, understand, and interact with database objects and their metadata using natural language.
6
+
7
+
For definitions of **Tool**, **Task**, **Agent**, and **Agent Team**, see the top-level guide: [README](../README.md#simple-agent-execution-flow).
6
8
7
9
### Use Cases
8
10
@@ -44,6 +46,37 @@ Users may define the inspection scope either at the individual object level or a
44
46
45
47
---
46
48
49
+
## Prerequisites
50
+
51
+
- Oracle Autonomous AI Database (26ai recommended)
52
+
- Select AI and `DBMS_CLOUD_AI_AGENT` enabled
53
+
-`ADMIN` or equivalent privileged user for installation
54
+
- A Select AI profile created with `DBMS_CLOUD_AI.CREATE_PROFILE`
55
+
56
+
---
57
+
58
+
## Installation
59
+
60
+
Before running installation commands:
61
+
62
+
1. Clone or download this repository.
63
+
2. Open a terminal and change directory to `autonomous-ai-agents/database_inspect`.
64
+
3. Choose one execution mode:
65
+
- SQL*Plus/SQLcl: run script files directly with `@script_name`.
66
+
- SQL Worksheet (Database Actions or other SQL IDE): open the `.sql` file and run/paste its contents.
67
+
4. Uploading scripts to `DATA_PUMP_DIR` is not required for these methods.
You can also execute the contents of `database_inspect_tool.sql` and `database_inspect_agent.sql` in SQL Worksheet.
77
+
78
+
---
79
+
47
80
## Architecture Overview
48
81
49
82
Run `database_inspect_tool.sql` to install `DATABASE_INSPECT` package and tools
@@ -193,3 +226,11 @@ This schema includes more than 10 tables, such as customers, products, orders, a
193
226
4. Explain what the CHECKOUT_PKG.reprice_order procedure is used for, including its purpose, parameters and business rules.
194
227
5. Can you write and run a test script for the calc_tax_amount function to verify the results and check for any bugs?
195
228
6. When I call the calc_tax_amount function, for state_code = 'CA' (rate 0.0825), calc_tax_amount(10.01, 'CA') returns 0.82, but it should return 0.83. Please debug the function and show me the exact code that needs to be fixed.
0 commit comments