Creating RAG-Based AI Agents in Oracle Fusion HCM


In my previous blog, I had demonstrated how to setup the security for Oracle Fusion AI Agent Studio for Oracle HCM. In this particular blog, I will demonstrate how we can create a RAG-Based agent using AI Agent Studio. For demonstration purposes, I will be creating a policy agent. I took help help from my good friend – CoPilot to generate an Absence Policy document for a Fictitious Company. We will upload this document when we create the Agent Tool. On a high-level, the steps involved are as follows:

1. Create an Agent Tool
2. Submit "Process Agent Documents" ESS Job
3. Create an Agent Team
4. Create an Agent

5. Publish AI Agents

So let’s crack on!!!!

Create Agent Tool

Login to Oracle Fusion and navigate to Tools > AI Agent Studio.

From the navigation-pane at the bottom, click on Tools.

Click on Add.

Select the Tool Type as ‘Document’. Type in a Tool Name. Tool Code should auto-populate from the tool name you provide, but you can amend as per your requirement. Select the Oracle Fusion pillar or Family . From the drop-down list, select a Product. In this case, I will use ‘HCM’ and ‘Absences’ for Family and Product respectively.

Scroll down. For this tool, I will not need Human in the Loop approvals before running the tool, so I will keep this option disabled.

Under Documents, click on Add to upload the policy document.

Enter a name for the document. Set the

Upload the Policy document and click Create. Make sure to change the status to ‘Ready to publish’. Note that you should upload a pdf document here(.docx doesn’t work).

You can upload multiple documents here based on your requirements.

Click Create.

The Agent Tool has now been created. Next step is to publish the Document. We will do that by executing an ESS Job.

Submit “Process Agent Documents” ESS Job

As you might have noticed in the previous step, I have changed the status of the document from ‘Draft’ –> ‘Ready to publish’.

This step is important because, without updating the status, the document will not be picked up or published when the ‘Process Agent Documents’ ESS job runs.

To execute the ESS Job navigate to Tools > Scheduled Processes > Schedule New Process and submit the job Process Agent Documents.

Once the ESS job completes successfully, return to AI Agent Studio and verify that the document tool’s status has updated to Published. Our AI Agent Tool is now fully ready for use within AI Agents.

Create Agent Team

Next step is to create the AI Agent Team. To create the AI Agent Team, navigate to the Agent Teams tab. and click on the Add(+) button.

Under the Details tab, provide a Name for your Agent Team. Agent Team Code should auto-populate. You can amend if necessary. Under Family, select the pillar in which you want to create the Agent in. Select the Product. For this demonstration, I have used HCM and Absences for the Family and Product respectively.

Under the LLM tab, you can select the Large Language Model you want to use for NLP. You can chose to use the default model(GPT-4.1 Mini). Note that this model is free to use.

Or you can chose from the list of other available LLMs. Note that there might be additional charges to use these models. I would highly recommend checking with your Oracle CSM on the usage costs, in case you want to use any of these models.

If you are using one of the paid models, you have the flexibility to restrict the usage.

Under the Security tab, you can specify who should have access to use this Agent Team. If you want to make this Agent Team available for all employees, make sure you enable ‘For all employees’ option.

If you want to restrict the Agent Team to the users who are assigned to a specific role, you can select the appropriate role.

Under the Chat Experience tab, you can Enable file upload and Enable third party file upload options. For this demonstration, I will keep them disabled.

You can set Starter Questions under the Questions tab. Enable AI generated follow-up questions if you want. I will skip for this demonstration.

You can add any input variables under the Input Variables tab.

Click on Create to create your Agent Team.

Add Agent to the Agent Team

Once you have created the Agent Team, next step would be to create the Agent. From the tools panel on the left, click on Agents, as highlighted in the screenshot below. Then click on New Worker Agent, as we want to create a worker agent for this demo. Based on your requirement, you can also chose to add a Supervisor Agent.

The Agent creation panel pops up. Enter the Agent Name, Agent Code, Family and Product. Enter a Description for the Agent. Use the Agent Persona and Role to set the character profile(tone, style, attitude, and behavioural patterns) of the agent.

Use Prompt section to instruct the agent about its tasks, roles and responsibilities. Notice that I have instructed the agent to use the Document Tool – XXRM_LEAVE_AND_ABSENCE_POLICY_TOOL we created earlier to fetch the Absence policy details for our fictitious company. Add guidelines for agent responses.

I will leave default values for remainder of the tabs and click on Create. This will create the Agent under Agent. Note that we are yet to add our tool to the agent.

To add the tool, select Tools.

From the left-hand pane, search for the tool that you created earlier, and add the tool.

The tools window pops up. Click Add. Repeat these steps if you want to add more tools to the agent.

Notice that our tool has been added.

Next step would be to publish the agent. However, before publishing the agent and making it available for business users, you need to test the agent. Click on the Debug button to bring up the chat panel.

I ask the agent – “What is the annual leave entitlement?”

The agent refers to the document tool and comes back with a response, as shown below. Notice that in Debug mode, you can actually see what the agent is doing in the background. The screenshot below clearly shows that the agent has made a call to the XXRM Leave and Absence Policy Tool.

Click on the Source to check which documents have been used by the agent to respond to the user query.

We have successfully created an agent. Once you are happy with the tests, next step is to publish the agent team.

Publish Agent Team

To publish the agent team, click on the Publish button on the top-right-hand corner.

You should be able to verify the status from the Agent Teams page. Note that since we have created the Agent Teams from scratch, it has been tagged as a Custom Agent Team.

There you go, we have successfully created a custom RAG-based AI Agent in Oracle Fusion.

References

Leave a comment