An OIC AI Agent is a Gen3 Oracle Integration Cloud component that pairs a large language model with a registered REST integration ("tool"), so it can read a natural-language request, reason about what to do using a thinking pattern like ReAct, call the right tool, and reply in plain English — turning a manual approval process into an instant, automated one.
Have you ever wondered how a computer can decide whether to approve your expense claim?
How does an AI assistant know that $350 for a client dinner is fine, but $750 for travel needs extra approval?
The secret lives inside a smart architecture built on Oracle Integration Cloud (OIC) — and we build it from scratch today.
Imagine replacing a manual manager approval process with an AI assistant that reads the expense,
checks the company rules, and replies instantly — no paper, no waiting, no human bottleneck.
That is exactly what we are building! 🚀
🗺️ The Big Picture — What Are We Actually Building?
Every time an employee spends money — a hotel, a flight, a client dinner — they submit an expense report.
A manager then checks the amount and decides: approve it or reject it.
Here is how that flow looks when an AI agent handles it:
Employee
Submits
AI Agent
Reads
LLM
Thinks
Tool
Called
Decision
Made
Reply
Sent
Simple, right? Now let us understand each piece before we build it! 🎯
📌 Part 1 — What Is an OIC AI Agent?
Oracle Integration Cloud (OIC) is Oracle's platform for connecting systems and automating processes.
As of 2025–2026, it also lets you build AI-powered agents that can think and act on your behalf.
Think of your expense approval process as a mailbox at the office front desk.
Old way: You drop a paper form in the mailbox → the manager picks it up → reads the amount → stamps "Approved" or "Rejected" → mails it back. This takes days.
New way (OIC AI Agent): You send a message to a robot assistant → the robot thinks about the amount → checks the company rules → replies instantly. No paper. No waiting. No human bottleneck. ⚡
An AI Agent in OIC is like a very smart receptionist at a company.
You give the receptionist a job description (called a system prompt), a list of tools they can use (like a telephone, a computer, or a filing cabinet), and a rule book (the LLM — the brain that knows how to reason).
When a visitor (your API call) arrives, the receptionist reads the request, thinks about what to do, picks the right tool, and gives back an answer. You never told them every step — they figured it out themselves. 🧠
🔍 The 5 Key Pieces of an OIC AI Agent
Before we build anything, let us understand what each piece does:
| Piece | What It Is in Plain English | Our Example |
|---|---|---|
| Project | A folder that holds everything together | ExpenseApprovalProject |
| REST Integration | The actual worker — does the real logic | Checks amount, returns decision |
| Tool | A skill the agent can call when needed | The REST integration, registered as a tool |
| LLM | The AI brain — reads, reasons, decides | Oracle GenAI (Cohere or Llama) |
| Thinking Pattern | The strategy the agent uses to reason | ReAct — think, act, observe, repeat |
In OIC, the REST integration does NOT need to contain the decision reasoning. The AI agent does the reasoning. The integration is just the executor — it receives an amount and returns a structured response. The "thinking" happens in the LLM layer, not in the integration code. This is what makes the architecture so clean, maintainable, and powerful. ✅
🔄 Part 2 — The ReAct Thinking Pattern
When you configure the AI Agent, you choose a Thinking Pattern.
The most common and powerful one in OIC is called ReAct — Reasoning + Acting.
Think of a detective solving a case. They do not jump to conclusions. Instead they follow a loop:
Think → "What do I know? What do I need?"
Act → "I will check the expense database."
Observe → "The amount is $800. The policy limit is $500."
Think again → "This exceeds the limit."
Final answer → "REJECTED — amount exceeds the $500 threshold."
That loop — Think, Act, Observe, Think, Answer — is exactly what ReAct does. 🔍
🔍 How the ReAct Loop Flows
Here is how the ReAct pattern moves through each step for a single expense request:
You do not write the ReAct loop yourself. You just choose "ReAct" in the OIC Agent settings and the platform handles everything automatically. Knowing it exists helps you understand why the agent sometimes calls a tool more than once, or why it can combine information from two sources before answering.
🛠️ Part 3 — Building the Agent — Step by Step
We will go through six steps.
Think of it like assembling a LEGO set — each step snaps one piece into place,
and at the end you have a complete, working AI agent! 🧱
Let us build each step now! 🚀
⌨️ Step 1 — Create a Project in OIC
When you log into OIC, the first thing you do is create a Project.
Think of it as a project folder on your computer — everything related to this expense
approval feature will live inside it.
Projects in OIC let you group related integrations and agents together. This makes it easy to find them, move them between environments (Dev → QA → Prod), and manage access for your team. Always start with a project — never create integrations loose.
How to do it:
- Open OIC Console → click Projects in the left menu.
- Click + Create.
- Name it
ExpenseApprovalProject. - Add a description: "AI agent that approves or rejects expense claims."
- Click Create. Done!
An empty project folder. In the next steps, we will put things inside it. The folder itself costs nothing and takes 30 seconds to create. ✅
⌨️ Step 2 — Build the REST Integration (The Tool)
This is the core worker of our system.
It accepts one input — the expense amount — checks a rule, and returns a decision.
Think of this integration like a vending machine. You put money in (the expense amount) → the machine checks if it is enough → it gives you back a result (the decision). Simple input, simple output.
No thinking. No judgment. Just execute and return. The thinking about whether to use the machine at all — that is the AI agent's job. 🎰
🔍 Creating the Integration
- Inside your project, click + Add → Integration.
- Choose App Driven Orchestration.
- Name it:
CheckExpenseApproval - Add a description: "Receives expense amount. Returns APPROVED or REJECTED."
🔍 Configure the REST Trigger (the Entry Point)
- In the canvas, click the + on the trigger and choose REST.
- Name the connection:
ExpenseRestTrigger - Set the endpoint:
/checkExpense - Method: POST
- Enable: "Configure a request payload"
- Enable: "Configure a response payload"
🔍 Define the Request Payload (What Comes In)
This is the shape of the data your integration will receive. It says: "I expect one field called
expenseAmount which is a number."
Think of it as a form template — telling OIC exactly what information to expect from the caller.
The required array enforces that expenseAmount must always be present.
{
"type": "object",
"properties": {
"expenseAmount": {
"type": "number",
"description": "The amount of the expense in USD"
},
"expenseCategory": {
"type": "string",
"description": "Category such as Travel, Meals, Office Supplies"
}
},
"required": ["expenseAmount"]
}
🔍 Define the Response Payload (What Goes Out)
This tells OIC what your integration will send back. The caller (and the AI agent) will receive a
decision field ("APPROVED" or "REJECTED"),
a reason explaining why, and the original amount for reference.
Clear structured output is critical — the AI agent reads this JSON and uses it to
formulate its plain-English reply to the user.
{
"type": "object",
"properties": {
"decision": {
"type": "string",
"description": "APPROVED or REJECTED"
},
"reason": {
"type": "string",
"description": "Explanation for the decision"
},
"amount": {
"type": "number",
"description": "The expense amount that was evaluated"
},
"threshold": {
"type": "number",
"description": "The policy threshold used for evaluation"
}
}
}
🔍 Add the Decision Logic — Using a Switch Activity
Inside the integration canvas, after the trigger, we add an If/Else (Switch) activity.
This is where the business rule lives.
This is the condition we put in the Switch activity. It reads the incoming expense amount and checks if it is greater than 500. If yes → we go to the "REJECTED" branch. If no → we go to the "APPROVED" branch. This is written in XPath — the expression language OIC uses in its mapper. Just copy this pattern and adjust the number to change the threshold.
$CheckExpenseApprovalRequest/nsmpr0:request-wrapper/expenseAmount > 500
We use $500 as the threshold in this tutorial. In a real system you would read this from a configuration variable or a database, so finance teams can change it without touching the integration. For now, 500 is hardcoded to keep it simple.
🔍 Map the Response — Approved Branch
When the amount is $500 or below, we map these values into the response. The decision field gets "APPROVED", the reason field gets a human-readable explanation, and the amount and threshold fields echo back the numbers. The AI agent will read this text and include it in the final answer to the user.
decision → "APPROVED" reason → "Expense amount is within the approved policy limit of $500" amount → $expenseAmount (map from input) threshold → 500
🔍 Map the Response — Rejected Branch
When the amount exceeds $500, we return "REJECTED" with a clear reason. The reason text is important — the AI agent will quote it or paraphrase it in its final answer, so make it descriptive and human-friendly. A good reason message includes the amount, the limit, and the next step for the employee.
decision → "REJECTED"
reason → "Expense amount exceeds the maximum approved limit of $500.
Please seek manager approval."
amount → $expenseAmount (map from input)
threshold → 500
A complete REST integration that accepts an expense amount and returns a structured APPROVED or REJECTED decision with a clear reason. It is ready to be activated! ✅
⌨️ Step 3 — Activate the Integration
An integration in OIC only comes to life when it is activated.
Before activation it is just a design — a blueprint on paper.
After activation it has a real, live REST URL that can receive calls.
Think of it like publishing a YouTube video. While you are editing it, only you can see it. The moment you hit Publish, the world can watch it. Activation is the Publish button for your integration. 📺
- In your project, find
CheckExpenseApproval. - Click the three-dot menu (⋮) → Activate.
- Enable Tracing — this lets you see what happened inside each run later.
- Click Activate. Wait a few seconds.
- The integration status turns green. It is now live. ✅
After activation, OIC shows you the REST endpoint URL. Copy it — it looks like:
https://your-oic-host/ic/api/integration/v1/flows/rest/CHECKEXPENSEAPPROVAL/1.0/checkExpenseYou will reference this when you register the integration as a tool in the agent.
⌨️ Step 4 — Create the AI Agent and Register the Tool
This is where the magic starts.
We create the AI Agent, configure the LLM brain, choose the thinking pattern,
and connect the integration as a tool the agent can call.
🔍 Create the Agent
- Inside your project, click + Add → Agent.
- Name it:
ExpenseApprovalAgent - Description: "AI agent that evaluates employee expense claims and makes approval decisions."
- Click Create.
🔍 Configure the LLM
- In the agent settings, find the Model section.
- Select your LLM provider: OCI Generative AI Service
- Choose the model — Oracle's recommended options for 2026 are:
cohere.command-r-plus(great for structured tasks) ormeta.llama-3.3-70b-instruct(good for nuanced reasoning). - Set Temperature to
0.0— consistent, predictable answers for business approvals. - Set Max Tokens to
500— enough for a clear decision response.
Temperature controls how "random" or "creative" the AI is.
Temperature 0.0 = Robot mode. Always gives the same answer for the same input. Great for business logic where consistency matters.
Temperature 1.0 = Creative mode. Gives different answers each time. Great for writing poems or brainstorming ideas.
For expense approvals: always use 0.0. Non-negotiable.
🔍 Choose the Thinking Pattern
- In the agent settings, find Thinking Pattern.
- Select ReAct (Reasoning + Acting).
- Set Max Iterations to
3. The agent can Think → Act → Observe a maximum of 3 times. For our simple case, it usually only needs 1 iteration.
🔍 Register the Tool
A Tool is a capability the agent can use.
We register our activated integration as a tool the agent calls when needed.
- In the agent canvas, click + Add Tool.
- Choose Integration as the tool type.
- Select
CheckExpenseApprovalfrom the list. - Give the tool a clear name:
check_expense_approval - Write the tool description (see below — this is critical).
The tool description is like a label on a drawer in the agent's filing cabinet. When the AI agent receives your question, it reads all the tool descriptions and decides which drawer to open. If your description is vague or wrong, the agent might open the wrong drawer — or no drawer at all. Make it precise, action-focused, and complete. This is one of the most important things you write. 🎯
Use this tool to evaluate whether an employee expense should be approved or rejected.
Input required:
- expenseAmount (number): The expense amount in US dollars
- expenseCategory (string, optional): Category such as Travel, Meals,
or Office Supplies
This tool returns:
- decision: APPROVED or REJECTED
- reason: Explanation for the decision
- amount: The submitted expense amount
- threshold: The policy limit that was applied
Call this tool whenever the user submits an expense amount for evaluation.
An AI Agent that has a brain (the LLM), a strategy (ReAct), and a tool it can use (the CheckExpenseApproval integration). The last piece is writing its job description — the system prompt. 🎯
⌨️ Step 5 — Write the System Prompt
The System Prompt is the most important configuration in your agent.
It is the set of permanent instructions that the AI reads before answering every single question.
Think of it as the employee handbook you give to a new hire on their first day.
Imagine you hire a new expense manager. On day one you hand them a handbook that says: "Your job is to review expense claims. Use the expense checking system. Always be polite. Always give a reason. Always mention the policy limit. Never approve amounts over $500 without flagging them."
The System Prompt is exactly that handbook — except for your AI agent. You are programming the agent's personality and job function using plain English. No code required. 📖
This prompt tells the AI agent five things: (1) what its role is, (2) what tool to use and when, (3) how to format the response, (4) what tone to use, and (5) the business rules to follow. The agent reads this before every conversation. Be specific — vague prompts produce vague, inconsistent answers.
You are an Expense Approval Assistant for a company's finance department. YOUR JOB: Review employee expense claims and make approval decisions using the check_expense_approval tool. HOW TO RESPOND: 1. Always call the check_expense_approval tool with the expense amount provided. 2. Read the tool's response. 3. Clearly state whether the expense is APPROVED or REJECTED. 4. Always include the reason from the tool's response. 5. Always mention the policy limit ($500) in your reply. 6. Be professional, clear, and concise. RESPONSE FORMAT: Start with the decision in capital letters (APPROVED / REJECTED), then provide one to two sentences explaining the outcome. EXAMPLE OUTPUT: "APPROVED — Your expense of $250 for Travel has been approved. This amount is within our standard policy limit of $500." RULES: - Never make a decision without calling the tool first. - Do not approve amounts above $500 on your own — always rely on the tool. - If the expense amount is missing from the user's message, ask for it politely. - Always be respectful and professional in your responses.
Do NOT write a system prompt like: "You are a helpful assistant. Help the user."
This gives the agent zero guidance. It will invent its own rules, make up thresholds, and give inconsistent answers every time. Always be specific about: what tool to use, what format to output, and what business rules apply. Your system prompt is the difference between a reliable agent and an unpredictable one. ❌
⌨️ Step 6 — Test and Monitor the Agent
Now it is time to run our agent!
We will use Postman to send test expense amounts and watch what happens. 🎯
🔍 Activating the Agent
- In the agent canvas, click Activate Agent (or Save and Activate).
- OIC will generate a unique agent endpoint URL. Copy it.
🔍 Test 1 — Approved Scenario ✅
We send an HTTP POST request to our AI agent's endpoint. The
sessionId is a unique ID for this conversation.
The userMessage is what the user is "saying" to the agent.
The agent reads the message, identifies the expense amount ($350),
calls the tool, gets APPROVED, and returns a human-friendly response.
POST https://your-oic-host/ic/api/integration/v1/agents/EXPENSEAPPROVALAGENT/1.0/sessions
Authorization: Basic <base64-encoded-credentials>
Content-Type: application/json
{
"sessionId": "session-001",
"userMessage": "I need approval for an expense of $350 for client dinner."
}
Expected Response:
{
"sessionId": "session-001",
"agentResponse": "APPROVED — Your expense of $350.00 for a client dinner has been approved.
This amount is within our standard company policy limit of $500.
Please submit your receipt through the expense portal.",
"status": "COMPLETED",
"iterations": 1
}
🔍 Test 2 — Rejected Scenario ❌
This time we send $750 — above the $500 threshold. The agent should call the tool, receive "REJECTED", and return a professional rejection message. Always test both the happy path (approved) and the sad path (rejected) before declaring your agent complete. Never ship an agent you have only tested for success!
POST https://your-oic-host/ic/api/integration/v1/agents/EXPENSEAPPROVALAGENT/1.0/sessions
Authorization: Basic <base64-encoded-credentials>
Content-Type: application/json
{
"sessionId": "session-002",
"userMessage": "Please approve my travel expense of $750 for the New York conference."
}
Expected Response:
{
"sessionId": "session-002",
"agentResponse": "REJECTED — Your travel expense of $750.00 for the New York conference
exceeds our standard policy limit of $500. To proceed, please request formal manager
approval through the HR portal and resubmit with the approval reference number.",
"status": "COMPLETED",
"iterations": 1
}
🔍 Monitoring the Agent — Looking Inside the Black Box
OIC gives you a monitoring interface so you can see exactly what the agent did during each run.
This is invaluable for debugging and understanding your agent's behaviour.
- Go to OIC Console → Observability → Instances.
- Find your agent runs (they have a different icon from regular integrations).
- Click on a run to open the Agent Trace.
- You will see the user's input, the agent's internal thinking, which tool was called with what parameters, what the tool returned, and the final response it generated.
Enable Tracing when you activate the integration (Step 3). Without tracing, the monitoring view shows you the input and output but not what happened in between. With tracing, you can see every mapper step, every branch taken, and every value passed. It is the difference between a black box and a glass box. 🔍
✅ Part 4 — Best Practices for OIC AI Agents
Before you ship this to production, here are the rules experienced OIC developers live by.
DOs first, then DON'Ts — follow these and you will save yourself hours of pain! 😅
- ✅ Start tiny. One tool. One decision. One test. Then expand. Complexity should grow with confidence, not before it.
- ✅ Write detailed tool descriptions. The LLM reads these to decide when to call your tool. Vague descriptions lead to missed calls or wrong calls.
- ✅ Set Temperature to 0.0 for business agents. You want consistent, deterministic decisions — not creative ones.
- ✅ Enable Tracing on all integrations. You will thank yourself when debugging at 11pm.
- ✅ Test the rejection path as carefully as the approval path. Your users will send edge cases you did not imagine.
- ✅ Version your agents. When you make changes, create a new version (v1.1) rather than overwriting. Clean rollback when things break.
- ❌ Don't put business logic in the system prompt alone. Always back it up with a tool that enforces the rule in code. The LLM can "forget" instructions under certain phrasings.
- ❌ Don't grant the agent more tools than it needs. More tools = more decisions = more chances to pick the wrong one. Keep it focused.
- ❌ Don't use Temperature > 0.2 for financial or legal decisions. Higher temperatures introduce randomness that is unacceptable in regulated contexts.
- ❌ Don't skip the monitoring step. Looking at traces is how you discover the agent is calling the tool with the wrong parameters.
- ❌ Don't hardcode credentials in integrations. Always use OIC Connections with Resource Principals or OCI Vault secrets.
When testing your agent with real expense amounts — never use real employee names or real financial data in your development environment. Use synthetic test data (e.g. "session-001, $350 client dinner") for all QA runs. OCI Vault and OIC Connections are your friends for managing credentials safely.
❓ Frequently Asked Questions
It's an Oracle Integration Cloud component that combines a large language model, a reasoning strategy such as ReAct, and one or more registered integrations acting as callable tools — letting it read a natural-language request, decide what to do, call the right tool, and reply in plain English.
ReAct stands for Reasoning plus Acting. The agent loops through Think, Act, and Observe steps — deciding what it needs to know, calling a tool to find out, reading the result, and repeating until it has enough information to give a final answer.
The integration is meant to be the executor, not the reasoner — it receives structured input and returns a structured decision. The actual reasoning about what to do with that decision happens in the LLM layer, which keeps the architecture clean, testable, and easy to change without touching the integration.
Temperature 0.0, which produces consistent, deterministic answers for the same input every time. Higher temperatures introduce randomness that is not acceptable for financial or policy-driven decisions.
The LLM reads every registered tool's description to decide which one to call and with what parameters. A vague or incomplete description can cause the agent to skip the tool entirely or call it incorrectly, so it needs to be precise, action-focused, and complete.
📝 Quick Summary — What We Built
- OIC AI Agent → A smart receptionist that reads expense requests, thinks using ReAct, calls the right tool, and replies in plain English — all automatically.
- REST Integration (The Tool) → A simple App Driven Orchestration integration that accepts an amount, checks it against a $500 threshold, and returns APPROVED or REJECTED. Like a vending machine — simple input, simple output.
- ReAct Thinking Pattern → Think → Act → Observe → Think → Answer. The agent's built-in reasoning loop. You choose it in settings — OIC handles the rest.
- System Prompt → The employee handbook for your AI agent. Tells it its role, which tool to use, how to format responses, and what rules to follow. Always be specific — vague prompts produce vague agents.
- Tool Description → The label on the filing cabinet drawer. The LLM reads this to know when and how to call your integration. Make it precise and action-focused.
- Temperature 0.0 → Robot mode for business decisions. Same input = same output every time. Never use Temperature > 0.2 for financial decisions.
- OIC Monitoring → Your glass box. See every step the agent took — input, thinking, tool call, tool result, final answer. Always enable Tracing before you activate. 🔍
Comments
Post a Comment