Skip to content

Commit 2a8f21e

Browse files
authored
added apex and policy (#355)
* added apex and policy * images changed removed root
1 parent fce1456 commit 2a8f21e

18 files changed

+106
-1
lines changed

multichannel-oci-genaiagents/2-setup/setup.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ Next, we will create the access policies:
117117
allow group <your-user-group-name> to manage genai-agent-family in tenancy
118118
allow group <your-user-group-name> to manage object-family in tenancy
119119
allow dynamic-group <dynamic-group-name-created-above> to manage all-resources in tenancy
120+
allow any-user to manage genai-agent-family in tenancy where request.principal.id=<ODA OCID>
120121
</copy>
121122
```
122-
123+
Make sure to put the ODA OCID in the above policy in single inverted commas instead of <ODA OCID>
123124
Make sure to replace `<your-user-group-name>` with the user group your user is associated with (for example: `Administrators`).
124125
Also, please replace `<dynamic-group-name-created-above>` with the name you've provided for the dynamic group created above.
125126

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Connect APEX with GenAI Agent
2+
## Introduction
3+
4+
In this lab, we will learn how to expose Gen AI Agents via Oracle APEX. This involves retrieving the Agent Endpoint ID and configuring APEX to interact with the Gen AI Agent.
5+
6+
Estimated Time: 20 minutes
7+
8+
### Objectives
9+
10+
In this lab, you will:
11+
- Retrieve the Agent Endpoint ID.
12+
- Configure a Digital Assistant to interact with the Gen AI Agent.
13+
14+
### Prerequisites
15+
16+
This lab assumes you have:
17+
- Access to the Gen AI Agent dashboard.
18+
- GenerativeAI Agent Endpoint ID. See Lab: Connect ODA with GenAI Agent - Task 1
19+
- [Download the APEX app, here](https://objectstorage.eu-frankfurt-1.oraclecloud.com/n/frpj5kvxryk1/b/genAiAgents/o/apex_ai_agent_2024_11_19.sql)
20+
21+
Note: The lab should work also with any Database 19c+ with APEX and DBMS_CLOUD. Here, we use Autonomous database since both are preinstalled.
22+
23+
## Task 1: Policies
24+
25+
1. Click the hamburger menu on the left-hand corner and go to **Oracle Database > Autonomous Transaction Processing**.
26+
27+
![Autonomous Database](./images/ai_agent_atp.png)
28+
29+
2. Click on the Autonomous Database name (or create a new one with all default) and find the OCID (something like ocid1.autonomousdatabase.oc1.eu-frankfurt-1.abcdefghj..)
30+
31+
![ATP OCID](./images/ai_agent_atp_ocid.png)
32+
33+
3. Click the hamburger menu on the left-hand corner and go to **Identity and Security > Policies**.
34+
35+
![Policy](./images/ai_agent_policy.png)
36+
37+
4. Change to the root compartment. Create a policy with rules like this one (use your OCID found above)
38+
39+
![Policy](./images/ai_agent_policy_create.png)
40+
41+
```
42+
allow any-user to manage genai-agent-family in tenancy where request.principal.id='ocid1.autonomousdatabase.oc1.eu-frankfurt-1.abcdefghj...'
43+
allow any-user to read object-family in tenancy where request.principal.id='ocid1.autonomousdatabase.oc1.eu-frankfurt-1.abcdefghj...'
44+
allow any-user to manage object-family in tenancy where ALL { request.principal.id='ocid1.autonomousdatabase.oc1.eu-frankfurt-1.abcdefghj...', request.permission = 'PAR_MANAGE' }
45+
```
46+
47+
## Task 2: Configure Autonomous Database
48+
49+
1. Click the hamburger menu on the left-hand corner and go to **Oracle Database > Autonomous Transaction Processing**.
50+
51+
![Autonomous Database](./images/ai_agent_atp.png)
52+
53+
2. Click on your database name
54+
3. Click on the button **Database Actions / View All Database Actions**
55+
56+
![Database Actions](./images/ai_agent_db_action.png)
57+
58+
4. Choose **APEX**. Click **Open**
59+
5. If you have already an existing APEX workspace, log in it. If not, create one with Administration Services.
60+
6. Click **Application Builder / Import**. Choose the APEX app that your downloaded above (apex_ai_agent_xx.sql). Then **Next**.
61+
62+
![APEX](./images/ai_agent_apex.png)
63+
64+
7. Click **Install Application**
65+
66+
![Import](./images/ai_agent_apex_import.png)
67+
68+
8. Click **Install Supporting Objects**
69+
9. When the installation is done, click **Edit Application**.
70+
71+
![Edit](./images/ai_agent_apex_edit.png)
72+
73+
10. Click on page 1
74+
11. Open Pre-rendering / CREATE_SESSION
75+
12. Edit the agent endpoint id. Save and Run
76+
![Endpoint](./images/ai_agent_apex_endpoint.png)
77+
78+
## Task 3: Test the application
79+
80+
1. Type your question in message. Then Send
81+
82+
![Test](./images/ai_agent_apex_test.png)
83+
84+
2. Check the response. Hover the mouse to see the citations of the original documents.
85+
3. Click on the link of the original document to see it.
86+
87+
## Learn More
88+
89+
- [Gen AI Agent Documentation](https://docs.oracle.com/en-us/iaas/Content/genAI/getting-started.htm)
90+
- [Autonomous Database Documentation](https://docs.oracle.com/en-us/iaas/digital-assistant/getting-started.htm)
91+
92+
## Acknowledgements
93+
94+
* **Author** - Anshuman Panda, Marc Gueury, Alexandru Negrea
95+
96+
* **Last Updated By/Date** - Marc Gueury - Nov 2024
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

multichannel-oci-genaiagents/workshops/sandbox/manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
"title": "LAB 6: Connect ODA with Slack",
3939
"filename": "../../8-connect-oda-with-slack/connect-oda-with-slack.md"
4040
},
41+
{
42+
"title": "LAB 7: Connect APEX with GenAI Agent",
43+
"filename": "../../9-connect-apex-with-agents/connect-apex-with-agents.md"
44+
},
4145
{
4246
"title": "Need Help?",
4347
"filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md"

multichannel-oci-genaiagents/workshops/tenancy/manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
"title": "LAB 6: Connect ODA with Slack",
3939
"filename": "../../8-connect-oda-with-slack/connect-oda-with-slack.md"
4040
},
41+
{
42+
"title": "LAB 7: Connect APEX with GenAI Agent",
43+
"filename": "../../9-connect-apex-with-agents/connect-apex-with-agents.md"
44+
},
4145
{
4246
"title": "Need Help?",
4347
"filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md"

0 commit comments

Comments
 (0)