diff --git a/autonomous-ai-agents/README.md b/autonomous-ai-agents/README.md index 1c66a7d..45fc2cc 100644 --- a/autonomous-ai-agents/README.md +++ b/autonomous-ai-agents/README.md @@ -1,56 +1,74 @@ - -# Select AI Agents on Oracle Autonomous AI Database +# Using Select AI Agent on Oracle Autonomous AI Database ## Overview -This repository provides a **generic, extensible framework for building Select AI Agents on Oracle Autonomous AI Database** using the **Select AI Agent framework**. +This repository provides a set of extensible AI agent templates built using Select AI Agent on Oracle Autonomous AI Database. + +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. -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. +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. -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. +For product details, see: +https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/select-ai-agent.html --- ## What is a Select AI Agent? -Select AI Agents are part of the Oracle Autonomous AI Database Select AI framework. A Select AI Agent: +Select AI Agent is part of Oracle Autonomous AI Database and extends core Select AI capabilities, including NL2SQL and RAG. -- Accepts natural language input from users +A Select AI Agent: + +- Accepts natural language input from users or programs - Uses an LLM to reason about the request -- Invokes database-resident tools (PL/SQL functions) -- Executes logic securely inside the database -- Returns structured responses +- Invokes built-in tools and custom tools (enabled using PL/SQL functions) +- Performs logic securely inside the database +- Returns agent responses Key characteristics of the Select AI Agent framework include: -- Native integration with Oracle Autonomous AI Database -- Tool execution through PL/SQL -- Support for tasks, agents, and teams +- Simple framework to build, deploy, and manage AI agents +- Native database integration to reduce infrastructure and orchestration overhead +- Support for preferred AI models and providers, including private endpoints +- Autoscaling in Oracle Autonomous AI Database +- Support for tools, tasks, agents, and teams - Centralized governance and monitoring -- Flexibility to build domain-specific or generic agents -For full details, refer to the official documentation: -https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/select-ai-agent.html +--- + +## Simple Agent Execution Flow + +```text +User -> Agent -> Task -> Tool (PL/SQL) -> Database -> Response +``` + +These concepts are represented as database-managed objects in the Select AI Agent framework. + +| Concept | Definition | +|------|------------| +| Agent | An actor with a defined role that performs tasks using the LLM specified in the AI profile. | +| Task | A set of instructions that guides the LLM to use one or more tools to complete a step in a workflow. | +| Tool | A capability invoked by a task to perform actions, such as querying databases, calling web services, or sending notifications. | +| Agent Team | A group of agents with assigned tasks, serving as the unit for deploying and managing agent-based solutions. | --- ## Design Principles -### 1. Two-Layer Architecture +### Two-Layer Architecture Each agent implementation follows a two-layer model using separate SQL scripts. -| Layer | Script Pattern | Purpose | -|--------------|-----------------|---------| -| Tools Layer | `*_tools.sql` | Installs core PL/SQL logic and registers Select AI tools | -| Agent Layer | `*_agent.sql` | Creates a sample Task, Agent, and Team using those tools | +| Layer | Script Pattern | Purpose | +|------|----------------|---------| +| Tools Layer | `*_tools.sql` | Installs core PL/SQL logic and registers Select AI tools | +| Agent Layer | `*_agent.sql` | Creates sample Task, Agent, and Team objects using those tools | This design provides: -- **Tools** that are reusable across multiple agents -- **Agents** as examples for customizable behavior - -The clear separation between tools and agents allows infrastructure logic to remain stable while agent behavior can be easily adapted or extended. +- Reusable tools across multiple agents +- Agent templates that can be customized for new domains and workflows +- Clear separation between infrastructure logic and agent behavior --- @@ -59,31 +77,45 @@ The clear separation between tools and agents allows infrastructure logic to rem The repository is organized to align with the Select AI Agent framework: - Tools scripts define and register reusable PL/SQL functions -- Agent scripts demonstrate how those tools are composed into tasks, agents, and teams +- Agent scripts compose tools into tasks, agents, and teams - Additional agents can be created without modifying existing tools --- +## Common Prerequisites for All Agents + +Before installing any agent in this repository, ensure the following baseline prerequisites are met: + +- Oracle Autonomous AI Database is provisioned +- Select AI and `DBMS_CLOUD_AI_AGENT` are enabled +- You are using `ADMIN` or another user with required privileges to create packages, grants, and agent objects +- Required network access and credentials are available for any external integrations used by the agent +- A Select AI profile is created using `DBMS_CLOUD_AI.CREATE_PROFILE` + +Each agent subfolder may include additional service-specific prerequisites. + +--- + ## Creating a Select AI Profile -Before using Autonomous Database AI agents, you must create a Select AI profile using DBMS_CLOUD_AI. +Before using Select AI Agent objects, create a Select AI profile with `DBMS_CLOUD_AI.CREATE_PROFILE`. -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: +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. -Select AI profile management documentation: +Profile management documentation: https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/select-ai-manage-profiles.html#GUID-3721296F-14A1-428A-B464-7FA25E9EC8F3 -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. +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`. + +--- ## Agent Configuration (`SELECTAI_AGENT_CONFIG`) ### Overview -Select AI agents use a shared configuration table named `SELECTAI_AGENT_CONFIG` to store **agent-specific configuration parameters**. - -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. +`SELECTAI_AGENT_CONFIG` is a shared configuration table used by agent installers and runtime code to store agent-specific parameters. ---- +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. ### Column Description @@ -91,24 +123,18 @@ The table is generic and can be used by any Select AI agent (for example, NL2SQL |------|------------| | `ID` | System-generated unique identifier | | `KEY` | Configuration parameter name | -| `VALUE` | Configuration value (stored as CLOB) | -| `AGENT` | Logical name of the Select AI agent(Available in tools) | +| `VALUE` | Configuration value (stored as `CLOB`) | +| `AGENT` | Logical agent name used to scope configuration | Configuration entries are uniquely identified by the combination of `KEY` and `AGENT`. ---- - ### Writing Configuration Entries -Configuration values are written during agent installation or setup. -Only explicitly provided values are persisted; agents apply internal defaults when values are absent. - ---- +Configuration values are written during installation or setup. +Only explicitly provided values are persisted. ### Example Configuration Entries -#### NL2SQL Data Retrieval Agent - ```sql INSERT INTO SELECTAI_AGENT_CONFIG ("KEY", "VALUE", "AGENT") VALUES ('ENABLE_RESOURCE_PRINCIPAL', 'YES', 'NL2SQL_DATA_RETRIEVAL_AGENT'); @@ -119,51 +145,61 @@ VALUES ('CREDENTIAL_NAME', 'MY_DB_CREDENTIAL', 'NL2SQL_DATA_RETRIEVAL_AGENT'); ### JSON-Based Configuration Input -Agent installers may accept configuration as JSON input. +Agent installers may also accept configuration as JSON input: -Example: - -```{ +```json +{ "use_resource_principal": true, "credential_name": "MY_DB_CREDENTIAL" } ``` -The installer parses the JSON and stores the relevant values in SELECTAI_AGENT_CONFIG. +The installer parses the JSON and stores relevant values in `SELECTAI_AGENT_CONFIG`. ### Reading Configuration at Runtime -At runtime, agents read their configuration from SELECTAI_AGENT_CONFIG and consume it as structured JSON. This allows configuration changes without modifying agent code. +At runtime, agents read values from `SELECTAI_AGENT_CONFIG` and consume them as structured JSON. This allows configuration changes without modifying agent code. +--- ## Supported Use Cases -This framework can be used to build Select AI agents for: +This framework can be used to build Select AI Agent solutions for: - Natural language to SQL (NL2SQL) - Data retrieval and analytics - Database administration and monitoring -- Operational workflows -- Custom enterprise automation - -Agents can target database-only workflows, service integrations, or mixed enterprise use cases. +- OCI and enterprise operational workflows +- Custom automation with database-native controls --- ## Compatibility and Release Support -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: +Select AI capabilities vary by database release. For supported features across Autonomous Database and compatible non-Autonomous releases, see the Select AI Capability Matrix: https://docs.oracle.com/en/database/oracle/oracle-database/26/saicm/select-ai-capability-matrix.pdf --- +## Database Inspect Agent Demo Video + +Watch this demo video to see the Database Inspect agent in action: + +[![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) + +[▶ 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) + +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. + +--- + ## Getting Started 1. Run the Tools layer scripts to install and register Select AI tools. 2. Run the Agent layer scripts to create sample tasks, agents, and teams. -3. Customize existing agents or create new ones by composing available tools. -4. Extend the framework by adding new tools and agent definitions. +3. Validate with test prompts for your selected AI profile. +4. Customize existing templates or build new agents by composing available tools. --- @@ -177,11 +213,10 @@ This repository is intended for: - Platform teams - AI practitioners working with Oracle Autonomous AI Database -Anyone looking to build secure, database-native AI agents using Select AI can use this repository as a starting point. - --- ## License -This project is licensed under the **Universal Permissive License (UPL), Version 1.0**. +This project is licensed under the Universal Permissive License (UPL), Version 1.0. See: https://oss.oracle.com/licenses/upl/ +Copyright (c) 2026 Oracle and/or its affiliates. diff --git a/autonomous-ai-agents/database_inspect/README.md b/autonomous-ai-agents/database_inspect/README.md index 74919a2..8f3df2e 100644 --- a/autonomous-ai-agents/database_inspect/README.md +++ b/autonomous-ai-agents/database_inspect/README.md @@ -2,7 +2,9 @@ ## Overview -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. +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. + +For definitions of **Tool**, **Task**, **Agent**, and **Agent Team**, see the top-level guide: [README](../README.md#simple-agent-execution-flow). ### Use Cases @@ -44,6 +46,37 @@ Users may define the inspection scope either at the individual object level or a --- +## Prerequisites + +- Oracle Autonomous AI Database (26ai recommended) +- Select AI and `DBMS_CLOUD_AI_AGENT` enabled +- `ADMIN` or equivalent privileged user for installation +- A Select AI profile created with `DBMS_CLOUD_AI.CREATE_PROFILE` + +--- + +## Installation + +Before running installation commands: + +1. Clone or download this repository. +2. Open a terminal and change directory to `autonomous-ai-agents/database_inspect`. +3. Choose one execution mode: + - SQL*Plus/SQLcl: run script files directly with `@script_name`. + - SQL Worksheet (Database Actions or other SQL IDE): open the `.sql` file and run/paste its contents. +4. Uploading scripts to `DATA_PUMP_DIR` is not required for these methods. + +Run as `ADMIN` (or another privileged user): + +```sql +sqlplus admin@ @database_inspect_tool.sql +sqlplus admin@ @database_inspect_agent.sql +``` + +You can also execute the contents of `database_inspect_tool.sql` and `database_inspect_agent.sql` in SQL Worksheet. + +--- + ## Architecture Overview 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 4. Explain what the CHECKOUT_PKG.reprice_order procedure is used for, including its purpose, parameters and business rules. 5. Can you write and run a test script for the calc_tax_amount function to verify the results and check for any bugs? 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. + +--- + +## License + +Universal Permissive License (UPL) 1.0 +https://oss.oracle.com/licenses/upl/ +Copyright (c) 2026 Oracle and/or its affiliates. diff --git a/autonomous-ai-agents/jira_inspect/README.md b/autonomous-ai-agents/jira_inspect/README.md new file mode 100644 index 0000000..e370a67 --- /dev/null +++ b/autonomous-ai-agents/jira_inspect/README.md @@ -0,0 +1,234 @@ +# Select AI - Jira AI Agent & Tools + +## Overview + +## Jira Integration + +Jira integration in this project connects Oracle Autonomous AI Database to Atlassian Jira Cloud APIs through `DBMS_CLOUD`, then exposes those operations as Select AI tools via `DBMS_CLOUD_AI_AGENT`. + +The **Select AI Jira Agent** enables conversational Jira operations such as issue search, issue inspection, assignee lookup, comments/changelog/worklog retrieval, project lookup, user lookup, and board discovery. + +Runtime connection settings are stored in `SELECTAI_AGENT_CONFIG` under agent key `JIRA`, so credentials and Jira Cloud ID are centrally managed and not passed as user inputs on every tool call. + +For definitions of **Tool**, **Task**, **Agent**, and **Agent Team**, see the top-level guide: [README](../README.md#simple-agent-execution-flow). + +--- + +## Why a Select AI Jira Agent? + +Jira API usage usually requires: +- API endpoint familiarity +- Correct query/JQL construction +- Repeated handling of auth and cloud identifiers +- Multi-step workflows for assignee and issue analysis + +This agent streamlines those steps into guided conversational workflows while preserving clear tool boundaries and auditable behavior. + +--- + +## Architecture Overview + +```text +User Request + ↓ +JIRA_TASKS + ↓ +JIRA_ADVISOR Reasoning & Validation + ├── SEARCH_JIRA_TOOL + ├── GET_JIRA_TOOL + ├── GET_ASSIGNEE_ACCOUNT_ID_TOOL + ├── GET_JIRA_ASSIGNED_ISSUES_TOOL + ├── GET_JIRA_COMMENTS_TOOL + ├── GET_JIRA_CHANGELOG_TOOL + ├── GET_JIRA_WORKLOG_TOOL + ├── GET_JIRA_PROJECT_TOOL + ├── GET_ATLASSIAN_USER_TOOL + └── GET_JIRA_BOARDS_TOOL + ↓ +Formatted Jira/Atlassian Response +``` + +--- + +## Repository Contents + +```text +. +├── jira_inspect_tools.sql +│ ├── Configuration bootstrap (SELECTAI_AGENT_CONFIG) +│ ├── Jira API wrapper package (jira_selectai) +│ ├── Agent package (select_ai_jira_agent) +│ └── Jira AI tool registrations +│ +├── jira_inspect_agent.sql +│ ├── Task definition (JIRA_TASKS) +│ ├── Agent creation (JIRA_ADVISOR) +│ ├── Team creation (JIRA_INSPECT_TEAM) +│ └── AI profile binding +│ +└── README.md +``` + +--- + +## Prerequisites + +- Oracle Autonomous AI Database (26ai recommended) +- Select AI / `DBMS_CLOUD_AI_AGENT` enabled +- Jira Cloud access +- Atlassian credential created in database (`DBMS_CLOUD` credential) +- Jira Cloud ID +- ADMIN (or equivalent privileged user) for installation + +--- + +## Installation – Tools + +Before running installation commands: + +1. Clone or download this repository. +2. Open a terminal and change directory to `autonomous-ai-agents/jira_inspect`. +3. Choose one execution mode: + - SQL*Plus/SQLcl: run script files directly with `@script_name`. + - SQL Worksheet (Database Actions or other SQL IDE): open the `.sql` file and run/paste its contents. +4. Uploading scripts to `DATA_PUMP_DIR` is not required for these methods. + +Run as `ADMIN` (or another privileged user): + +```sql +sqlplus admin@ @jira_inspect_tools.sql +``` + +### Optional Configuration JSON + +```json +{ + "credential_name": "ATLASSIAN_CRED", + "cloud_id": "your-jira-cloud-id" +} +``` + +> Configuration is stored in `SELECTAI_AGENT_CONFIG` for `AGENT='JIRA'`. + +### What This Script Does + +- Grants required package privileges +- Creates/updates `SELECTAI_AGENT_CONFIG` +- Persists `CREDENTIAL_NAME` and `CLOUD_ID` for `JIRA` +- Creates package `jira_selectai` +- Creates package `select_ai_jira_agent` +- Registers all Jira AI tools + +--- + +## Available AI Tools (High-Level) + +### Issue Search & Retrieval +- `SEARCH_JIRA_TOOL` +- `GET_JIRA_TOOL` + +### Assignee Workflows +- `GET_ASSIGNEE_ACCOUNT_ID_TOOL` +- `GET_JIRA_ASSIGNED_ISSUES_TOOL` + +### Issue Activity +- `GET_JIRA_COMMENTS_TOOL` +- `GET_JIRA_CHANGELOG_TOOL` +- `GET_JIRA_WORKLOG_TOOL` + +### Project, User, and Boards +- `GET_JIRA_PROJECT_TOOL` +- `GET_ATLASSIAN_USER_TOOL` +- `GET_JIRA_BOARDS_TOOL` + +--- + +## Installation – Agent & Team + +From `autonomous-ai-agents/jira_inspect`, run after tools installation: + +```sql +sqlplus admin@ @jira_inspect_agent.sql +``` + +You can also execute the contents of `jira_inspect_agent.sql` in SQL Worksheet. + +### Prompts + +- Target schema name +- AI profile name + +### Objects Created + +| Object | Name | +|--------|------| +| Task | `JIRA_TASKS` | +| Agent | `JIRA_ADVISOR` | +| Team | `JIRA_INSPECT_TEAM` | + +--- + +## Task Intelligence Highlights + +The Jira task is configured to: +- Interpret intent and pick the right Jira tool +- Ask for only missing business inputs +- Use human tool escalation when required +- Return human-readable output summaries + +--- + +## Example Prompts + +### Issue Search & Details +- "Search Jira issues for `payment timeout`." +- "Get details for issue `FIN-123`." + +### Assignee Analysis +- "Find Jira account ID for assignee `john.doe@company.com`." +- "List issues assigned to account ID ``." + +### Activity History +- "Get comments for `FIN-123`." +- "Get changelog for `FIN-123`." +- "Get worklog for `FIN-123`." + +### Project/User/Boards +- "Get project details for `FIN`." +- "Get Atlassian user details for ``." +- "List Jira boards for project `FIN`." + +--- + +## Best Practices + +- Keep Jira credentials scoped with least privilege +- Store only required runtime values in `SELECTAI_AGENT_CONFIG` +- Separate read-only and operational agents when needed +- Validate assignee identity before assignment-based reporting + +--- + +## Troubleshooting + +- If tools return config errors, verify `SELECTAI_AGENT_CONFIG` contains: + - `CREDENTIAL_NAME` for `AGENT='JIRA'` + - `CLOUD_ID` for `AGENT='JIRA'` +- If API calls fail, verify: + - Credential validity/token freshness + - Jira Cloud ID correctness + - Jira permission scope for the calling identity + +--- + +## License + +Universal Permissive License (UPL) 1.0 +https://oss.oracle.com/licenses/upl/ +Copyright (c) 2026 Oracle and/or its affiliates. + +--- + +## Final Thoughts + +The Jira AI Agent provides a clean operational bridge between Select AI and Jira APIs, making issue intelligence workflows faster and easier to standardize across teams. diff --git a/autonomous-ai-agents/jira_inspect/jira_inspect_agent.sql b/autonomous-ai-agents/jira_inspect/jira_inspect_agent.sql new file mode 100644 index 0000000..b82c4b1 --- /dev/null +++ b/autonomous-ai-agents/jira_inspect/jira_inspect_agent.sql @@ -0,0 +1,217 @@ +rem ============================================================================ +rem LICENSE +rem Copyright (c) 2026 Oracle and/or its affiliates. +rem Licensed under the Universal Permissive License (UPL), Version 1.0 +rem https://oss.oracle.com/licenses/upl/ +rem +rem NAME +rem jira_inspect_agent.sql +rem +rem DESCRIPTION +rem Installer and configuration script for Jira AI Agent Team +rem using DBMS_CLOUD_AI_AGENT (Select AI / Oracle AI Database). +rem +rem This script performs interactive installation of Jira task, +rem agent, and team by: +rem - Prompting for target schema and AI profile +rem - Granting required privileges to target schema +rem - Creating installer procedure in target schema +rem - Registering Jira task with supported Jira tools +rem - Creating Jira AI agent bound to AI profile +rem - Creating Jira team linking the agent and task +rem +rem RELEASE VERSION +rem 1.0 +rem +rem RELEASE DATE +rem 20-Feb-2026 +rem +rem MAJOR CHANGES IN THIS RELEASE +rem - Initial release +rem - Added Jira task, agent, and team registration +rem - Interactive installer with schema and AI profile prompts +rem +rem SCRIPT STRUCTURE +rem 1. Initialization: +rem - Enable output and error handling +rem - Prompt for target schema and AI profile +rem +rem 2. Grants: +rem - Grant DBMS_CLOUD_AI_AGENT and DBMS_CLOUD privileges +rem to the target schema +rem +rem 3. Installer Procedure Creation: +rem - Create INSTALL_JIRA_AGENT procedure in target schema +rem +rem 4. AI Registration: +rem - Drop and create JIRA_TASKS +rem - Drop and create JIRA_ADVISOR agent +rem - Drop and create JIRA_INSPECT_TEAM +rem +rem 5. Execution: +rem - Execute installer procedure with AI profile parameter +rem +rem INSTALL INSTRUCTIONS +rem 1. Run jira_inspect_tools.sql first. +rem +rem 2. Connect as ADMIN or a privileged user. +rem +rem 3. Run the script using SQL*Plus or SQLcl: +rem +rem sqlplus admin@db @jira_inspect_agent.sql +rem +rem 4. Provide inputs when prompted: +rem - Target schema name +rem - AI Profile name +rem +rem PARAMETERS +rem SCHEMA_NAME (Prompted) +rem Target schema where the installer procedure, +rem task, agent, and team are created. +rem +rem AI_PROFILE_NAME (Prompted) +rem AI Profile name used to bind the Jira agent. +rem +rem NOTES +rem - Script can be re-run; existing Jira task, agent, +rem and team are dropped and recreated. +rem +rem ============================================================================ + +SET SERVEROUTPUT ON +SET VERIFY OFF + +PROMPT ====================================================== +PROMPT Jira AI Agent Installer +PROMPT ====================================================== + +VAR v_schema VARCHAR2(128) +EXEC :v_schema := '&SCHEMA_NAME'; + +VAR v_ai_profile_name VARCHAR2(128) +EXEC :v_ai_profile_name := '&AI_PROFILE_NAME'; + +DECLARE + l_sql VARCHAR2(500); +BEGIN + l_sql := 'GRANT EXECUTE ON DBMS_CLOUD_AI_AGENT TO ' || :v_schema; + EXECUTE IMMEDIATE l_sql; + + l_sql := 'GRANT EXECUTE ON DBMS_CLOUD_AI TO ' || :v_schema; + EXECUTE IMMEDIATE l_sql; + + l_sql := 'GRANT EXECUTE ON DBMS_CLOUD TO ' || :v_schema; + EXECUTE IMMEDIATE l_sql; + + DBMS_OUTPUT.PUT_LINE('Grants completed.'); +END; +/ + +BEGIN + EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = ' || :v_schema; +END; +/ + +CREATE OR REPLACE PROCEDURE install_jira_agent( + p_profile_name IN VARCHAR2 +) +AUTHID DEFINER +AS +BEGIN + DBMS_OUTPUT.PUT_LINE('--------------------------------------------'); + DBMS_OUTPUT.PUT_LINE('Starting Jira AI installation'); + DBMS_OUTPUT.PUT_LINE('--------------------------------------------'); + + BEGIN + DBMS_CLOUD_AI_AGENT.DROP_TASK('JIRA_TASKS'); + EXCEPTION + WHEN OTHERS THEN + NULL; + END; + + DBMS_CLOUD_AI_AGENT.CREATE_TASK( + task_name => 'JIRA_TASKS', + description => 'Task for Jira issue search and Jira metadata retrieval', + attributes => '{ + "instruction": "Identify the user request and choose the right Jira tool. ' + || 'Ask only for missing business inputs. ' + || 'Use SEARCH_JIRA_TOOL to find issues by keyword. ' + || 'Use GET_JIRA_TOOL for issue details by key. ' + || 'Use GET_ASSIGNEE_ACCOUNT_ID_TOOL to resolve assignee account id. ' + || 'Use GET_JIRA_ASSIGNED_ISSUES_TOOL for assignee issue lists. ' + || 'Use GET_JIRA_COMMENTS_TOOL, GET_JIRA_CHANGELOG_TOOL, and GET_JIRA_WORKLOG_TOOL for issue history. ' + || 'Use GET_JIRA_PROJECT_TOOL for project metadata. ' + || 'Use GET_ATLASSIAN_USER_TOOL for user profile lookup. ' + || 'Use GET_JIRA_BOARDS_TOOL for board metadata. ' + || 'Present results clearly and in human-readable format. ' + || 'User request: {query}", + "tools": [ + "SEARCH_JIRA_TOOL", + "GET_JIRA_TOOL", + "GET_ASSIGNEE_ACCOUNT_ID_TOOL", + "GET_JIRA_ASSIGNED_ISSUES_TOOL", + "GET_JIRA_COMMENTS_TOOL", + "GET_JIRA_CHANGELOG_TOOL", + "GET_JIRA_WORKLOG_TOOL", + "GET_JIRA_PROJECT_TOOL", + "GET_ATLASSIAN_USER_TOOL", + "GET_JIRA_BOARDS_TOOL" + ], + "enable_human_tool": "true" + }' + ); + DBMS_OUTPUT.PUT_LINE('Created task JIRA_TASKS'); + + BEGIN + DBMS_CLOUD_AI_AGENT.DROP_AGENT('JIRA_ADVISOR'); + DBMS_OUTPUT.PUT_LINE('Dropped agent JIRA_ADVISOR'); + EXCEPTION + WHEN OTHERS THEN + DBMS_OUTPUT.PUT_LINE('Agent JIRA_ADVISOR does not exist, skipping'); + END; + + DBMS_CLOUD_AI_AGENT.CREATE_AGENT( + agent_name => 'JIRA_ADVISOR', + attributes => + '{' || + '"profile_name":"' || p_profile_name || '",' || + '"role":"You are a Jira Advisor. You help users search issues and inspect Jira metadata. You call Jira tools based on intent and present clean summaries."' || + '}', + description => 'AI agent for Jira search and metadata retrieval' + ); + DBMS_OUTPUT.PUT_LINE('Created agent JIRA_ADVISOR'); + + BEGIN + DBMS_CLOUD_AI_AGENT.DROP_TEAM('JIRA_INSPECT_TEAM'); + DBMS_OUTPUT.PUT_LINE('Dropped team JIRA_INSPECT_TEAM'); + EXCEPTION + WHEN OTHERS THEN + DBMS_OUTPUT.PUT_LINE('Team JIRA_INSPECT_TEAM does not exist, skipping'); + END; + + DBMS_CLOUD_AI_AGENT.CREATE_TEAM( + team_name => 'JIRA_INSPECT_TEAM', + attributes => '{ + "agents":[{"name":"JIRA_ADVISOR","task":"JIRA_TASKS"}], + "process":"sequential" + }' + ); + DBMS_OUTPUT.PUT_LINE('Created team JIRA_INSPECT_TEAM'); + + DBMS_OUTPUT.PUT_LINE('--------------------------------------------'); + DBMS_OUTPUT.PUT_LINE('Jira AI installation COMPLETE'); + DBMS_OUTPUT.PUT_LINE('--------------------------------------------'); +END install_jira_agent; +/ + +PROMPT Executing installer procedure ... +BEGIN + install_jira_agent(p_profile_name => :v_ai_profile_name); +END; +/ + +ALTER SESSION SET CURRENT_SCHEMA = ADMIN; + +PROMPT ====================================================== +PROMPT Installation finished successfully +PROMPT ====================================================== diff --git a/autonomous-ai-agents/jira_inspect/jira_inspect_tools.sql b/autonomous-ai-agents/jira_inspect/jira_inspect_tools.sql new file mode 100644 index 0000000..2859db0 --- /dev/null +++ b/autonomous-ai-agents/jira_inspect/jira_inspect_tools.sql @@ -0,0 +1,998 @@ +rem ============================================================================ +rem LICENSE +rem Copyright (c) 2026 Oracle and/or its affiliates. +rem Licensed under the Universal Permissive License (UPL), Version 1.0 +rem https://oss.oracle.com/licenses/upl/ +rem +rem NAME +rem jira_inspect_tools.sql +rem +rem DESCRIPTION +rem Installer script for Jira Select AI tools +rem (Select AI Agent / Oracle AI Database). +rem +rem This script installs Jira PL/SQL packages and registers +rem AI Agent tools used to query Jira and Atlassian APIs +rem via Select AI Agent. +rem +rem RELEASE VERSION +rem 1.0 +rem +rem RELEASE DATE +rem 20-Feb-2026 +rem +rem MAJOR CHANGES IN THIS RELEASE +rem - Initial release +rem - Added Jira configuration bootstrap using SELECTAI_AGENT_CONFIG +rem - Added Jira tools installer procedure +rem +rem SCRIPT STRUCTURE +rem 1. Initialization: +rem - Grants +rem - Configuration setup +rem +rem 2. Package Deployment: +rem - jira_selectai (package specification and body) +rem - select_ai_jira_agent (package specification and body) +rem +rem 3. AI Tool Setup: +rem - Creation of all Jira agent tools +rem +rem INSTALL INSTRUCTIONS +rem 1. Connect as ADMIN or a user with required privileges +rem +rem 2. Run the script using SQL Developer / Web SQL Developer. +rem +rem 3. Provide inputs when prompted: +rem - Target schema name +rem - Optional CONFIG_JSON values +rem +rem 4. Verify installation: +rem - Package compilation status is VALID +rem - Jira tools exist in USER_AI_AGENT_TOOLS +rem - SELECTAI_AGENT_CONFIG contains JIRA keys +rem +rem PARAMETERS +rem SCHEMA_NAME (Required) +rem Schema in which packages and tools are created. +rem +rem CONFIG_JSON (Optional) +rem JSON string used to persist Jira runtime config. +rem +rem Example: +rem {"credential_name":"ATLASSIAN_CRED","cloud_id":""} +rem +rem NOTES +rem - Required config keys for AGENT='JIRA': +rem * CREDENTIAL_NAME +rem * CLOUD_ID +rem +rem - Configuration can be updated after installation +rem in the SELECTAI_AGENT_CONFIG table. +rem +rem ============================================================================ + +SET SERVEROUTPUT ON +SET VERIFY OFF + +VAR v_schema VARCHAR2(128) +EXEC :v_schema := '&SCHEMA_NAME'; + +PROMPT +PROMPT Enter Jira agent configuration values in JSON format. +PROMPT Required keys: credential_name, cloud_id +PROMPT +PROMPT Example: +PROMPT {"credential_name":"ATLASSIAN_CRED","cloud_id":"my-jira-cloud-id"} +PROMPT +PROMPT Press ENTER to skip this step. +PROMPT If skipped, values can be inserted later in SELECTAI_AGENT_CONFIG. +PROMPT + +VAR v_config VARCHAR2(4000) +EXEC :v_config := '&CONFIG_JSON'; + +CREATE OR REPLACE PROCEDURE initialize_jira_agent( + p_install_schema_name IN VARCHAR2, + p_config_json IN CLOB +) +IS + l_schema_name VARCHAR2(128); + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + c_jira_agent CONSTANT VARCHAR2(64) := 'JIRA'; + + TYPE priv_list_t IS VARRAY(20) OF VARCHAR2(4000); + l_priv_list CONSTANT priv_list_t := priv_list_t( + 'DBMS_CLOUD', + 'DBMS_CLOUD_AI', + 'DBMS_CLOUD_AI_AGENT', + 'DBMS_CLOUD_TYPES' + ); + + PROCEDURE execute_grants(p_schema IN VARCHAR2, p_objects IN priv_list_t) IS + BEGIN + FOR i IN 1 .. p_objects.COUNT LOOP + BEGIN + EXECUTE IMMEDIATE 'GRANT EXECUTE ON ' || p_objects(i) || ' TO ' || p_schema; + EXCEPTION + WHEN OTHERS THEN + DBMS_OUTPUT.PUT_LINE('Warning: failed to grant ' || p_objects(i) || + ' to ' || p_schema || ' - ' || SQLERRM); + END; + END LOOP; + END execute_grants; + + PROCEDURE get_config( + p_json IN CLOB, + o_credential OUT VARCHAR2, + o_cloud_id OUT VARCHAR2 + ) IS + l_cfg JSON_OBJECT_T := NULL; + BEGIN + o_credential := NULL; + o_cloud_id := NULL; + + IF p_json IS NOT NULL AND TRIM(p_json) IS NOT NULL THEN + BEGIN + l_cfg := JSON_OBJECT_T.parse(p_json); + IF l_cfg.has('credential_name') THEN + o_credential := l_cfg.get_string('credential_name'); + END IF; + IF l_cfg.has('cloud_id') THEN + o_cloud_id := l_cfg.get_string('cloud_id'); + END IF; + EXCEPTION + WHEN OTHERS THEN + DBMS_OUTPUT.PUT_LINE('Config JSON parse failed: ' || SQLERRM); + o_credential := NULL; + o_cloud_id := NULL; + END; + ELSE + DBMS_OUTPUT.PUT_LINE('No config JSON provided, using existing table values.'); + END IF; + END get_config; + + PROCEDURE merge_config_key( + p_schema IN VARCHAR2, + p_key IN VARCHAR2, + p_val IN CLOB, + p_agent IN VARCHAR2 + ) IS + l_sql CLOB; + BEGIN + l_sql := + 'MERGE INTO ' || p_schema || '.SELECTAI_AGENT_CONFIG c + USING (SELECT :k AS "KEY", :v AS "VALUE", :a AS "AGENT" FROM DUAL) src + ON (c."KEY" = src."KEY" AND c."AGENT" = src."AGENT") + WHEN MATCHED THEN + UPDATE SET c."VALUE" = src."VALUE" + WHEN NOT MATCHED THEN + INSERT ("KEY", "VALUE", "AGENT") VALUES (src."KEY", src."VALUE", src."AGENT")'; + + EXECUTE IMMEDIATE l_sql USING p_key, p_val, p_agent; + EXCEPTION + WHEN OTHERS THEN + DBMS_OUTPUT.PUT_LINE('Warning: failed to persist ' || p_key || ' config: ' || SQLERRM); + END merge_config_key; +BEGIN + l_schema_name := DBMS_ASSERT.SIMPLE_SQL_NAME(p_install_schema_name); + + execute_grants(l_schema_name, l_priv_list); + get_config( + p_json => p_config_json, + o_credential => l_credential_name, + o_cloud_id => l_cloud_id + ); + + BEGIN + EXECUTE IMMEDIATE + 'CREATE TABLE ' || l_schema_name || '.SELECTAI_AGENT_CONFIG ( + "ID" NUMBER GENERATED BY DEFAULT AS IDENTITY, + "KEY" VARCHAR2(200) NOT NULL, + "VALUE" CLOB, + "AGENT" VARCHAR2(128) NOT NULL, + CONSTRAINT SELECTAI_AGENT_CONFIG_PK PRIMARY KEY ("ID"), + CONSTRAINT SELECTAI_AGENT_CONFIG_UK UNIQUE ("KEY","AGENT") + )'; + EXCEPTION + WHEN OTHERS THEN + IF SQLCODE = -955 THEN + NULL; + ELSE + RAISE; + END IF; + END; + + IF l_credential_name IS NOT NULL THEN + merge_config_key(l_schema_name, 'CREDENTIAL_NAME', l_credential_name, c_jira_agent); + END IF; + + IF l_cloud_id IS NOT NULL THEN + merge_config_key(l_schema_name, 'CLOUD_ID', l_cloud_id, c_jira_agent); + END IF; + + DBMS_OUTPUT.PUT_LINE('initialize_jira_agent completed for schema ' || l_schema_name); +EXCEPTION + WHEN OTHERS THEN + DBMS_OUTPUT.PUT_LINE('Fatal error in initialize_jira_agent: ' || SQLERRM); + RAISE; +END initialize_jira_agent; +/ + +BEGIN + initialize_jira_agent( + p_install_schema_name => :v_schema, + p_config_json => :v_config + ); +END; +/ + +BEGIN + EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = ' || :v_schema; +END; +/ + +CREATE OR REPLACE PACKAGE jira_selectai AS + FUNCTION get_jira( + cloud_id VARCHAR2, + credential_name VARCHAR2, + jira VARCHAR2 + ) RETURN CLOB; + + FUNCTION search_jiras( + cloud_id VARCHAR2, + credential_name VARCHAR2, + key VARCHAR2 + ) RETURN CLOB; + + FUNCTION get_jira_assigned_issues( + cloud_id VARCHAR2, + credential_name VARCHAR2, + assignee_account_id VARCHAR2, + max_results NUMBER DEFAULT 50 + ) RETURN CLOB; + + FUNCTION get_assignee_account_id( + cloud_id VARCHAR2, + credential_name VARCHAR2, + assignee_query VARCHAR2 + ) RETURN CLOB; + + FUNCTION get_jira_comments( + cloud_id VARCHAR2, + credential_name VARCHAR2, + jira VARCHAR2, + max_results NUMBER DEFAULT 50 + ) RETURN CLOB; + + FUNCTION get_jira_changelog( + cloud_id VARCHAR2, + credential_name VARCHAR2, + jira VARCHAR2, + max_results NUMBER DEFAULT 50 + ) RETURN CLOB; + + FUNCTION get_jira_worklog( + cloud_id VARCHAR2, + credential_name VARCHAR2, + jira VARCHAR2, + max_results NUMBER DEFAULT 50 + ) RETURN CLOB; + + FUNCTION get_jira_project( + cloud_id VARCHAR2, + credential_name VARCHAR2, + project_key VARCHAR2 + ) RETURN CLOB; + + FUNCTION get_atlassian_user( + cloud_id VARCHAR2, + credential_name VARCHAR2, + account_id VARCHAR2 + ) RETURN CLOB; + + FUNCTION get_jira_boards( + cloud_id VARCHAR2, + credential_name VARCHAR2, + project_key VARCHAR2 DEFAULT NULL + ) RETURN CLOB; +END jira_selectai; +/ + +CREATE OR REPLACE PACKAGE BODY jira_selectai AS + FUNCTION jira_api_base_url(cloud_id VARCHAR2) RETURN VARCHAR2 IS + BEGIN + RETURN 'bearer://api.atlassian.com/ex/jira/' || cloud_id || '/rest/api/3'; + END jira_api_base_url; + + FUNCTION jira_agile_api_base_url(cloud_id VARCHAR2) RETURN VARCHAR2 IS + BEGIN + RETURN 'bearer://api.atlassian.com/ex/jira/' || cloud_id || '/rest/agile/1.0'; + END jira_agile_api_base_url; + + FUNCTION get_response(credential_name VARCHAR2, uri VARCHAR2) RETURN CLOB IS + l_resp DBMS_CLOUD_TYPES.resp; + BEGIN + l_resp := DBMS_CLOUD.send_request( + credential_name => credential_name, + uri => uri, + method => DBMS_CLOUD.METHOD_GET + ); + RETURN DBMS_CLOUD.get_response_text(l_resp); + END get_response; + + FUNCTION get_jira( + cloud_id VARCHAR2, + credential_name VARCHAR2, + jira VARCHAR2 + ) RETURN CLOB IS + l_url VARCHAR2(4000); + BEGIN + l_url := jira_api_base_url(cloud_id) || '/issue/' || + UTL_URL.escape(jira, TRUE) || + '?expand=renderedFields,names,schema'; + RETURN get_response(credential_name, l_url); + END get_jira; + + FUNCTION search_jiras( + cloud_id VARCHAR2, + credential_name VARCHAR2, + key VARCHAR2 + ) RETURN CLOB IS + l_url VARCHAR2(4000); + l_jql VARCHAR2(4000); + l_sanitized_key VARCHAR2(4000); + BEGIN + l_sanitized_key := REPLACE(key, '"', ' '); + l_jql := 'text~"' || l_sanitized_key || '"'; + l_url := jira_api_base_url(cloud_id) || + '/search/jql?fields=key,summary,status,assignee,issuetype,project' || + chr(38) || 'jql=' || UTL_URL.escape(l_jql, TRUE); + RETURN get_response(credential_name, l_url); + END search_jiras; + + FUNCTION get_jira_assigned_issues( + cloud_id VARCHAR2, + credential_name VARCHAR2, + assignee_account_id VARCHAR2, + max_results NUMBER DEFAULT 50 + ) RETURN CLOB IS + l_url VARCHAR2(4000); + l_jql VARCHAR2(4000); + l_sanitized_account_id VARCHAR2(4000); + l_limit NUMBER; + BEGIN + l_sanitized_account_id := REPLACE(assignee_account_id, '"', ' '); + l_jql := 'assignee = "' || l_sanitized_account_id || '" ORDER BY updated DESC'; + l_limit := LEAST(NVL(max_results, 50), 1000); + + l_url := jira_api_base_url(cloud_id) || + '/search/jql?fields=key,summary,status,assignee,issuetype,project,updated' || + chr(38) || 'maxResults=' || l_limit || + chr(38) || 'jql=' || UTL_URL.escape(l_jql, TRUE); + RETURN get_response(credential_name, l_url); + END get_jira_assigned_issues; + + FUNCTION get_assignee_account_id( + cloud_id VARCHAR2, + credential_name VARCHAR2, + assignee_query VARCHAR2 + ) RETURN CLOB IS + l_url VARCHAR2(4000); + l_response CLOB; + l_users_arr JSON_ARRAY_T; + l_candidates JSON_ARRAY_T := JSON_ARRAY_T(); + l_user_obj JSON_OBJECT_T; + l_candidate_obj JSON_OBJECT_T; + l_result_obj JSON_OBJECT_T := JSON_OBJECT_T(); + l_error_obj JSON_OBJECT_T := JSON_OBJECT_T(); + l_size NUMBER; + BEGIN + l_url := jira_api_base_url(cloud_id) || '/user/search?maxResults=20' || + chr(38) || 'query=' || UTL_URL.escape(assignee_query, TRUE); + + l_response := get_response(credential_name, l_url); + l_users_arr := JSON_ARRAY_T.parse(l_response); + l_size := l_users_arr.get_size; + + l_result_obj.put('query', assignee_query); + l_result_obj.put('match_count', l_size); + + IF l_size > 0 THEN + l_user_obj := TREAT(l_users_arr.get(0) AS JSON_OBJECT_T); + l_result_obj.put('account_id', l_user_obj.get_string('accountId')); + l_result_obj.put('display_name', l_user_obj.get_string('displayName')); + ELSE + l_result_obj.put_null('account_id'); + l_result_obj.put_null('display_name'); + END IF; + + IF l_size > 0 THEN + FOR i IN 0 .. LEAST(l_size, 10) - 1 LOOP + l_user_obj := TREAT(l_users_arr.get(i) AS JSON_OBJECT_T); + l_candidate_obj := JSON_OBJECT_T(); + l_candidate_obj.put('account_id', l_user_obj.get_string('accountId')); + l_candidate_obj.put('display_name', l_user_obj.get_string('displayName')); + l_candidates.append(l_candidate_obj); + END LOOP; + END IF; + + l_result_obj.put('candidates', l_candidates); + RETURN l_result_obj.to_clob(); + EXCEPTION + WHEN OTHERS THEN + l_error_obj.put('status', 'error'); + l_error_obj.put('message', 'get_assignee_account_id failed: ' || SQLERRM); + IF l_response IS NOT NULL THEN + l_error_obj.put('raw_response', l_response); + END IF; + RETURN l_error_obj.to_clob(); + END get_assignee_account_id; + + FUNCTION get_jira_comments( + cloud_id VARCHAR2, + credential_name VARCHAR2, + jira VARCHAR2, + max_results NUMBER DEFAULT 50 + ) RETURN CLOB IS + l_url VARCHAR2(4000); + BEGIN + l_url := jira_api_base_url(cloud_id) || '/issue/' || + UTL_URL.escape(jira, TRUE) || '/comment?maxResults=' || + NVL(max_results, 50); + RETURN get_response(credential_name, l_url); + END get_jira_comments; + + FUNCTION get_jira_changelog( + cloud_id VARCHAR2, + credential_name VARCHAR2, + jira VARCHAR2, + max_results NUMBER DEFAULT 50 + ) RETURN CLOB IS + l_url VARCHAR2(4000); + BEGIN + l_url := jira_api_base_url(cloud_id) || '/issue/' || + UTL_URL.escape(jira, TRUE) || '/changelog?maxResults=' || + NVL(max_results, 50); + RETURN get_response(credential_name, l_url); + END get_jira_changelog; + + FUNCTION get_jira_worklog( + cloud_id VARCHAR2, + credential_name VARCHAR2, + jira VARCHAR2, + max_results NUMBER DEFAULT 50 + ) RETURN CLOB IS + l_url VARCHAR2(4000); + BEGIN + l_url := jira_api_base_url(cloud_id) || '/issue/' || + UTL_URL.escape(jira, TRUE) || '/worklog?maxResults=' || + NVL(max_results, 50); + RETURN get_response(credential_name, l_url); + END get_jira_worklog; + + FUNCTION get_jira_project( + cloud_id VARCHAR2, + credential_name VARCHAR2, + project_key VARCHAR2 + ) RETURN CLOB IS + l_url VARCHAR2(4000); + BEGIN + l_url := jira_api_base_url(cloud_id) || '/project/' || + UTL_URL.escape(project_key, TRUE); + RETURN get_response(credential_name, l_url); + END get_jira_project; + + FUNCTION get_atlassian_user( + cloud_id VARCHAR2, + credential_name VARCHAR2, + account_id VARCHAR2 + ) RETURN CLOB IS + l_url VARCHAR2(4000); + BEGIN + l_url := jira_api_base_url(cloud_id) || '/user?accountId=' || + UTL_URL.escape(account_id, TRUE); + RETURN get_response(credential_name, l_url); + END get_atlassian_user; + + FUNCTION get_jira_boards( + cloud_id VARCHAR2, + credential_name VARCHAR2, + project_key VARCHAR2 DEFAULT NULL + ) RETURN CLOB IS + l_url VARCHAR2(4000); + BEGIN + l_url := jira_agile_api_base_url(cloud_id) || '/board'; + IF project_key IS NOT NULL THEN + l_url := l_url || '?projectKeyOrId=' || UTL_URL.escape(project_key, TRUE); + END IF; + RETURN get_response(credential_name, l_url); + END get_jira_boards; +END jira_selectai; +/ + +CREATE OR REPLACE PACKAGE select_ai_jira_agent AS + FUNCTION search_jira( + keyword IN VARCHAR2 + ) RETURN CLOB; + + FUNCTION get_jira( + jira_key IN VARCHAR2 + ) RETURN CLOB; + + FUNCTION get_jira_assigned_issues( + assignee_account_id IN VARCHAR2, + max_results IN NUMBER DEFAULT 50 + ) RETURN CLOB; + + FUNCTION get_assignee_account_id( + assignee_query IN VARCHAR2 + ) RETURN CLOB; + + FUNCTION get_jira_comments( + jira_key IN VARCHAR2, + max_results IN NUMBER DEFAULT 50 + ) RETURN CLOB; + + FUNCTION get_jira_changelog( + jira_key IN VARCHAR2, + max_results IN NUMBER DEFAULT 50 + ) RETURN CLOB; + + FUNCTION get_jira_worklog( + jira_key IN VARCHAR2, + max_results IN NUMBER DEFAULT 50 + ) RETURN CLOB; + + FUNCTION get_jira_project( + project_key IN VARCHAR2 + ) RETURN CLOB; + + FUNCTION get_atlassian_user( + account_id IN VARCHAR2 + ) RETURN CLOB; + + FUNCTION get_jira_boards( + project_key IN VARCHAR2 DEFAULT NULL + ) RETURN CLOB; + + FUNCTION get_agent_config( + schema_name IN VARCHAR2, + table_name IN VARCHAR2, + agent_name IN VARCHAR2 + ) RETURN CLOB; +END select_ai_jira_agent; +/ + +CREATE OR REPLACE PACKAGE BODY select_ai_jira_agent AS + c_agent_name CONSTANT VARCHAR2(64) := 'JIRA'; + + FUNCTION build_error_response( + action_name IN VARCHAR2, + message_txt IN VARCHAR2 + ) RETURN CLOB IS + l_result_json JSON_OBJECT_T := JSON_OBJECT_T(); + BEGIN + l_result_json.put('status', 'error'); + l_result_json.put('message', action_name || ' failed: ' || message_txt); + RETURN l_result_json.to_clob(); + END build_error_response; + + FUNCTION get_agent_config( + schema_name IN VARCHAR2, + table_name IN VARCHAR2, + agent_name IN VARCHAR2 + ) RETURN CLOB + IS + l_sql VARCHAR2(4000); + l_cursor SYS_REFCURSOR; + l_config_json JSON_OBJECT_T := JSON_OBJECT_T(); + l_key VARCHAR2(200); + l_value CLOB; + l_result_json JSON_OBJECT_T := JSON_OBJECT_T(); + BEGIN + l_sql := 'SELECT "KEY", "VALUE" FROM ' || schema_name || '.' || table_name || + ' WHERE "AGENT" = :agent'; + + OPEN l_cursor FOR l_sql USING agent_name; + LOOP + FETCH l_cursor INTO l_key, l_value; + EXIT WHEN l_cursor%NOTFOUND; + l_config_json.put(l_key, l_value); + END LOOP; + CLOSE l_cursor; + + l_result_json.put('status', 'success'); + l_result_json.put('config_params', l_config_json); + RETURN l_result_json.to_clob(); + EXCEPTION + WHEN OTHERS THEN + IF l_cursor%ISOPEN THEN + CLOSE l_cursor; + END IF; + l_result_json := JSON_OBJECT_T(); + l_result_json.put('status', 'error'); + l_result_json.put('message', 'Error: ' || SQLERRM); + RETURN l_result_json.to_clob(); + END get_agent_config; + + PROCEDURE get_runtime_config( + o_credential_name OUT VARCHAR2, + o_cloud_id OUT VARCHAR2 + ) IS + l_current_user VARCHAR2(128) := SYS_CONTEXT('USERENV', 'CURRENT_USER'); + l_cfg_json CLOB; + l_cfg_obj JSON_OBJECT_T; + l_cfg_params JSON_OBJECT_T; + BEGIN + l_cfg_json := get_agent_config( + schema_name => l_current_user, + table_name => 'SELECTAI_AGENT_CONFIG', + agent_name => c_agent_name + ); + + l_cfg_obj := JSON_OBJECT_T.parse(l_cfg_json); + + IF NOT l_cfg_obj.has('status') OR l_cfg_obj.get_string('status') <> 'success' THEN + RAISE_APPLICATION_ERROR(-20001, 'Unable to read SELECTAI_AGENT_CONFIG for agent JIRA'); + END IF; + + l_cfg_params := l_cfg_obj.get_object('config_params'); + o_credential_name := NULL; + o_cloud_id := NULL; + + IF l_cfg_params IS NOT NULL AND l_cfg_params.has('CREDENTIAL_NAME') THEN + o_credential_name := l_cfg_params.get_string('CREDENTIAL_NAME'); + END IF; + + IF l_cfg_params IS NOT NULL AND l_cfg_params.has('CLOUD_ID') THEN + o_cloud_id := l_cfg_params.get_string('CLOUD_ID'); + END IF; + + IF o_credential_name IS NULL THEN + RAISE_APPLICATION_ERROR(-20002, 'Missing CREDENTIAL_NAME for agent JIRA in SELECTAI_AGENT_CONFIG'); + END IF; + + IF o_cloud_id IS NULL THEN + RAISE_APPLICATION_ERROR(-20003, 'Missing CLOUD_ID for agent JIRA in SELECTAI_AGENT_CONFIG'); + END IF; + END get_runtime_config; + + FUNCTION search_jira( + keyword IN VARCHAR2 + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.search_jiras( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + key => keyword + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('search_jira', SQLERRM); + END search_jira; + + FUNCTION get_jira( + jira_key IN VARCHAR2 + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.get_jira( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + jira => jira_key + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('get_jira', SQLERRM); + END get_jira; + + FUNCTION get_jira_assigned_issues( + assignee_account_id IN VARCHAR2, + max_results IN NUMBER DEFAULT 50 + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.get_jira_assigned_issues( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + assignee_account_id => assignee_account_id, + max_results => max_results + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('get_jira_assigned_issues', SQLERRM); + END get_jira_assigned_issues; + + FUNCTION get_assignee_account_id( + assignee_query IN VARCHAR2 + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.get_assignee_account_id( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + assignee_query => assignee_query + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('get_assignee_account_id', SQLERRM); + END get_assignee_account_id; + + FUNCTION get_jira_comments( + jira_key IN VARCHAR2, + max_results IN NUMBER DEFAULT 50 + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.get_jira_comments( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + jira => jira_key, + max_results => max_results + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('get_jira_comments', SQLERRM); + END get_jira_comments; + + FUNCTION get_jira_changelog( + jira_key IN VARCHAR2, + max_results IN NUMBER DEFAULT 50 + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.get_jira_changelog( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + jira => jira_key, + max_results => max_results + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('get_jira_changelog', SQLERRM); + END get_jira_changelog; + + FUNCTION get_jira_worklog( + jira_key IN VARCHAR2, + max_results IN NUMBER DEFAULT 50 + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.get_jira_worklog( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + jira => jira_key, + max_results => max_results + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('get_jira_worklog', SQLERRM); + END get_jira_worklog; + + FUNCTION get_jira_project( + project_key IN VARCHAR2 + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.get_jira_project( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + project_key => project_key + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('get_jira_project', SQLERRM); + END get_jira_project; + + FUNCTION get_atlassian_user( + account_id IN VARCHAR2 + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.get_atlassian_user( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + account_id => account_id + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('get_atlassian_user', SQLERRM); + END get_atlassian_user; + + FUNCTION get_jira_boards( + project_key IN VARCHAR2 DEFAULT NULL + ) RETURN CLOB + IS + l_response CLOB; + l_credential_name VARCHAR2(4000); + l_cloud_id VARCHAR2(4000); + BEGIN + get_runtime_config(l_credential_name, l_cloud_id); + l_response := jira_selectai.get_jira_boards( + credential_name => l_credential_name, + cloud_id => l_cloud_id, + project_key => project_key + ); + RETURN l_response; + EXCEPTION + WHEN OTHERS THEN + RETURN build_error_response('get_jira_boards', SQLERRM); + END get_jira_boards; +END select_ai_jira_agent; +/ + +CREATE OR REPLACE PROCEDURE initialize_jira_tools +IS + PROCEDURE drop_tool_if_exists(tool_name IN VARCHAR2) IS + l_tool_count NUMBER; + l_sql CLOB; + BEGIN + l_sql := 'SELECT COUNT(*) FROM USER_AI_AGENT_TOOLS WHERE TOOL_NAME = :1'; + EXECUTE IMMEDIATE l_sql INTO l_tool_count USING tool_name; + IF l_tool_count > 0 THEN + DBMS_CLOUD_AI_AGENT.DROP_TOOL(tool_name); + END IF; + END drop_tool_if_exists; +BEGIN + drop_tool_if_exists('SEARCH_JIRA_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'SEARCH_JIRA_TOOL', + attributes => '{ + "instruction": "Search Jira issues by keyword.", + "function": "select_ai_jira_agent.search_jira" + }', + description => 'Search Jira issues by keyword' + ); + + drop_tool_if_exists('GET_JIRA_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'GET_JIRA_TOOL', + attributes => '{ + "instruction": "Fetch Jira issue details by issue key.", + "function": "select_ai_jira_agent.get_jira" + }', + description => 'Get Jira issue details' + ); + + drop_tool_if_exists('GET_ASSIGNEE_ACCOUNT_ID_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'GET_ASSIGNEE_ACCOUNT_ID_TOOL', + attributes => '{ + "instruction": "Resolve Jira assignee account id by email, name, or search text.", + "function": "select_ai_jira_agent.get_assignee_account_id" + }', + description => 'Resolve Jira assignee account id' + ); + + drop_tool_if_exists('GET_JIRA_ASSIGNED_ISSUES_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'GET_JIRA_ASSIGNED_ISSUES_TOOL', + attributes => '{ + "instruction": "Fetch Jira issues assigned to a given assignee account id.", + "function": "select_ai_jira_agent.get_jira_assigned_issues" + }', + description => 'Get Jira issues assigned to an account' + ); + + drop_tool_if_exists('GET_JIRA_COMMENTS_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'GET_JIRA_COMMENTS_TOOL', + attributes => '{ + "instruction": "Fetch Jira issue comments by issue key.", + "function": "select_ai_jira_agent.get_jira_comments" + }', + description => 'Get Jira issue comments' + ); + + drop_tool_if_exists('GET_JIRA_CHANGELOG_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'GET_JIRA_CHANGELOG_TOOL', + attributes => '{ + "instruction": "Fetch Jira issue changelog history by issue key.", + "function": "select_ai_jira_agent.get_jira_changelog" + }', + description => 'Get Jira issue changelog' + ); + + drop_tool_if_exists('GET_JIRA_WORKLOG_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'GET_JIRA_WORKLOG_TOOL', + attributes => '{ + "instruction": "Fetch Jira issue worklog entries by issue key.", + "function": "select_ai_jira_agent.get_jira_worklog" + }', + description => 'Get Jira issue worklogs' + ); + + drop_tool_if_exists('GET_JIRA_PROJECT_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'GET_JIRA_PROJECT_TOOL', + attributes => '{ + "instruction": "Fetch Jira project details by project key.", + "function": "select_ai_jira_agent.get_jira_project" + }', + description => 'Get Jira project metadata' + ); + + drop_tool_if_exists('GET_ATLASSIAN_USER_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'GET_ATLASSIAN_USER_TOOL', + attributes => '{ + "instruction": "Fetch Atlassian user details by account id.", + "function": "select_ai_jira_agent.get_atlassian_user" + }', + description => 'Get Atlassian user profile' + ); + + drop_tool_if_exists('GET_JIRA_BOARDS_TOOL'); + DBMS_CLOUD_AI_AGENT.CREATE_TOOL( + tool_name => 'GET_JIRA_BOARDS_TOOL', + attributes => '{ + "instruction": "Fetch Jira boards. Optionally filter by project key.", + "function": "select_ai_jira_agent.get_jira_boards" + }', + description => 'Get Jira boards' + ); + + DBMS_OUTPUT.PUT_LINE('initialize_jira_tools completed.'); +EXCEPTION + WHEN OTHERS THEN + DBMS_OUTPUT.PUT_LINE('Error in initialize_jira_tools: ' || SQLERRM); + RAISE; +END initialize_jira_tools; +/ + +BEGIN + initialize_jira_tools; +END; +/ + +ALTER SESSION SET CURRENT_SCHEMA = ADMIN; diff --git a/autonomous-ai-agents/nl2sql_data_retrieval/README.md b/autonomous-ai-agents/nl2sql_data_retrieval/README.md index 38d6f63..ce27152 100644 --- a/autonomous-ai-agents/nl2sql_data_retrieval/README.md +++ b/autonomous-ai-agents/nl2sql_data_retrieval/README.md @@ -1,5 +1,11 @@ # Select AI - NL2SQL Data Retrieval Agent for Oracle Autonomous AI Database +## Overview + +The **Select AI - NL2SQL Data Retrieval Agent** enables natural-language data analysis workflows by combining NL2SQL generation, metadata inspection, query correction, web intelligence, and chart generation inside Oracle Autonomous AI Database. + +For definitions of **Tool**, **Task**, **Agent**, and **Agent Team**, see the top-level guide: [README](../README.md#simple-agent-execution-flow). + ## How the NL2SQL agent improves upon Select AI NL2SQL Oracle Select AI already provides Natural Language to SQL (NL2SQL), but **real-world data retrieval often fails** due to: @@ -48,7 +54,7 @@ The agent dynamically selects tools, retries intelligently, and produces **expla ```text . -├── nl2sql_data_retrieval_tools.sql +├── nl2sql_data_retrieval_tool.sql │ ├── PL/SQL utility functions │ ├── OCI Vault integration for Websearch credentials │ ├── Web search enablement @@ -67,7 +73,7 @@ The agent dynamically selects tools, retries intelligently, and produces **expla ## Prerequisites -- Oracle Autonomous AI Database +- Oracle Autonomous AI Database (26ai recommended) - Select AI enabled - OCI Vault configured (Optional for websearch) - Google Custom Search API enabled (Optional for websearch) @@ -105,10 +111,19 @@ Note the **Vault Secret OCIDs**. ## Installation – Tools -Run as ADMIN (or privileged user): +Before running installation commands: + +1. Clone or download this repository. +2. Open a terminal and change directory to `autonomous-ai-agents/nl2sql_data_retrieval`. +3. Choose one execution mode: + - SQL*Plus/SQLcl: run script files directly with `@script_name`. + - SQL Worksheet (Database Actions or other SQL IDE): open the `.sql` file and run/paste its contents. +4. Uploading scripts to `DATA_PUMP_DIR` is not required for these methods. + +Run as `ADMIN` (or another privileged user): ```sql -sqlplus admin@db @nl2sql_data_retrieval_tools.sql +sqlplus admin@ @nl2sql_data_retrieval_tool.sql ``` ### Input Parameters required to run - Target schema name (Schema where to the agent team needs to be installed) @@ -197,12 +212,14 @@ sqlplus admin@db @nl2sql_data_retrieval_tools.sql ## Installation – Agent and Team -Run: +From `autonomous-ai-agents/nl2sql_data_retrieval`, run: ```sql -sqlplus admin@db @nl2sql_data_retrieval_agent.sql +sqlplus admin@ @nl2sql_data_retrieval_agent.sql ``` +You can also execute the contents of `nl2sql_data_retrieval_agent.sql` in SQL Worksheet. + ### Input Parameters required to run. - Target schema name (Schema where to the agent team needs to be installed) - AI Profile name (Select AI Profile name that needs to be used with the Agent) @@ -274,6 +291,7 @@ After creating the NL2SQL Data Retrieval Agent team, you can interact with it us Universal Permissive License (UPL) 1.0 https://oss.oracle.com/licenses/upl/ +Copyright (c) 2026 Oracle and/or its affiliates. --- diff --git a/autonomous-ai-agents/nl2sql_data_retrieval/nl2sql_data_retrieval_agent.sql b/autonomous-ai-agents/nl2sql_data_retrieval/nl2sql_data_retrieval_agent.sql index 1e44ab3..1f91dcc 100644 --- a/autonomous-ai-agents/nl2sql_data_retrieval/nl2sql_data_retrieval_agent.sql +++ b/autonomous-ai-agents/nl2sql_data_retrieval/nl2sql_data_retrieval_agent.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem diff --git a/autonomous-ai-agents/nl2sql_data_retrieval/nl2sql_data_retrieval_tool.sql b/autonomous-ai-agents/nl2sql_data_retrieval/nl2sql_data_retrieval_tool.sql index 333838a..08ae964 100644 --- a/autonomous-ai-agents/nl2sql_data_retrieval/nl2sql_data_retrieval_tool.sql +++ b/autonomous-ai-agents/nl2sql_data_retrieval/nl2sql_data_retrieval_tool.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem diff --git a/autonomous-ai-agents/oci_autonomous_database/README.md b/autonomous-ai-agents/oci_autonomous_database/README.md index b1a21d2..88b0269 100644 --- a/autonomous-ai-agents/oci_autonomous_database/README.md +++ b/autonomous-ai-agents/oci_autonomous_database/README.md @@ -4,13 +4,15 @@ The **Select AI - OCI Autonomous Database AI Agent** enables natural-language–driven provisioning, management, and advisory operations for **Oracle Autonomous Databases on OCI**, powered by **Select AI (DBMS_CLOUD_AI_AGENT)**. +With this agent, users can provision databases, run lifecycle and scaling operations, inspect configuration and backups, and perform guided administrative workflows using natural-language instructions. + Unlike traditional scripts or consoles, this agent allows users to: - Provision and manage Autonomous Databases conversationally - Run lifecycle operations with confirmations - Discover OCI resources dynamically (regions, compartments, databases) - Automate complex OCI workflows through reusable AI tools -This repository provides a **clean separation between Tools and Agent orchestration**, making it easy to extend, customize, and reuse. +For definitions of **Tool**, **Task**, **Agent**, and **Agent Team**, see the top-level guide: [README](../README.md#simple-agent-execution-flow). --- @@ -68,7 +70,7 @@ Confirmed OCI Operation + Result ## Prerequisites -- Oracle Autonomous Database +- Oracle Autonomous AI Database (26ai recommended) - Select AI enabled - OCI credential or Resource Principal - Access to OCI compartments with ADB permissions @@ -78,10 +80,19 @@ Confirmed OCI Operation + Result ## Installation – Tools -Run as ADMIN (or privileged user): +Before running installation commands: + +1. Clone or download this repository. +2. Open a terminal and change directory to `autonomous-ai-agents/oci_autonomous_database`. +3. Choose one execution mode: + - SQL*Plus/SQLcl: run script files directly with `@script_name`. + - SQL Worksheet (Database Actions or other SQL IDE): open the `.sql` file and run/paste its contents. +4. Uploading scripts to `DATA_PUMP_DIR` is not required for these methods. + +Run as `ADMIN` (or another privileged user): ```sql -sqlplus admin@db @oci_autonomous_database_tools.sql +sqlplus admin@ @oci_autonomous_database_tools.sql ``` ### Input Parameters required to run @@ -146,12 +157,14 @@ sqlplus admin@db @oci_autonomous_database_tools.sql ## Installation – Agent and Team -Run: +From `autonomous-ai-agents/oci_autonomous_database`, run: ```sql -sqlplus admin@db @oci_autonomous_database_agent.sql +sqlplus admin@ @oci_autonomous_database_agent.sql ``` +You can also execute the contents of `oci_autonomous_database_agent.sql` in SQL Worksheet. + ### Input Parameters required to run. - Target schema name (Schema where to the agent team needs to be installed) - AI Profile name (Select AI Profile name that needs to be used with the Agent) @@ -246,6 +259,7 @@ After creating the Oracle Autonomous Database AI Agent, users can interact with Universal Permissive License (UPL) 1.0 https://oss.oracle.com/licenses/upl/ +Copyright (c) 2026 Oracle and/or its affiliates. --- diff --git a/autonomous-ai-agents/oci_autonomous_database/oci_autonomous_database_agent.sql b/autonomous-ai-agents/oci_autonomous_database/oci_autonomous_database_agent.sql index bd64d46..b9f3916 100644 --- a/autonomous-ai-agents/oci_autonomous_database/oci_autonomous_database_agent.sql +++ b/autonomous-ai-agents/oci_autonomous_database/oci_autonomous_database_agent.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem diff --git a/autonomous-ai-agents/oci_autonomous_database/oci_autonomous_database_tools.sql b/autonomous-ai-agents/oci_autonomous_database/oci_autonomous_database_tools.sql index 3232e57..8a26508 100644 --- a/autonomous-ai-agents/oci_autonomous_database/oci_autonomous_database_tools.sql +++ b/autonomous-ai-agents/oci_autonomous_database/oci_autonomous_database_tools.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem diff --git a/autonomous-ai-agents/oci_network_load_balancer/README.md b/autonomous-ai-agents/oci_network_load_balancer/README.md index f09a951..1041360 100644 --- a/autonomous-ai-agents/oci_network_load_balancer/README.md +++ b/autonomous-ai-agents/oci_network_load_balancer/README.md @@ -6,11 +6,11 @@ OCI Network Load Balancer is a high-performance, layer-4 load balancing service in Oracle Cloud Infrastructure that distributes TCP and UDP traffic across backend servers while preserving source IP addresses. It is designed for ultra-low latency, high throughput, and scalability, making it ideal for mission-critical and network-intensive workloads. -The **Select AI - OCI Network Load Balancer (NLB) AI Agent** enables conversational management of **OCI Network Load Balancers** using **Select AI (DBMS_CLOUD_AI_AGENT)** in Oracle Autonomous Database. +The **Select AI - OCI Network Load Balancer (NLB) AI Agent** enables conversational management of **OCI Network Load Balancers** using **Select AI (DBMS_CLOUD_AI_AGENT)** in Oracle Autonomous AI Database. -It allows users to **list, create, update, and delete Network Load Balancers**, along with their **listeners, backend sets, and health status**, while enforcing **explicit confirmation for destructive operations**. +With this agent, users can list, create, update, and delete Network Load Balancers, manage listeners and backend sets, inspect health status, and enforce explicit confirmation for destructive operations. -This agent follows the same **Tools + Agent + Team** architecture used across other OCI service agents in this repository. +For definitions of **Tool**, **Task**, **Agent**, and **Agent Team**, see the top-level guide: [README](../README.md#simple-agent-execution-flow). --- @@ -72,7 +72,7 @@ Confirmed NLB Operation + Result ## Prerequisites -- Oracle Autonomous Database +- Oracle Autonomous AI Database (26ai recommended) - Select AI enabled - OCI Network Load Balancer permissions - OCI credential or Resource Principal @@ -82,12 +82,23 @@ Confirmed NLB Operation + Result ## Installation – Agent and Team -Run as ADMIN (or privileged user): +Before running installation commands: + +1. Clone or download this repository. +2. Open a terminal and change directory to `autonomous-ai-agents/oci_network_load_balancer`. +3. Choose one execution mode: + - SQL*Plus/SQLcl: run script files directly with `@script_name`. + - SQL Worksheet (Database Actions or other SQL IDE): open the `.sql` file and run/paste its contents. +4. Uploading scripts to `DATA_PUMP_DIR` is not required for these methods. + +Run as `ADMIN` (or another privileged user): ```sql -sqlplus admin@db @oci_network_load_balancer_agent.sql +sqlplus admin@ @oci_network_load_balancer_agent.sql ``` +You can also execute the contents of `oci_network_load_balancer_agent.sql` in SQL Worksheet. + ### Input Parameters required to run - Target schema name (Schema where to the agent team needs to be installed) - AI Profile name (Select AI Profile name that needs to be used with the Agent) @@ -231,6 +242,7 @@ After creating the OCI Network Load Balancer AI Agent, users can interact with i Universal Permissive License (UPL) 1.0 https://oss.oracle.com/licenses/upl/ +Copyright (c) 2026 Oracle and/or its affiliates. --- diff --git a/autonomous-ai-agents/oci_network_load_balancer/oci_network_load_balancer_agent.sql b/autonomous-ai-agents/oci_network_load_balancer/oci_network_load_balancer_agent.sql index 218e125..a26a5a6 100644 --- a/autonomous-ai-agents/oci_network_load_balancer/oci_network_load_balancer_agent.sql +++ b/autonomous-ai-agents/oci_network_load_balancer/oci_network_load_balancer_agent.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem diff --git a/autonomous-ai-agents/oci_network_load_balancer/oci_network_load_balancer_tools.sql b/autonomous-ai-agents/oci_network_load_balancer/oci_network_load_balancer_tools.sql index 719b07a..e442e7a 100644 --- a/autonomous-ai-agents/oci_network_load_balancer/oci_network_load_balancer_tools.sql +++ b/autonomous-ai-agents/oci_network_load_balancer/oci_network_load_balancer_tools.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem diff --git a/autonomous-ai-agents/oci_object_storage/README.md b/autonomous-ai-agents/oci_object_storage/README.md index 3e32218..b031c34 100644 --- a/autonomous-ai-agents/oci_object_storage/README.md +++ b/autonomous-ai-agents/oci_object_storage/README.md @@ -2,15 +2,15 @@ ## Overview -## OCI Object Storage +### OCI Object Storage OCI Object Storage is a highly scalable and durable storage service in Oracle Cloud Infrastructure that enables you to securely store and retrieve unstructured data such as files, backups, logs, and media. It offers high availability, strong security with encryption, lifecycle management, and seamless integration with OCI services and applications. The **Select AI - OCI Object Storage AI Agent** enables natural-language–driven automation and advisory capabilities for **OCI Object Storage**, powered by **Select AI (DBMS_CLOUD_AI_AGENT)**. -This agent allows users to manage buckets, objects, lifecycle policies, retention rules, replication, multipart uploads, and work requests using **conversational instructions**, while enforcing ** confirmations, and clarity**. +With this agent, users can manage buckets and objects, apply lifecycle and retention policies, configure replication, run multipart upload flows, and monitor work requests using natural-language instructions. -The design follows a **Tools + Agent + Team** architecture, making it scalable, auditable, and easy to extend. +For definitions of **Tool**, **Task**, **Agent**, and **Agent Team**, see the top-level guide: [README](../README.md#simple-agent-execution-flow). --- @@ -74,7 +74,7 @@ Confirmed Operation + Result ## Prerequisites -- Oracle Autonomous Database (23ai recommended) +- Oracle Autonomous AI Database (26ai recommended) - Select AI enabled - OCI Object Storage access - OCI credential or Resource Principal @@ -84,10 +84,19 @@ Confirmed Operation + Result ## Installation – Tools -Run as ADMIN (or privileged user): +Before running installation commands: + +1. Clone or download this repository. +2. Open a terminal and change directory to `autonomous-ai-agents/oci_object_storage`. +3. Choose one execution mode: + - SQL*Plus/SQLcl: run script files directly with `@script_name`. + - SQL Worksheet (Database Actions or other SQL IDE): open the `.sql` file and run/paste its contents. +4. Uploading scripts to `DATA_PUMP_DIR` is not required for these methods. + +Run as `ADMIN` (or another privileged user): ```sql -sqlplus admin@db @oci_object_storage_tools.sql +sqlplus admin@ @oci_object_storage_tools.sql ``` ### Input Parameters required to run @@ -145,12 +154,14 @@ sqlplus admin@db @oci_object_storage_tools.sql ## Installation – Agent and Team -Run: +From `autonomous-ai-agents/oci_object_storage`, run: ```sql -sqlplus admin@db @oci_object_storage_agent.sql +sqlplus admin@ @oci_object_storage_agent.sql ``` +You can also execute the contents of `oci_object_storage_agent.sql` in SQL Worksheet. + ### Input Parameters required to run - Target schema name (Schema where to the agent team needs to be installed) - AI Profile name (Select AI Profile name that needs to be used with the Agent) @@ -257,6 +268,7 @@ After creating the OCI Object Storage AI Agent, users can interact with it using Universal Permissive License (UPL) 1.0 https://oss.oracle.com/licenses/upl/ +Copyright (c) 2026 Oracle and/or its affiliates. --- diff --git a/autonomous-ai-agents/oci_object_storage/oci_object_storage_agent.sql b/autonomous-ai-agents/oci_object_storage/oci_object_storage_agent.sql index 5306423..bd6ae40 100644 --- a/autonomous-ai-agents/oci_object_storage/oci_object_storage_agent.sql +++ b/autonomous-ai-agents/oci_object_storage/oci_object_storage_agent.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem diff --git a/autonomous-ai-agents/oci_object_storage/oci_object_storage_tools.sql b/autonomous-ai-agents/oci_object_storage/oci_object_storage_tools.sql index bc94f7e..9ace742 100644 --- a/autonomous-ai-agents/oci_object_storage/oci_object_storage_tools.sql +++ b/autonomous-ai-agents/oci_object_storage/oci_object_storage_tools.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem diff --git a/autonomous-ai-agents/oci_vault/README.md b/autonomous-ai-agents/oci_vault/README.md index 78d1ea6..9506399 100644 --- a/autonomous-ai-agents/oci_vault/README.md +++ b/autonomous-ai-agents/oci_vault/README.md @@ -6,11 +6,11 @@ OCI Vault is a secure key and secrets management service in Oracle Cloud Infrastructure that helps you centrally store, manage, and control access to sensitive data such as encryption keys, secrets, certificates, and passwords. It supports customer-managed encryption keys backed by Hardware Security Modules (HSMs), enabling strong security, compliance, key rotation, and fine-grained access control for OCI resources and applications. -The ** Select AI OCI Vault AI Agent** enables secure, conversational management of **OCI Vault secrets and secret versions** using **Select AI (DBMS_CLOUD_AI_AGENT)** within Oracle Autonomous AI Database. +The **Select AI OCI Vault AI Agent** enables secure, conversational management of **OCI Vault secrets and secret versions** using **Select AI (DBMS_CLOUD_AI_AGENT)** within Oracle Autonomous AI Database. -This agent is designed for **security‑critical workflows**, allowing users to create, inspect, rotate, move, and schedule deletion of secrets while enforcing **explicit confirmations, least‑privilege access, and human‑readable responses**. +With this agent, users can create, inspect, rotate, move, and schedule deletion of secrets, inspect secret versions, and manage compartment-level secret operations using natural-language instructions with explicit confirmations. -It follows the same **Tools + Agent + Team** architecture used across other OCI service agents in this repository. +For definitions of **Tool**, **Task**, **Agent**, and **Agent Team**, see the top-level guide: [README](../README.md#simple-agent-execution-flow). --- @@ -67,7 +67,7 @@ Confirmed Vault Operation + Result ## Prerequisites -- Oracle Autonomous AI Database +- Oracle Autonomous AI Database (26ai recommended) - Select AI enabled - OCI Vault access - OCI credential or Resource Principal @@ -77,10 +77,19 @@ Confirmed Vault Operation + Result ## Installation – Tools -Run as ADMIN (or privileged user): +Before running installation commands: + +1. Clone or download this repository. +2. Open a terminal and change directory to `autonomous-ai-agents/oci_vault`. +3. Choose one execution mode: + - SQL*Plus/SQLcl: run script files directly with `@script_name`. + - SQL Worksheet (Database Actions or other SQL IDE): open the `.sql` file and run/paste its contents. +4. Uploading scripts to `DATA_PUMP_DIR` is not required for these methods. + +Run as `ADMIN` (or another privileged user): ```sql -sqlplus admin@db @oci_vault_tools.sql +sqlplus admin@ @oci_vault_tools.sql ``` ### Optional Configuration JSON @@ -138,12 +147,14 @@ sqlplus admin@db @oci_vault_tools.sql ## Installation – Agent & Team -Run: +From `autonomous-ai-agents/oci_vault`, run: ```sql -sqlplus admin@db @oci_vault_agent.sql +sqlplus admin@ @oci_vault_agent.sql ``` +You can also execute the contents of `oci_vault_agent.sql` in SQL Worksheet. + ### Prompts - Target schema name - AI Profile name @@ -230,6 +241,7 @@ After creating the OCI Vault AI Agent, users can interact with it using prompts Universal Permissive License (UPL) 1.0 https://oss.oracle.com/licenses/upl/ +Copyright (c) 2026 Oracle and/or its affiliates. --- diff --git a/autonomous-ai-agents/oci_vault/oci_vault_agent.sql b/autonomous-ai-agents/oci_vault/oci_vault_agent.sql index fe94f0e..3642c29 100644 --- a/autonomous-ai-agents/oci_vault/oci_vault_agent.sql +++ b/autonomous-ai-agents/oci_vault/oci_vault_agent.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem diff --git a/autonomous-ai-agents/oci_vault/oci_vault_tools.sql b/autonomous-ai-agents/oci_vault/oci_vault_tools.sql index 4af9191..3da0e0c 100644 --- a/autonomous-ai-agents/oci_vault/oci_vault_tools.sql +++ b/autonomous-ai-agents/oci_vault/oci_vault_tools.sql @@ -1,6 +1,6 @@ rem ============================================================================ rem LICENSE -rem Copyright (c) 2025 Oracle and/or its affiliates. +rem Copyright (c) 2026 Oracle and/or its affiliates. rem Licensed under the Universal Permissive License (UPL), Version 1.0 rem https://oss.oracle.com/licenses/upl/ rem