name: oracle-fusion-ai
description: Oracle Fusion Cloud AI and OCI Generative AI integration patterns. Use when connecting AI agents to Oracle ERP, HCM, SCM via REST APIs, or using Oracle's 50+ pre-built AI agents for finance, HR, and supply chain.
Oracle Fusion Cloud AI Integration
Connect AI agents to Oracle Fusion Cloud applications (ERP, HCM, SCM) using REST APIs, and leverage Oracle's 50+ pre-built AI agents for enterprise workflows.
When to Use
- Querying or updating Oracle Fusion Cloud data (finance, HR, supply chain) from AI agents
- Understanding Oracle's 50+ pre-built AI agents for ERP, HCM, SCM
- Integrating external LLMs (Claude, GPT, Gemini) with Oracle data via REST APIs
- Using OCI Generative AI Service with Cohere or Llama models
Oracle's Pre-Built AI Agents (50+)
| Domain |
Agents |
| Finance/ERP |
Invoice processing, cash forecasting, journal anomaly detection, expense audit, financial close |
| HCM |
Recruiting, learning recommendations, workforce planning, benefits advisor, performance review |
| SCM |
Demand forecasting, supply chain risk, order management, inventory optimization |
| CX |
Service agent, sales assistant |
OCI Generative AI -- Supported Models
| Provider |
Models |
| Cohere |
Command R, Command R+ (Oracle's primary LLM partner) |
| Meta |
Llama 3, Llama 3.1 (70B, 8B) |
| Note |
No native Claude, GPT-4, or Gemini. Use API Gateway for external LLMs |
Patterns
1. Oracle Fusion Cloud REST API
import requests
class OracleFusionClient:
def __init__(self, base_url: str, username: str, password: str):
self.base_url = base_url.rstrip("/")
self.auth = (username, password)
self.headers = {"Content-Type": "application/json", "REST-Framework-Version": "4"}
def _get(self, path: str, params: dict = None) -> dict:
response = requests.get(
f"{self.base_url}{path}",
auth=self.auth, headers=self.headers, params=params,
)
response.raise_for_status()
return response.json()
# --- Financials ---
def get_gl_balances(self, ledger_id: str, period: str) -> list[dict]:
return self._get(
"/fscmRestApi/resources/11.13.18.05/ledgerBalances",
params={"q": f"LedgerId={ledger_id};AccountingPeriod={period}", "limit": 100},
).get("items", [])
def get_invoices(self, supplier: str = "", limit: int = 25) -> list[dict]:
params = {"limit": limit}
if supplier:
params["q"] = f"VendorName LIKE '{supplier}%'"
return self._get("/fscmRestApi/resources/11.13.18.05/invoices", params).get("items", [])
# --- HCM ---
def search_employees(self, name: str) -> list[dict]:
return self._get(
"/hcmRestApi/resources/11.13.18.05/emps",
params={"q": f"DisplayName LIKE '{name}%'", "limit": 20},
).get("items", [])
def get_employee(self, person_id: str) -> dict:
return self._get(f"/hcmRestApi/resources/11.13.18.05/emps/{person_id}")
# --- Supply Chain ---
def get_purchase_orders(self, status: str = "OPEN", limit: int = 25) -> list[dict]:
return self._get(
"/fscmRestApi/resources/11.13.18.05/purchaseOrders",
params={"q": f"Status='{status}'", "limit": limit},
).get("items", [])
def get_inventory(self, item: str, org_id: str) -> list[dict]:
return self._get(
"/fscmRestApi/resources/11.13.18.05/inventoryOnhand",
params={"q": f"ItemNumber='{item}';OrganizationId={org_id}"},
).get("items", [])
2. OCI Generative AI Service
import oci
config = oci.config.from_file()
generative_ai = oci.generative_ai_inference.GenerativeAiInferenceClient(config)
def generate_with_cohere(prompt: str) -> str:
"""Generate text using OCI Generative AI (Cohere Command R+)."""
response = generative_ai.chat(
oci.generative_ai_inference.models.ChatDetails(
compartment_id="ocid1.compartment.oc1...",
serving_mode=oci.generative_ai_inference.models.OnDemandServingMode(
model_id="cohere.command-r-plus",
),
chat_request=oci.generative_ai_inference.models.CohereChatRequest(
message=prompt,
max_tokens=1024,
temperature=0.1,
),
)
)
return response.data.chat_response.text
3. External LLM Integration via OCI API Gateway
# For using Claude, GPT-4, or Gemini with Oracle data,
# route through OCI API Gateway or Oracle Integration Cloud (OIC)
import requests
def query_oracle_with_claude(question: str, oracle_data: dict) -> str:
"""Use Claude (via Bedrock or direct) to analyze Oracle data."""
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{
"role": "user",
"content": f"""Analyze this Oracle ERP data and answer the question.
Data: {oracle_data}
Question: {question}"""
}],
)
return response.content[0].text
4. Oracle APEX AI Integration
-- Oracle APEX AI Assistant: generate SQL from natural language
-- Available in APEX 24.1+
DECLARE
l_response CLOB;
BEGIN
l_response := APEX_AI.GENERATE(
p_prompt => 'List all overdue invoices over $10,000',
p_model => 'OCI_GENAI_COHERE',
p_system_prompt => 'Generate Oracle SQL for the AP schema. Tables: AP_INVOICES_ALL, AP_INVOICE_LINES_ALL.'
);
DBMS_OUTPUT.PUT_LINE(l_response);
END;
Anti-Patterns
- Using OCI GenAI exclusively when Claude/GPT are needed -- Oracle's model selection is limited
- Direct database queries bypassing Fusion REST APIs -- always use REST APIs for application data
- Hardcoding Oracle credentials -- use OCI Vault or Oracle Credential Store
- Ignoring Oracle's data security policies -- Fusion enforces row-level security via business units
- Skipping pagination -- Oracle REST APIs use offset/limit; always handle multi-page results
References
1---2name: oracle-fusion-ai-33description: <!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT -->4---5<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT -->6---7name: oracle-fusion-ai8description: Oracle Fusion Cloud AI and OCI Generative AI integration patterns. Use when connecting AI agents to Oracle ERP, HCM, SCM via REST APIs, or using Oracle's 50+ pre-built AI agents for finance, HR, and supply chain.9---1011# Oracle Fusion Cloud AI Integration1213Connect AI agents to Oracle Fusion Cloud applications (ERP, HCM, SCM) using REST APIs, and leverage Oracle's 50+ pre-built AI agents for enterprise workflows.1415## When to Use1617- Querying or updating Oracle Fusion Cloud data (finance, HR, supply chain) from AI agents18- Understanding Oracle's 50+ pre-built AI agents for ERP, HCM, SCM19- Integrating external LLMs (Claude, GPT, Gemini) with Oracle data via REST APIs20- Using OCI Generative AI Service with Cohere or Llama models2122## Oracle's Pre-Built AI Agents (50+)2324| Domain | Agents |25|---|---|26| **Finance/ERP** | Invoice processing, cash forecasting, journal anomaly detection, expense audit, financial close |27| **HCM** | Recruiting, learning recommendations, workforce planning, benefits advisor, performance review |28| **SCM** | Demand forecasting, supply chain risk, order management, inventory optimization |29| **CX** | Service agent, sales assistant |3031## OCI Generative AI -- Supported Models3233| Provider | Models |34|---|---|35| **Cohere** | Command R, Command R+ (Oracle's primary LLM partner) |36| **Meta** | Llama 3, Llama 3.1 (70B, 8B) |37| **Note** | No native Claude, GPT-4, or Gemini. Use API Gateway for external LLMs |3839## Patterns4041### 1. Oracle Fusion Cloud REST API4243```python44import requests4546class OracleFusionClient:47 def __init__(self, base_url: str, username: str, password: str):48 self.base_url = base_url.rstrip("/")49 self.auth = (username, password)50 self.headers = {"Content-Type": "application/json", "REST-Framework-Version": "4"}5152 def _get(self, path: str, params: dict = None) -> dict:53 response = requests.get(54 f"{self.base_url}{path}",55 auth=self.auth, headers=self.headers, params=params,56 )57 response.raise_for_status()58 return response.json()5960 # --- Financials ---61 def get_gl_balances(self, ledger_id: str, period: str) -> list[dict]:62 return self._get(63 "/fscmRestApi/resources/11.13.18.05/ledgerBalances",64 params={"q": f"LedgerId={ledger_id};AccountingPeriod={period}", "limit": 100},65 ).get("items", [])6667 def get_invoices(self, supplier: str = "", limit: int = 25) -> list[dict]:68 params = {"limit": limit}69 if supplier:70 params["q"] = f"VendorName LIKE '{supplier}%'"71 return self._get("/fscmRestApi/resources/11.13.18.05/invoices", params).get("items", [])7273 # --- HCM ---74 def search_employees(self, name: str) -> list[dict]:75 return self._get(76 "/hcmRestApi/resources/11.13.18.05/emps",77 params={"q": f"DisplayName LIKE '{name}%'", "limit": 20},78 ).get("items", [])7980 def get_employee(self, person_id: str) -> dict:81 return self._get(f"/hcmRestApi/resources/11.13.18.05/emps/{person_id}")8283 # --- Supply Chain ---84 def get_purchase_orders(self, status: str = "OPEN", limit: int = 25) -> list[dict]:85 return self._get(86 "/fscmRestApi/resources/11.13.18.05/purchaseOrders",87 params={"q": f"Status='{status}'", "limit": limit},88 ).get("items", [])8990 def get_inventory(self, item: str, org_id: str) -> list[dict]:91 return self._get(92 "/fscmRestApi/resources/11.13.18.05/inventoryOnhand",93 params={"q": f"ItemNumber='{item}';OrganizationId={org_id}"},94 ).get("items", [])95```9697### 2. OCI Generative AI Service9899```python100import oci101102config = oci.config.from_file()103generative_ai = oci.generative_ai_inference.GenerativeAiInferenceClient(config)104105def generate_with_cohere(prompt: str) -> str:106 """Generate text using OCI Generative AI (Cohere Command R+)."""107 response = generative_ai.chat(108 oci.generative_ai_inference.models.ChatDetails(109 compartment_id="ocid1.compartment.oc1...",110 serving_mode=oci.generative_ai_inference.models.OnDemandServingMode(111 model_id="cohere.command-r-plus",112 ),113 chat_request=oci.generative_ai_inference.models.CohereChatRequest(114 message=prompt,115 max_tokens=1024,116 temperature=0.1,117 ),118 )119 )120 return response.data.chat_response.text121```122123### 3. External LLM Integration via OCI API Gateway124125```python126# For using Claude, GPT-4, or Gemini with Oracle data,127# route through OCI API Gateway or Oracle Integration Cloud (OIC)128129import requests130131def query_oracle_with_claude(question: str, oracle_data: dict) -> str:132 """Use Claude (via Bedrock or direct) to analyze Oracle data."""133 import anthropic134135 client = anthropic.Anthropic()136 response = client.messages.create(137 model="claude-sonnet-4-5-20250929",138 max_tokens=1024,139 messages=[{140 "role": "user",141 "content": f"""Analyze this Oracle ERP data and answer the question.142143Data: {oracle_data}144145Question: {question}"""146 }],147 )148 return response.content[0].text149```150151### 4. Oracle APEX AI Integration152153```sql154-- Oracle APEX AI Assistant: generate SQL from natural language155-- Available in APEX 24.1+156DECLARE157 l_response CLOB;158BEGIN159 l_response := APEX_AI.GENERATE(160 p_prompt => 'List all overdue invoices over $10,000',161 p_model => 'OCI_GENAI_COHERE',162 p_system_prompt => 'Generate Oracle SQL for the AP schema. Tables: AP_INVOICES_ALL, AP_INVOICE_LINES_ALL.'163 );164 DBMS_OUTPUT.PUT_LINE(l_response);165END;166```167168## Anti-Patterns169170- Using OCI GenAI exclusively when Claude/GPT are needed -- Oracle's model selection is limited171- Direct database queries bypassing Fusion REST APIs -- always use REST APIs for application data172- Hardcoding Oracle credentials -- use OCI Vault or Oracle Credential Store173- Ignoring Oracle's data security policies -- Fusion enforces row-level security via business units174- Skipping pagination -- Oracle REST APIs use offset/limit; always handle multi-page results175176## References177178- [Oracle Fusion Cloud REST API](https://docs.oracle.com/en/cloud/saas/applications-common/24d/farca/)179- [Oracle AI Agents](https://www.oracle.com/artificial-intelligence/ai-agents/)180- [OCI Generative AI Service](https://www.oracle.com/artificial-intelligence/generative-ai/large-language-models/)181- [Oracle APEX AI](https://apex.oracle.com/en/platform/features/ai/)182183<!-- Source: .faos/custom/skills/integrations/oracle-fusion-ai/SKILL.md -->