Skip to content

Commit a272994

Browse files
authored
Merge pull request #65 from sandeepkhot/JIRA_INSPECT_AGENT
Jira Inspect Agent V1
2 parents fddb751 + 1b9ac70 commit a272994

20 files changed

+1699
-106
lines changed

autonomous-ai-agents/README.md

Lines changed: 96 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,74 @@
1-
2-
# Select AI Agents on Oracle Autonomous AI Database
1+
# Using Select AI Agent on Oracle Autonomous AI Database
32

43
## Overview
54

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.
78

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.
910

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.
11+
For product details, see:
12+
https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/select-ai-agent.html
1113

1214
---
1315

1416
## What is a Select AI Agent?
1517

16-
Select AI Agents are part of the Oracle Autonomous AI Database Select AI framework. A Select AI Agent:
18+
Select AI Agent is part of Oracle Autonomous AI Database and extends core Select AI capabilities, including NL2SQL and RAG.
1719

18-
- Accepts natural language input from users
20+
A Select AI Agent:
21+
22+
- Accepts natural language input from users or programs
1923
- Uses an LLM to reason about the request
20-
- Invokes database-resident tools (PL/SQL functions)
21-
- Executes logic securely inside the database
22-
- Returns structured responses
24+
- Invokes built-in tools and custom tools (enabled using PL/SQL functions)
25+
- Performs logic securely inside the database
26+
- Returns agent responses
2327

2428
Key characteristics of the Select AI Agent framework include:
2529

26-
- Native integration with Oracle Autonomous AI Database
27-
- Tool execution through PL/SQL
28-
- Support for tasks, agents, and teams
30+
- Simple framework to build, deploy, and manage AI agents
31+
- Native database integration to reduce infrastructure and orchestration overhead
32+
- Support for preferred AI models and providers, including private endpoints
33+
- Autoscaling in Oracle Autonomous AI Database
34+
- Support for tools, tasks, agents, and teams
2935
- Centralized governance and monitoring
30-
- Flexibility to build domain-specific or generic agents
3136

32-
For full details, refer to the official documentation:
33-
https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/select-ai-agent.html
37+
---
38+
39+
## Simple Agent Execution Flow
40+
41+
```text
42+
User -> Agent -> Task -> Tool (PL/SQL) -> Database -> Response
43+
```
44+
45+
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. |
3453

3554
---
3655

3756
## Design Principles
3857

39-
### 1. Two-Layer Architecture
58+
### Two-Layer Architecture
4059

4160
Each agent implementation follows a two-layer model using separate SQL scripts.
4261

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 |
4766

4867
This design provides:
4968

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
5472

5573
---
5674

@@ -59,56 +77,64 @@ The clear separation between tools and agents allows infrastructure logic to rem
5977
The repository is organized to align with the Select AI Agent framework:
6078

6179
- 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
6381
- Additional agents can be created without modifying existing tools
6482

6583
---
6684

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+
6799
## Creating a Select AI Profile
68100

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`.
70102

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.
72104

73-
Select AI profile management documentation:
105+
Profile management documentation:
74106
https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/select-ai-manage-profiles.html#GUID-3721296F-14A1-428A-B464-7FA25E9EC8F3
75107

76-
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+
---
77111

78112
## Agent Configuration (`SELECTAI_AGENT_CONFIG`)
79113

80114
### Overview
81115

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.
85117

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.
87119

88120
### Column Description
89121

90122
| Column | Description |
91123
|------|------------|
92124
| `ID` | System-generated unique identifier |
93125
| `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 |
96128

97129
Configuration entries are uniquely identified by the combination of `KEY` and `AGENT`.
98130

99-
---
100-
101131
### Writing Configuration Entries
102132

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.
107135

108136
### Example Configuration Entries
109137

110-
#### NL2SQL Data Retrieval Agent
111-
112138
```sql
113139
INSERT INTO SELECTAI_AGENT_CONFIG ("KEY", "VALUE", "AGENT")
114140
VALUES ('ENABLE_RESOURCE_PRINCIPAL', 'YES', 'NL2SQL_DATA_RETRIEVAL_AGENT');
@@ -119,51 +145,61 @@ VALUES ('CREDENTIAL_NAME', 'MY_DB_CREDENTIAL', 'NL2SQL_DATA_RETRIEVAL_AGENT');
119145

120146
### JSON-Based Configuration Input
121147

122-
Agent installers may accept configuration as JSON input.
148+
Agent installers may also accept configuration as JSON input:
123149

124-
Example:
125-
126-
```{
150+
```json
151+
{
127152
"use_resource_principal": true,
128153
"credential_name": "MY_DB_CREDENTIAL"
129154
}
130155
```
131156

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`.
133158

134159
### Reading Configuration at Runtime
135160

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.
137162

163+
---
138164

139165
## Supported Use Cases
140166

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:
142168

143169
- Natural language to SQL (NL2SQL)
144170
- Data retrieval and analytics
145171
- 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
150174

151175
---
152176

153177
## Compatibility and Release Support
154178

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:
156180

157181
https://docs.oracle.com/en/database/oracle/oracle-database/26/saicm/select-ai-capability-matrix.pdf
158182

159183
---
160184

185+
## Database Inspect Agent Demo Video
186+
187+
Watch this demo video to see the Database Inspect agent in action:
188+
189+
[![Database Inspect Agent Demo Thumbnail](https://objectstorage.eu-frankfurt-1.oraclecloud.com/p/ZF8hVJGpN1RJDwOh1ZkRVJjKgzKdqYKuEDtIT1mekE18seU23DtZVbP5mHyJXQWm/n/dwcsdev/b/select_ai_agent_demo/o/Datbase_Inspect.png)](https://objectstorage.eu-frankfurt-1.oraclecloud.com/p/DqsbbE15HSHZv6LgeqS6yqi4OmxLaeO3ykwZ-DaKAM7yOZ3VDFWjafKk1ghh1k7x/n/dwcsdev/b/select_ai_agent_demo/o/DATABASE_INSPECT_AGENT.mp4)
190+
191+
[▶ Watch Database Inspect Agent Demo](https://objectstorage.eu-frankfurt-1.oraclecloud.com/p/DqsbbE15HSHZv6LgeqS6yqi4OmxLaeO3ykwZ-DaKAM7yOZ3VDFWjafKk1ghh1k7x/n/dwcsdev/b/select_ai_agent_demo/o/DATABASE_INSPECT_AGENT.mp4)
192+
193+
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+
161197
## Getting Started
162198

163199
1. Run the Tools layer scripts to install and register Select AI tools.
164200
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.
167203

168204
---
169205

@@ -177,11 +213,10 @@ This repository is intended for:
177213
- Platform teams
178214
- AI practitioners working with Oracle Autonomous AI Database
179215

180-
Anyone looking to build secure, database-native AI agents using Select AI can use this repository as a starting point.
181-
182216
---
183217

184218
## License
185219

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.
187221
See: https://oss.oracle.com/licenses/upl/
222+
Copyright (c) 2026 Oracle and/or its affiliates.

autonomous-ai-agents/database_inspect/README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Overview
44

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).
68

79
### Use Cases
810

@@ -44,6 +46,37 @@ Users may define the inspection scope either at the individual object level or a
4446

4547
---
4648

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.
68+
69+
Run as `ADMIN` (or another privileged user):
70+
71+
```sql
72+
sqlplus admin@<adb_connect_string> @database_inspect_tool.sql
73+
sqlplus admin@<adb_connect_string> @database_inspect_agent.sql
74+
```
75+
76+
You can also execute the contents of `database_inspect_tool.sql` and `database_inspect_agent.sql` in SQL Worksheet.
77+
78+
---
79+
4780
## Architecture Overview
4881

4982
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
193226
4. Explain what the CHECKOUT_PKG.reprice_order procedure is used for, including its purpose, parameters and business rules.
194227
5. Can you write and run a test script for the calc_tax_amount function to verify the results and check for any bugs?
195228
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.
229+
230+
---
231+
232+
## License
233+
234+
Universal Permissive License (UPL) 1.0
235+
https://oss.oracle.com/licenses/upl/
236+
Copyright (c) 2026 Oracle and/or its affiliates.

0 commit comments

Comments
 (0)