diff --git a/oci-rag-agent/0-introduction/0-introduction.md b/oci-rag-agent/0-introduction/0-introduction.md new file mode 100644 index 00000000..457f7d8f --- /dev/null +++ b/oci-rag-agent/0-introduction/0-introduction.md @@ -0,0 +1,154 @@ +# Introduction + +## About this Workshop + +This workshop demonstrates how to integrate Oracle APEX with OCI **Generative AI Agents**, showcasing how enterprises can enhance their applications with intelligent, context-aware capabilities. You will explore the power of **Large Language Models (LLMs)** combined with **Retrieval-Augmented Generation (RAG)** to transform raw enterprise documents into actionable insights. + +As part of this workshop, you will begin by uploading various documents to OCI Object Storage, which serves as a secure, scalable repository for your enterprise data. These documents are then processed through an **ingestion job**, which parses, indexes, and prepares the data for interaction using the **OCI Generative AI service**. + +You will integrate a **chat interface** within your Oracle APEX application, allowing end users to interact with the Generative AI Agent in real time. The AI agent uses the previously ingested content to provide intelligent, personalized, and context-rich responses, enhancing user experience and driving operational efficiency. + +Estimated Time: 90 minutes + +### Objectives + +In this workshop, you will: + +- Creating an Agent in OCI Generative AI Agents. + +- Add API Keys in the OCI Console. + +- Create Web Credentials in Oracle APEX. + +- Create Session and Ingestion Job using OCI Ingestion Job REST APIs. + +- Set up an automation to monitor the status of incomplete Ingestion Jobs. + +- Create and invoke a REST Data Source in your APEX app using the OCI Generative AI Agents' Create Sessions REST API. + +- Design and customize a Classic Report for the chat widget. + +- Interact with OCI Generative AI Agents through the Chat REST API. + +>*Note: This workshop assumes you are using Oracle APEX 24.2. Some of the features might not be available in prior releases and the instructions, flow, and screenshots might differ if you use an older version of Oracle APEX. + +## Prerequisites + +- A paid Oracle Cloud Infrastructure (OCI) account or a FREE Oracle Cloud account with $300 credits for 30 days to use on other services. Read more about it at: [oracle.com/cloud/free/](https://www.oracle.com/cloud/free/). + +- An OCI compartment. An Oracle Cloud account comes with two pre-configured compartments - The tenancy (root compartment) and ManagedCompartmentForPaaS (created by Oracle for Oracle Platform services). + +- The logged-in user should have the necessary privileges to create and manage Autonomous Database instances in this compartment. You can configure these privileges via an OCI IAM Policy. If you are using a Free Tier account, it is likely that you already have all the necessary privileges. + +### **Let's Get Started!** + +If the menu is not displayed, you can open by clicking the menu button (![Menu icon](./images/menu-button.png)) at the upper-left corner of the page. + +## Downloads: Download and Install the Complete Application + +If you are stuck or the app is not working as expected, you can download and install the completed App as follows: + +1. Setup OCI: + + - Follow Lab 1 > Task 1 to generate API keys using the OCI Console, and update the existing web credentials with your credentials. + + - Follow Lab 1 > Task 2 to create a bucket in OCI Object Storage. + + - Follow Lab 2 > Task 1 and Task 2 to create a Knowledge Base and Generative AI Agents in OCI. + +2. [Click here](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/genai_agents_export.sql) to download the completed application. + +3. Import the **genai\_agents\_export.sql** file into your workspace. Follow the steps in the Install Application wizard to install the app along with the Supporting Objects. + +4. Update **Web Credentials** + + - Expand **App Builder**, then select **All Workspace Utilities** and click **Workspace Utilities**. + + ![App Builder](images/download-appbuild.png " ") + + - Click **Web Credentials**. + + ![Web credentials](images/web-creds.png " ") + + - Click **APEX\_OCI\_AI\_CRED**. + + ![Click Creds](images/click-creds.png " ") + + - Enter the following details using the configuration file you copied and click **Apply Changes**. + + - **OCI User ID**: Enter the OCID of the Oracle Cloud user Account. You can find the OCID in the Configuration File Preview generated during the API Key creation. + Your OCI User ID looks similar to **ocid1.user.oc1..aaaaaaaa\*\*\*\*\*\*wj3v23yla** + + - **OCI Private Key**: Open the private key (.pem file) downloaded in the previous task. Copy and paste the API Key. + + - **OCI Tenancy ID**: Enter the OCID for Tenancy. Your Tenancy ID looks similar to **ocid1.tenancy.oc1..aaaaaaaaf7ush\*\*\*\*cxx3qka** + + - **OCI Public Key Fingerprint**: Enter the Fingerprint ID. Your Fingerprint ID looks similar to **a8:8e:c2:8b:fe:\*\*\*\*:ff:4d:40** + + ![Enter Creds](images/enter-creds.png " ") + +5. Navigate to Shared Components > Data Sources > Rest Data Sources > Click **Create Sessions API**. + +6. Under Parameters, click **Add Parameter**. + + ![Add Parameter](images/download-addparams.png " ") + +7. Enter/select the following: + + - Type: **URL Pattern** + + - Name: **agentEndpointId** + + - Default Value: Enter your agent endpoint OCID, Refer - [Lab 2, Task3, Step 6](?lab=2-configure-kb-genai#Task3:FetchOCIDofGenerativeAIAgentandDataSource) + + ![Edit Parameter](images/download-eparams.png " ") + +8. Navigate to Page 1 of application, map the following page item: + + - Under Body, select **P1\_AGENT\_ENDPOINT\_ID**. + + - In the property editor, Default > Type : **Static**. + + - Under Static Value: Enter your agent endpoint OCID, Refer - [Lab 2, Task3, Step 6](?lab=2-configure-kb-genai#Task3:FetchOCIDofGenerativeAIAgentandDataSource) + + ![Map Endpoint](images/map-endpoint.png " ") + +9. Navigate to Page 5 of application, map the following page item: + + | | Page Item |Default > Type | Default > Static Value | + |---|-----------------|------|----------| + | 1 | P5\_COMPARTMENT\_ID| Static |Enter your OCI account Compartment OCID| + | 2 | P5\_CRED\_STATIC\_ID| Static | APEX\_OCI\_AI\_CRED | + | 3 | P5\_NAMESPACE\_NAME| Static | Enter Namespace which you copied while creating a Bucket| + | 4 | P5\_BUCKET\_NAME| Static | Enter the Bucket Name which you copied while creating a Bucket (For this Lab we have **GenAIRAGBucket**) | + | 5 | P5\_REGION| Static | Enter your Region. e.g. us-chicago-1 | + | 6 | P5\_DATASOURCE\_ID| Static | Enter your data source OCID.| + {: title="Map Page Items"} + + ![Map Compartment](images/map-compid.png " ") + + ![Map StaticId](images/map-static.png " ") + + ![Map Namespace](images/map-namespace.png " ") + + ![Map Bucket](images/map-bucket.png " ") + + ![Map Region](images/map-region.png " ") + + ![Map Datasource](images/map-datasource.png " ") + +10. All set. Now, run the application with the users you created and see it in action! + +## Learn More - *Useful Links* + +- [OCI Generative AI](https://www.oracle.com/artificial-intelligence/generative-ai/large-language-models/) +- [APEX on Autonomous](https://apex.oracle.com/autonomous) +- [APEX Collateral](https://www.oracle.com/database/technologies/appdev/apex/collateral.html) +- [Tutorials](https://apex.oracle.com/en/learn/tutorials) +- [Community](https://apex.oracle.com/community) +- [External Site + Slack](http://apex.world) + +## Acknowledgements + +- **Author(s)**: Roopesh Thokala, Senior Product Manager; Shailu Srivastava, Product Manager +- **Last Updated By/Date**: Shailu Srivastava, Product Manager, June 2025 diff --git a/oci-rag-agent/0-introduction/images/click-creds.png b/oci-rag-agent/0-introduction/images/click-creds.png new file mode 100644 index 00000000..7e7d67d5 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/click-creds.png differ diff --git a/oci-rag-agent/0-introduction/images/download-add.png b/oci-rag-agent/0-introduction/images/download-add.png new file mode 100644 index 00000000..f4eddf2a Binary files /dev/null and b/oci-rag-agent/0-introduction/images/download-add.png differ diff --git a/oci-rag-agent/0-introduction/images/download-addparams.png b/oci-rag-agent/0-introduction/images/download-addparams.png new file mode 100644 index 00000000..71375d17 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/download-addparams.png differ diff --git a/oci-rag-agent/0-introduction/images/download-appbuild.png b/oci-rag-agent/0-introduction/images/download-appbuild.png new file mode 100644 index 00000000..4edb7fc2 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/download-appbuild.png differ diff --git a/oci-rag-agent/0-introduction/images/download-eparams.png b/oci-rag-agent/0-introduction/images/download-eparams.png new file mode 100644 index 00000000..9240fcf1 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/download-eparams.png differ diff --git a/oci-rag-agent/0-introduction/images/download-parameter.png b/oci-rag-agent/0-introduction/images/download-parameter.png new file mode 100644 index 00000000..c107a04f Binary files /dev/null and b/oci-rag-agent/0-introduction/images/download-parameter.png differ diff --git a/oci-rag-agent/0-introduction/images/enter-creds.png b/oci-rag-agent/0-introduction/images/enter-creds.png new file mode 100644 index 00000000..bf2206cf Binary files /dev/null and b/oci-rag-agent/0-introduction/images/enter-creds.png differ diff --git a/oci-rag-agent/0-introduction/images/map-bucket.png b/oci-rag-agent/0-introduction/images/map-bucket.png new file mode 100644 index 00000000..b4ecb273 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/map-bucket.png differ diff --git a/oci-rag-agent/0-introduction/images/map-compid.png b/oci-rag-agent/0-introduction/images/map-compid.png new file mode 100644 index 00000000..5916b8b9 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/map-compid.png differ diff --git a/oci-rag-agent/0-introduction/images/map-datasource.png b/oci-rag-agent/0-introduction/images/map-datasource.png new file mode 100644 index 00000000..58e935b0 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/map-datasource.png differ diff --git a/oci-rag-agent/0-introduction/images/map-endpoint.png b/oci-rag-agent/0-introduction/images/map-endpoint.png new file mode 100644 index 00000000..69e8c3a7 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/map-endpoint.png differ diff --git a/oci-rag-agent/0-introduction/images/map-namespace.png b/oci-rag-agent/0-introduction/images/map-namespace.png new file mode 100644 index 00000000..bb10e10e Binary files /dev/null and b/oci-rag-agent/0-introduction/images/map-namespace.png differ diff --git a/oci-rag-agent/0-introduction/images/map-region.png b/oci-rag-agent/0-introduction/images/map-region.png new file mode 100644 index 00000000..10a49457 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/map-region.png differ diff --git a/oci-rag-agent/0-introduction/images/map-static.png b/oci-rag-agent/0-introduction/images/map-static.png new file mode 100644 index 00000000..947adc89 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/map-static.png differ diff --git a/oci-rag-agent/0-introduction/images/menu-button.png b/oci-rag-agent/0-introduction/images/menu-button.png new file mode 100644 index 00000000..1716bedb Binary files /dev/null and b/oci-rag-agent/0-introduction/images/menu-button.png differ diff --git a/oci-rag-agent/0-introduction/images/web-creds.png b/oci-rag-agent/0-introduction/images/web-creds.png new file mode 100644 index 00000000..2e5456c5 Binary files /dev/null and b/oci-rag-agent/0-introduction/images/web-creds.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/1-configure-oci-keys.md b/oci-rag-agent/1-configure-oci-keys/1-configure-oci-keys.md new file mode 100644 index 00000000..30fac52a --- /dev/null +++ b/oci-rag-agent/1-configure-oci-keys/1-configure-oci-keys.md @@ -0,0 +1,94 @@ +# Configure OCI API Keys and Bucket + +## Introduction + +In this lab, you learn how to configure the OCI API keys and create buckets in OCI Object Storage. In Oracle Cloud Infrastructure (OCI), API keys are used for secure authentication when accessing OCI resources through REST APIs, and a bucket refers to a logical container used to store and manage data objects within an Object Storage service. + +Setting up API keys is a one time step that allows your applications or tools to connect safely with your OCI account, giving trusted access to your environment in a secure way. OCI buckets allows you to store files like documents, PDFs, or any data you want to process or retrieve later. + +Estimated Time: 10 Minutes + +### Objectives + +In this lab, you: + +- Generate API Keys using OCI Console. + +- Create a Bucket in OCI Object Storage. + +- Create Knowledge Base in OCI. + +## Task 1: Generate API Keys using OCI Console + +To Generate the API Keys using OCI Console: + +1. Login into your OCI Account. + + ![Add API Key](images/oci-login.png " ") + +2. Click **My Profile** at the top-right corner and select **User settings**. + + ![Profile Menu](images/profile.png " ") + +3. Under **Tokens and keys** tab and click **Add API key**. + + ![Add API Key](images/api-keys.png " ") + +4. The Add API key dialog is displayed. Select **Generate API key pair** to create a new key pair. + +5. Click **Download private key**. A **.pem** file will be saved to your local device. You do not need to download the public key. + + >*Note: You will use this private key while configuring the web credentials in Oracle APEX in the upcoming lab.* + +6. Click **Add**. + + ![Profile Menu](images/add-api-key.png " ") + +7. The key is added, and the Configuration file preview is displayed. Copy and save the configuration file snippet from the text box into a notepad. You will use this information to create Oracle APEX Web Credentials. + + ![Profile Menu](images/configuration-preview.png " ") + +## Task 2: Create a Bucket in OCI Object Storage + +To create a Bucket using OCI Console, login to your OCI Account. + +1. To access the Object Storage service, click on the menu icon **(☰)** at the top-left corner. + + ![Navigate to storage](images/navigate-to-storage.png " ") + +2. Under Storage > Object Storage & Archive Storage > select **Buckets**. + + ![Select Bucket](images/select-bucket.png " ") + +3. Select the compartment where you want to create the Bucket. You can choose an existing compartment or create a new one if needed. Now, select **Create Bucket**. + + ![Select Bucket](images/create-bucket.png " ") + +4. Enter/select the following: + + - Bucket Name: **OCIDocAI** + + - Default Storage Tier: **Standard** + + Click **Create**. + + ![Select Bucket](images/bucket-details.png " ") + +5. Navigate to **OCIDocAI** Bucket. + + ![Select Bucket](images/bucket.png " ") + +6. Copy and save **Bucket Name** and **Namespace** from the bucket details into a notepad. You will use this information to upload an invoice to OCI Object Storage using Invoke API. + + ![Select Bucket](images/bucket-created.png " ") + +## Summary + +In this lab, you have learned how to configure OCI API keys and create buckets in OCI Object Storage. You set up secure authentication to allow safe access to OCI resources and created storage buckets to organize and manage files PDFs and text files. This setup forms the foundation for securely storing and accessing data. + +You may now proceed to the next lab. + +## Acknowledgements + +- **Author(s)** - Roopesh Thokala, Senior Product Manager; Shailu Srivastava, Product Manager +- **Last Updated By/Date** - Shailu Srivastava, Product Manager, June 2025 diff --git a/oci-rag-agent/1-configure-oci-keys/images/add-api-key.png b/oci-rag-agent/1-configure-oci-keys/images/add-api-key.png new file mode 100644 index 00000000..2ffde1cb Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/add-api-key.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/apex-login.png b/oci-rag-agent/1-configure-oci-keys/images/apex-login.png new file mode 100644 index 00000000..f11f2e72 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/apex-login.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/api-keys.png b/oci-rag-agent/1-configure-oci-keys/images/api-keys.png new file mode 100644 index 00000000..e370bae0 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/api-keys.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/app-builder.png b/oci-rag-agent/1-configure-oci-keys/images/app-builder.png new file mode 100644 index 00000000..09778c83 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/app-builder.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/app-builder1.png b/oci-rag-agent/1-configure-oci-keys/images/app-builder1.png new file mode 100644 index 00000000..4d781a96 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/app-builder1.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/bucket-created.png b/oci-rag-agent/1-configure-oci-keys/images/bucket-created.png new file mode 100644 index 00000000..976976e5 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/bucket-created.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/bucket-details.png b/oci-rag-agent/1-configure-oci-keys/images/bucket-details.png new file mode 100644 index 00000000..41f11b2a Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/bucket-details.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/bucket.png b/oci-rag-agent/1-configure-oci-keys/images/bucket.png new file mode 100644 index 00000000..7dde28f7 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/bucket.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/code-edit.png b/oci-rag-agent/1-configure-oci-keys/images/code-edit.png new file mode 100644 index 00000000..3ef1c963 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/code-edit.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/configuration-preview.png b/oci-rag-agent/1-configure-oci-keys/images/configuration-preview.png new file mode 100644 index 00000000..1eb184b7 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/configuration-preview.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/create-bucket.png b/oci-rag-agent/1-configure-oci-keys/images/create-bucket.png new file mode 100644 index 00000000..2e14cad8 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/create-bucket.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/create-wc.png b/oci-rag-agent/1-configure-oci-keys/images/create-wc.png new file mode 100644 index 00000000..c9e99f3d Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/create-wc.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/navigate-to-storage.png b/oci-rag-agent/1-configure-oci-keys/images/navigate-to-storage.png new file mode 100644 index 00000000..e02af470 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/navigate-to-storage.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/oci-login.png b/oci-rag-agent/1-configure-oci-keys/images/oci-login.png new file mode 100644 index 00000000..4abc5db4 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/oci-login.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/pd-timeline-edit.png b/oci-rag-agent/1-configure-oci-keys/images/pd-timeline-edit.png new file mode 100644 index 00000000..aeceb3ae Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/pd-timeline-edit.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/private-key.png b/oci-rag-agent/1-configure-oci-keys/images/private-key.png new file mode 100644 index 00000000..dbb6377a Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/private-key.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/profile.png b/oci-rag-agent/1-configure-oci-keys/images/profile.png new file mode 100644 index 00000000..108ba0cc Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/profile.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/sc-web-creds.png b/oci-rag-agent/1-configure-oci-keys/images/sc-web-creds.png new file mode 100644 index 00000000..4a714751 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/sc-web-creds.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/select-bucket.png b/oci-rag-agent/1-configure-oci-keys/images/select-bucket.png new file mode 100644 index 00000000..32a48c9f Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/select-bucket.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/web-creds.png b/oci-rag-agent/1-configure-oci-keys/images/web-creds.png new file mode 100644 index 00000000..e6d2c651 Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/web-creds.png differ diff --git a/oci-rag-agent/1-configure-oci-keys/images/workspace-utilities.png b/oci-rag-agent/1-configure-oci-keys/images/workspace-utilities.png new file mode 100644 index 00000000..4db0f02b Binary files /dev/null and b/oci-rag-agent/1-configure-oci-keys/images/workspace-utilities.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/2-configure-kb-genai.md b/oci-rag-agent/2-configure-kb-genai/2-configure-kb-genai.md new file mode 100644 index 00000000..16b97449 --- /dev/null +++ b/oci-rag-agent/2-configure-kb-genai/2-configure-kb-genai.md @@ -0,0 +1,182 @@ +# Create Knowledge Base and Generative AI Agents in OCI + +## Introduction + +In this lab, you will learn how to create a **Knowledge Base** and **Generative AI Agents** using Oracle’s Generative AI services. + +- A **Knowledge Base** serves as the foundation for all the data sources that an AI agent can access to retrieve relevant information and provide more accurate, context-aware responses during a conversation. + +- Oracle Cloud Infrastructure (OCI) **Generative AI Agents** combines the power of large language models (LLMs) and retrieval-augmented generation (RAG) with your enterprise data, letting users query diverse enterprise knowledge bases. The service provides up-to-date information through a natural language interface and the ability to act directly on it. + +Estimated Time: 10 Minutes + +### Objectives + +In this lab, you will: + +- Create a Knowledge Base in OCI. + +- Create Generative AI Agents in OCI. + +## Prerequisite + +- In the navigation bar of the Console, select a region with Generative AI Agents, for example, **US Midwest (Chicago) or UK South (London)**. See [Regions with Generative AI Agents](https://docs.oracle.com/en-us/iaas/Content/generative-ai-agents/overview.htm#regions) for the regions in which Generative AI Agents is hosted. + +## Task 1: Create a Knowledge Base in OCI + +To create Knowledge Base in OCI console: + +1. Click the menu icon **(☰)** at the top-left corner. + +2. Navigate to **Analytics & AI** > **AI Services** select **Generative AI Agents**. + + ![Select GenerativeAI](images/gen-ai-tab.png " ") + +3. Under **Generative AI Agents**, select **Knowledge Bases**. + + ![Select Knowledge Bases](images/select-knowledgebase.png " ") + +4. Click **Create Knowledge Base**. + + ![Create Knowledge Base](images/create-knowledgebase.png " ") + +5. Under **New knowledge base**, enter/select the following: + + - Name : **GenAIRAG** + + - Compartment: Choose your compartment + + - Data store type: **Object storage** + + ![Create Knowledge Base](images/new-knowledge-base.png " ") + +6. Under **Data sources**, click **Specify data source**. + +7. Under **Specify data source**, enter/select the following and click **Create**. + + - Name : **FilesforRAG** + + - Under Data bucket: + + - Select your bucket created in LAB1 > Task-2 + + - Select all in bucket: **Enable** + + ![Specify Data Source](images/specify-data-source.png " ") + +8. Click **Create**. + + ![Specify Data Source](images/create-knowledge-base.png " ") + +## Task 2: Create Generative AI Agents in OCI + +Follow the below steps to create Generate AI Agents in OCI Console: + +1. In the Console's navigation bar, choose a region that supports Generative AI Agents, such as US Midwest (Chicago) or UK South (London). For a full list of supported regions, refer to [Regions with Generative AI Agents](https://docs.oracle.com/en-us/iaas/Content/generative-ai-agents/overview.htm#regions). + +2. Navigate to menu icon **(☰)** at the top-left corner. + +3. Navigate to **Analytics & AI** and select **Generative AI Agents**. + + ![Select GenerativeAI](images/gen-ai-tab.png " ") + +4. Under **Generative AI Agents** and select **Agents**. + + ![Select Agents](images/select-agents.png " ") + +5. Under **Create agent**, enter/select the following and click **Next**: + + - Name: **OCIGenAlAgents_APEX** + + - Compartment: Choose your compartment + + - Click **Next** + + ![Create Agent](images/create-agent.png " ") + +6. Click **Create tool**. + + ![Click tool](images/add-tool.png " ") + +7. Under **Create tool**, enter/Select the following: + + - Select **RAG** + + - Name: **AIAgentsRAG_APEX** + + - Description: **RAG tool to chat with documents from OCl Object Storage** + + ![Add tool](images/select-RAG-tool.png " ") + +8. Scroll down and choose your **Knowledge base**, which you created in Lab2 > Task1. + + >*Note: If you have not created Knowledge Base in previous task, you can create it here by clicking **Create knowledge base*** + +9. Click **Create tool**. + + ![Select KnowledgeBase](images/select-knowledge-base.png " ") + +10. Once tool is created, click **Next**. + +11. Under **Setup agent endpoint**, leave everything as default and click **Next**. + + ![Select Endpoint1](images/setup-endpoint-1.png " ") + + ![Select Endpoint2](images/setup-endpoint-2.png " ") + +12. Now, click **Create agent**. + + ![Review Create](images/review-and-create.png " ") + +13. For **Llama 3 License Agreement and Acceptable Use Policy**, accept the agreement and click **Submit**. + + ![Accept Agreement](images/accept-llama3.png " ") + +## Task 3: Fetch OCID of Generative AI Agent and Data Source + +To Fetch the OCID of the Generative AI Agent and Data Source in OCI console: + +1. Navigate to the menu icon **(☰)** at the top-left corner. + +2. Navigate to **Analytics & AI** and select **Generative AI Agents**. + + ![Select GenerativeAI](images/gen-ai-tab.png " ") + +3. Under **Generative AI Agents**, select **Agents**. + + ![Select Agents](images/select-agents.png " ") + +4. Select your agent. + +5. Under **Endpoint**, select your endpoint. + + ![Click Endpoint](images/click-endpoint.png " ") + +6. Copy the agent endpoint **OCID**. (*Will use it in Lab 4 & 5*) + + ![Copy OCID](images/endpoint-ocid2.png " ") + +7. Navigate back to your agent. Under **Resources**, click **Knowledge Bases**. + + ![Click Knowledgebases](images/goto-knowledgebase.png " ") + +8. Under **Knowledge Bases**, select your knowledge base: **GenAIRAG**. + + ![Under Knowledgebases](images/click-genairag.png " ") + +9. Under **Data sources** , click **FilesforRAG**. + +10. Copy the **OCID**. (*will use it in LAB 5*) + + ![DataSource OCID](images/ocid-filesforrag.png " ") + +## Summary + +In this lab, you have learned how to configure a Knowledge Base for OCI Generative AI Agents. You explored how these agents utilize large language models (LLMs) and retrieval-augmented generation (RAG) to access and retrieve relevant information from enterprise data sources, enabling the delivery of accurate, context-aware responses through a natural language interface. + +You may now proceed to the next lab. + +## Acknowledgements + +- **Author(s)** - Roopesh Thokala, Senior Product Manager; Shailu Srivastava, Product Manager +- **Last Updated By/Date** - Shailu Srivastava, Product Manager, June 2025 diff --git a/oci-rag-agent/2-configure-kb-genai/images/accept-llama3.png b/oci-rag-agent/2-configure-kb-genai/images/accept-llama3.png new file mode 100644 index 00000000..62154633 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/accept-llama3.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/add-tool.png b/oci-rag-agent/2-configure-kb-genai/images/add-tool.png new file mode 100644 index 00000000..2d79986c Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/add-tool.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/agent-ocid.png b/oci-rag-agent/2-configure-kb-genai/images/agent-ocid.png new file mode 100644 index 00000000..d6ea90cb Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/agent-ocid.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/click-create-session.png b/oci-rag-agent/2-configure-kb-genai/images/click-create-session.png new file mode 100644 index 00000000..ce4dc7a6 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/click-create-session.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/click-endpoint.png b/oci-rag-agent/2-configure-kb-genai/images/click-endpoint.png new file mode 100644 index 00000000..38b7cc8a Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/click-endpoint.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/click-filesforrag.png b/oci-rag-agent/2-configure-kb-genai/images/click-filesforrag.png new file mode 100644 index 00000000..043d6d48 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/click-filesforrag.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/click-genairag.png b/oci-rag-agent/2-configure-kb-genai/images/click-genairag.png new file mode 100644 index 00000000..cbfe665d Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/click-genairag.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/create-agent.png b/oci-rag-agent/2-configure-kb-genai/images/create-agent.png new file mode 100644 index 00000000..a43bd8db Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/create-agent.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/create-knowledge-base.png b/oci-rag-agent/2-configure-kb-genai/images/create-knowledge-base.png new file mode 100644 index 00000000..100afd88 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/create-knowledge-base.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/create-knowledgebase.png b/oci-rag-agent/2-configure-kb-genai/images/create-knowledgebase.png new file mode 100644 index 00000000..c1d1e378 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/create-knowledgebase.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/edit-post.png b/oci-rag-agent/2-configure-kb-genai/images/edit-post.png new file mode 100644 index 00000000..1ed7dbf9 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/edit-post.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/endpoint-ocid2.png b/oci-rag-agent/2-configure-kb-genai/images/endpoint-ocid2.png new file mode 100644 index 00000000..04db40fd Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/endpoint-ocid2.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/gen-ai-tab.png b/oci-rag-agent/2-configure-kb-genai/images/gen-ai-tab.png new file mode 100644 index 00000000..dc0fcb0b Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/gen-ai-tab.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/goto-knowledgebase.png b/oci-rag-agent/2-configure-kb-genai/images/goto-knowledgebase.png new file mode 100644 index 00000000..d1517e80 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/goto-knowledgebase.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/new-knowledge-base.png b/oci-rag-agent/2-configure-kb-genai/images/new-knowledge-base.png new file mode 100644 index 00000000..a85ccaeb Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/new-knowledge-base.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/ocid-datasource.png b/oci-rag-agent/2-configure-kb-genai/images/ocid-datasource.png new file mode 100644 index 00000000..a7b4afcd Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/ocid-datasource.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/ocid-filesforrag.png b/oci-rag-agent/2-configure-kb-genai/images/ocid-filesforrag.png new file mode 100644 index 00000000..8f3d423a Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/ocid-filesforrag.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/request-body-template.png b/oci-rag-agent/2-configure-kb-genai/images/request-body-template.png new file mode 100644 index 00000000..489e467c Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/request-body-template.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/review-and-create 2.png b/oci-rag-agent/2-configure-kb-genai/images/review-and-create 2.png new file mode 100644 index 00000000..a8538a8d Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/review-and-create 2.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/review-and-create.png b/oci-rag-agent/2-configure-kb-genai/images/review-and-create.png new file mode 100644 index 00000000..e2d87e87 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/review-and-create.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/select-RAG-tool.png b/oci-rag-agent/2-configure-kb-genai/images/select-RAG-tool.png new file mode 100644 index 00000000..4858040d Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/select-RAG-tool.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/select-agents.png b/oci-rag-agent/2-configure-kb-genai/images/select-agents.png new file mode 100644 index 00000000..f1a22870 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/select-agents.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/select-knowledge-base.png b/oci-rag-agent/2-configure-kb-genai/images/select-knowledge-base.png new file mode 100644 index 00000000..1a5db739 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/select-knowledge-base.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/select-knowledgebase.png b/oci-rag-agent/2-configure-kb-genai/images/select-knowledgebase.png new file mode 100644 index 00000000..3c46114c Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/select-knowledgebase.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/setup-endpoint-1.png b/oci-rag-agent/2-configure-kb-genai/images/setup-endpoint-1.png new file mode 100644 index 00000000..3763955d Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/setup-endpoint-1.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/setup-endpoint-2.png b/oci-rag-agent/2-configure-kb-genai/images/setup-endpoint-2.png new file mode 100644 index 00000000..244fb65a Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/setup-endpoint-2.png differ diff --git a/oci-rag-agent/2-configure-kb-genai/images/specify-data-source.png b/oci-rag-agent/2-configure-kb-genai/images/specify-data-source.png new file mode 100644 index 00000000..84139348 Binary files /dev/null and b/oci-rag-agent/2-configure-kb-genai/images/specify-data-source.png differ diff --git a/oci-rag-agent/3-setup-task/3-setup-task.md b/oci-rag-agent/3-setup-task/3-setup-task.md new file mode 100644 index 00000000..114edd7f --- /dev/null +++ b/oci-rag-agent/3-setup-task/3-setup-task.md @@ -0,0 +1,339 @@ +# Setup Tasks for Application Development + +## Introduction + +In this lab, you will create tables, triggers, sequences, functions, and a package to manage chatbot conversation data, document uploads, and interactions with OCI Object Storage. To do this, you will run SQL commands using SQL Scripts. A SQL script can contain one or more SQL statements or PL/SQL blocks. You can use SQL scripts to create, edit, view, run, and delete database objects. + +Estimated Time: 10 Minutes + +### Objectives + +In this lab, you: + +- Create database objects using SQL Scripts. + +- Create Web Credentials. + +## Task 1: Create Database Objects using SQL Scripts + +>*Note: Explanation of Tables, Triggers, Sequences, Functions, and Packages:* + +- *RAG\_CHATBOT Table*: Stores chatbot conversation details like user prompts, session IDs, and timestamps. + +- *RAG\_CITATIONS Table*: Stores citations related to chatbot responses, including the source and location of the information used. + +- *DOC\_UPLOAD Table*: Manages metadata for documents uploaded to OCI Object Storage, including file names, MIME types, and URLs. + +- *DOC\_UPLOAD\_BIU Trigger*: Automatically updates creation and modification timestamps, as well as user information when documents are inserted or updated in the DOC_UPLOAD table. + +- *INGESTION\_SEQ Sequence*: Generates unique numeric IDs for tracking uploaded documents, starting at 401 and incrementing with each new record. + +- *URL\_ENCODE Function*: Encodes a string for safe use in URLs by escaping special characters to ensure proper transmission in HTTP requests. + +- *OCI\_OBJECT\_STORAGE\_UTILS Package*: Contains procedures to interact with OCI Object Storage, including uploading, retrieving, and deleting files from the cloud storage. + +1. Log into your APEX Workspace. Click **'⌄'** next to **SQL Workshop** and select **SQL Scripts**. + + ![Select Quick SQL](images/sql_script.png " ") + +2. Click **Create**. + + ![Create Quick SQL](images/create-quick-sql.png " ") + +3. Copy the following SQL code and paste it into the code editor: + + ``` + + CREATE TABLE "RAG_CHATBOT" ( + "CONV_ID" NUMBER + GENERATED BY DEFAULT ON NULL AS IDENTITY MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 + NOORDER NOCYCLE NOKEEP NOSCALE + NOT NULL ENABLE, + "USER_NAME" VARCHAR2(255 CHAR), + "COMMENT_TEXT" VARCHAR2(4000 CHAR), + "COMMENT_DATE" DATE, + "IS_OWN" VARCHAR2(10 CHAR), + "SESSION_ID" VARCHAR2(500), + CONSTRAINT "RAG_CHATBOT_ID_PK" PRIMARY KEY ( "CONV_ID" ) + USING INDEX ENABLE + ); + + CREATE TABLE "RAG_CITATIONS" ( + "ID" NUMBER + GENERATED BY DEFAULT ON NULL AS IDENTITY MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 + NOORDER NOCYCLE NOKEEP NOSCALE + NOT NULL ENABLE, + "CONV_ID" NUMBER, + "PROMPT" VARCHAR2(4000 CHAR), + "SOURCE_TEXT" VARCHAR2(4000 CHAR), + "SOURCE_LOCATION" VARCHAR2(4000 CHAR), + "ASKED_ON" DATE, + CONSTRAINT "RAG_CITATIONS_ID_PK" PRIMARY KEY ( "ID" ) + USING INDEX ENABLE + ); + + CREATE TABLE "DOC_UPLOAD" ( + "ID" NUMBER + GENERATED BY DEFAULT ON NULL AS IDENTITY MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 + NOORDER NOCYCLE NOKEEP NOSCALE + NOT NULL ENABLE, + "FILE_NAME" VARCHAR2(4000 CHAR), + "MIME_TYPE" VARCHAR2(4000 CHAR), + "OBJECT_STORAGE_URL" VARCHAR2(4000 CHAR), + "CREATED" DATE NOT NULL ENABLE, + "CREATED_BY" VARCHAR2(255 CHAR) NOT NULL ENABLE, + "UPDATED" DATE NOT NULL ENABLE, + "UPDATED_BY" VARCHAR2(255 CHAR) NOT NULL ENABLE, + "INGESTION_RESPONSE" VARCHAR2(100), + "DATA_ING_JOB_ID" VARCHAR2(300), + CONSTRAINT "DOC_UPLOAD_ID_PK" PRIMARY KEY ( "ID" ) + USING INDEX ENABLE + ); + + CREATE OR REPLACE EDITIONABLE TRIGGER "DOC_UPLOAD_BIU" BEFORE + INSERT OR UPDATE ON DOC_UPLOAD + FOR EACH ROW + BEGIN + IF INSERTING THEN + :NEW.CREATED := SYSDATE; + :NEW.CREATED_BY := COALESCE( + SYS_CONTEXT('APEX$SESSION', 'APP_USER'), + USER + ); + END IF; + + :NEW.UPDATED := SYSDATE; + :NEW.UPDATED_BY := COALESCE( + SYS_CONTEXT('APEX$SESSION', 'APP_USER'), + USER + ); + END DOC_UPLOAD_BIU; + / + + ALTER TRIGGER "DOC_UPLOAD_BIU" ENABLE; + + / + + CREATE SEQUENCE "INGESTION_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 401 CACHE 20 NOORDER NOCYCLE + NOKEEP NOSCALE GLOBAL; + + / + CREATE OR REPLACE FUNCTION URL_ENCODE ( + P_STR IN VARCHAR2 + ) RETURN VARCHAR2 IS + BEGIN + RETURN SYS.UTL_URL.ESCAPE( + URL => P_STR, + ESCAPE_RESERVED_CHARS => TRUE, + URL_CHARSET => 'AL32UTF8' + ); + END URL_ENCODE; + / + + CREATE OR REPLACE PACKAGE OCI_OBJECT_STORAGE_UTILS IS + PROCEDURE UPLOAD_FILE ( + P_FILE_CONTENT IN VARCHAR2, + P_STATIC_ID IN VARCHAR2, + P_NAMESPACE IN VARCHAR2, + P_BUCKET IN VARCHAR2, + P_REGION IN VARCHAR2, + P_OBJECT_STORAGE_URL OUT VARCHAR2, + P_FILE_NAME OUT VARCHAR2, + P_MIME_TYPE OUT VARCHAR2 + ); + + PROCEDURE GET_FILE ( + P_ID IN NUMBER + ); + + PROCEDURE DELETE_FILE ( + P_OBJECT_STORAGE_URL IN VARCHAR2, + P_STATIC_ID IN VARCHAR2, + P_MIME_TYPE IN VARCHAR2 + ); + + END OCI_OBJECT_STORAGE_UTILS; + / + + CREATE OR REPLACE PACKAGE BODY OCI_OBJECT_STORAGE_UTILS IS + + PROCEDURE UPLOAD_FILE ( + P_FILE_CONTENT IN VARCHAR2, + P_STATIC_ID IN VARCHAR2, + P_NAMESPACE IN VARCHAR2, + P_BUCKET IN VARCHAR2, + P_REGION IN VARCHAR2, + P_OBJECT_STORAGE_URL OUT VARCHAR2, + P_FILE_NAME OUT VARCHAR2, + P_MIME_TYPE OUT VARCHAR2 + ) IS + L_OBJECT BLOB; + L_RESPONSE CLOB; + BEGIN + SELECT + BLOB_CONTENT, + FILENAME, + MIME_TYPE + INTO + L_OBJECT, + P_FILE_NAME, + P_MIME_TYPE + FROM + APEX_APPLICATION_TEMP_FILES + WHERE + NAME = P_FILE_CONTENT; + + P_OBJECT_STORAGE_URL := 'https://objectstorage.' + || P_REGION + || '.oraclecloud.com/n/' + || P_NAMESPACE + || '/b/' + || P_BUCKET + || '/o/' + || URL_ENCODE(P_FILE_NAME); + + APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).NAME := 'Content-Type'; + APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).VALUE := P_MIME_TYPE; + L_RESPONSE := APEX_WEB_SERVICE.MAKE_REST_REQUEST( + P_URL => P_OBJECT_STORAGE_URL, + P_HTTP_METHOD => 'PUT', + P_BODY_BLOB => L_OBJECT, + P_CREDENTIAL_STATIC_ID => P_STATIC_ID + ); + + IF APEX_WEB_SERVICE.G_STATUS_CODE != 200 THEN + RAISE_APPLICATION_ERROR(-20000, 'Upload failed - ' || APEX_WEB_SERVICE.G_STATUS_CODE); + END IF; + + END UPLOAD_FILE; + + PROCEDURE GET_FILE ( + P_ID IN NUMBER + ) IS + + L_BLOB BLOB; + L_URL VARCHAR2(255); + L_MIME_TYPE VARCHAR2(50); + L_FILE_NAME VARCHAR2(100); + BEGIN + SELECT + MIME_TYPE, + OBJECT_STORAGE_URL, + FILE_NAME + INTO + L_MIME_TYPE, + L_URL, + L_FILE_NAME + FROM + DOC_UPLOAD + WHERE + ID = P_ID; + + L_BLOB := APEX_WEB_SERVICE.MAKE_REST_REQUEST_B( + P_URL => L_URL, + P_HTTP_METHOD => 'GET', + P_CREDENTIAL_STATIC_ID => 'APEX_OCI_AI_CRED' + ); + + APEX_HTTP.DOWNLOAD( + P_BLOB => L_BLOB, + P_CONTENT_TYPE => L_MIME_TYPE, + P_FILENAME => L_FILE_NAME + ); + + APEX_APPLICATION.STOP_APEX_ENGINE; + END GET_FILE; + + PROCEDURE DELETE_FILE ( + P_OBJECT_STORAGE_URL IN VARCHAR2, + P_STATIC_ID IN VARCHAR2, + P_MIME_TYPE IN VARCHAR2 + ) IS + L_RESPONSE CLOB; + BEGIN + APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).NAME := 'Content-Type'; + APEX_WEB_SERVICE.G_REQUEST_HEADERS(1).VALUE := P_MIME_TYPE; + L_RESPONSE := APEX_WEB_SERVICE.MAKE_REST_REQUEST( + P_URL => P_OBJECT_STORAGE_URL, + P_HTTP_METHOD => 'DELETE', + P_CREDENTIAL_STATIC_ID => P_STATIC_ID + ); + + END DELETE_FILE; + + END OCI_OBJECT_STORAGE_UTILS; + / + + ``` + +4. For **Script Name**: Enter **RAG_AGENT Script** and click **Run**. + + ![Script Name](./images/create-script.png " ") + +5. On the Run Script page, click **Run Now**. + + ![Run Now](images/run-now.png " ") + +6. The Results page shows the results of running the script. Scroll to the bottom to see a summary. You should not see any errors. + + ![SQL Script Results](images/successful-run1.png " ") + +## Task 2: Create Web Credentials in Oracle APEX + +Web credentials authenticate the connection to external REST services or REST-Enabled SQL services from APEX. + +Creating Web Credentials securely stores and encrypts authentication credentials for use by Oracle APEX components and APIs. Credentials cannot be retrieved back in clear text. They are stored at the workspace level and, therefore, visible to all applications. + +To create a Web Credential in Oracle APEX: + +1. On the Workspace home page, navigate to **App Builder**. + + ![Click App Builder](images/app-build5.png " ") + +2. Click **Workspace Utilities**. + + ![Click Workspace Utilities](images/workspace-utilities.png " ") + +3. Select **Web Credentials**. + + ![Click Web Credentials](images/web-credentials.png " ") + +4. Click **Create**. + + ![Create Web Credentials](images/create-web-creds.png " ") + +5. Enter/select the following details using the configuration file you copied in the previous task. + + - Name: **APEX\_OCI\_AI\_CRED** + + - Static ID: **APEX\_OCI\_AI\_CRED** + + - Authentication Type: **OCI Native Authentication** + + - OCI User ID: Enter the OCID of the Oracle Cloud user Account. The OCID is in the Configuration File Preview generated during the API Key creation. + Your OCI User ID looks similar to **ocid1.user.oc1..aaaaaaaa\*\*\*\*\*\*wj3v23yla** + + - OCI Private Key: Open the private key (.pem file) downloaded in the previous task. Copy and paste the API Key. + + ![Private key file](images/private-key.png " ") + + - OCI Tenancy ID: Enter the OCID for Tenancy. Your Tenancy ID looks similar to **ocid1.tenancy.oc1..aaaaaaaaf7ush\*\*\*\*cxx3qka** + + - OCI Public Key Fingerprint: Enter the Fingerprint ID. Your Fingerprint ID looks similar to **a8:8e:c2:8b:fe:\*\*\*\*:ff:4d:40** + + ![Web Credentials page](images/web-creds1.png " ") + +6. Click **Create**. + + ![Web Credentials page](images/web-creds-created.png " ") + +## Summary + +In this lab, you have learned how to run SQL commands using SQL Scripts. You have created tables, triggers, sequences, functions, and packages to manage chatbot conversation data, handle document uploads, and interact with OCI Object Storage. + +You're now ready to move on to the next lab! + +## Acknowledgements + +- **Author(s)** - Roopesh Thokala, Senior Product Manager; Shailu Srivastava, Product Manager +- **Last Updated By/Date** - Shailu Srivastava, Product Manager, June 2025 diff --git a/oci-rag-agent/3-setup-task/images/app-build5.png b/oci-rag-agent/3-setup-task/images/app-build5.png new file mode 100644 index 00000000..73e4deb7 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/app-build5.png differ diff --git a/oci-rag-agent/3-setup-task/images/create-multiple-users.png b/oci-rag-agent/3-setup-task/images/create-multiple-users.png new file mode 100644 index 00000000..83b5dfe8 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/create-multiple-users.png differ diff --git a/oci-rag-agent/3-setup-task/images/create-quick-sql.png b/oci-rag-agent/3-setup-task/images/create-quick-sql.png new file mode 100644 index 00000000..340ed383 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/create-quick-sql.png differ diff --git a/oci-rag-agent/3-setup-task/images/create-script.png b/oci-rag-agent/3-setup-task/images/create-script.png new file mode 100644 index 00000000..695d809d Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/create-script.png differ diff --git a/oci-rag-agent/3-setup-task/images/create-users-next.png b/oci-rag-agent/3-setup-task/images/create-users-next.png new file mode 100644 index 00000000..bb8ed6b1 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/create-users-next.png differ diff --git a/oci-rag-agent/3-setup-task/images/create-users-next1.png b/oci-rag-agent/3-setup-task/images/create-users-next1.png new file mode 100644 index 00000000..0769a378 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/create-users-next1.png differ diff --git a/oci-rag-agent/3-setup-task/images/create-valid-users.png b/oci-rag-agent/3-setup-task/images/create-valid-users.png new file mode 100644 index 00000000..7bba906b Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/create-valid-users.png differ diff --git a/oci-rag-agent/3-setup-task/images/create-web-creds.png b/oci-rag-agent/3-setup-task/images/create-web-creds.png new file mode 100644 index 00000000..75060325 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/create-web-creds.png differ diff --git a/oci-rag-agent/3-setup-task/images/manage-users.png b/oci-rag-agent/3-setup-task/images/manage-users.png new file mode 100644 index 00000000..62197191 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/manage-users.png differ diff --git a/oci-rag-agent/3-setup-task/images/private-key.png b/oci-rag-agent/3-setup-task/images/private-key.png new file mode 100644 index 00000000..dbb6377a Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/private-key.png differ diff --git a/oci-rag-agent/3-setup-task/images/run-now.png b/oci-rag-agent/3-setup-task/images/run-now.png new file mode 100644 index 00000000..4391e7d0 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/run-now.png differ diff --git a/oci-rag-agent/3-setup-task/images/script-name.png b/oci-rag-agent/3-setup-task/images/script-name.png new file mode 100644 index 00000000..c43947f2 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/script-name.png differ diff --git a/oci-rag-agent/3-setup-task/images/sql_script.png b/oci-rag-agent/3-setup-task/images/sql_script.png new file mode 100644 index 00000000..08d75718 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/sql_script.png differ diff --git a/oci-rag-agent/3-setup-task/images/successful-run.png b/oci-rag-agent/3-setup-task/images/successful-run.png new file mode 100644 index 00000000..992c57b4 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/successful-run.png differ diff --git a/oci-rag-agent/3-setup-task/images/successful-run1.png b/oci-rag-agent/3-setup-task/images/successful-run1.png new file mode 100644 index 00000000..0c98c043 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/successful-run1.png differ diff --git a/oci-rag-agent/3-setup-task/images/users-created.png b/oci-rag-agent/3-setup-task/images/users-created.png new file mode 100644 index 00000000..7ec14cd7 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/users-created.png differ diff --git a/oci-rag-agent/3-setup-task/images/web-credentials.png b/oci-rag-agent/3-setup-task/images/web-credentials.png new file mode 100644 index 00000000..e8931261 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/web-credentials.png differ diff --git a/oci-rag-agent/3-setup-task/images/web-creds-created.png b/oci-rag-agent/3-setup-task/images/web-creds-created.png new file mode 100644 index 00000000..2379a100 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/web-creds-created.png differ diff --git a/oci-rag-agent/3-setup-task/images/web-creds-details.png b/oci-rag-agent/3-setup-task/images/web-creds-details.png new file mode 100644 index 00000000..870a926b Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/web-creds-details.png differ diff --git a/oci-rag-agent/3-setup-task/images/web-creds1.png b/oci-rag-agent/3-setup-task/images/web-creds1.png new file mode 100644 index 00000000..b00af151 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/web-creds1.png differ diff --git a/oci-rag-agent/3-setup-task/images/workspace-utilities.png b/oci-rag-agent/3-setup-task/images/workspace-utilities.png new file mode 100644 index 00000000..a8dbfca6 Binary files /dev/null and b/oci-rag-agent/3-setup-task/images/workspace-utilities.png differ diff --git a/oci-rag-agent/4-configure-restapi/4-configure-restapi.md b/oci-rag-agent/4-configure-restapi/4-configure-restapi.md new file mode 100644 index 00000000..58cfe157 --- /dev/null +++ b/oci-rag-agent/4-configure-restapi/4-configure-restapi.md @@ -0,0 +1,264 @@ +# Create APEX App and Configure REST Data Source + +## Introduction + +In this lab, you create an APEX application named **GenAI Agents for APEX** using the Create App Wizard. Later, you will set up a REST Data Source to **Create Sessions** and invoke **Ingestion Job**. + +**Session Creation REST Data Source**: This REST data source is used to create a secure session with the Oracle Generative AI service. It establishes the authentication context required to interact with other AI APIs. + +**Ingestion Job REST Data Source**:This REST data source triggers an ingestion job to process and embed documents into the knowledge base. It enables the AI agent to access and retrieve relevant information for RAG-based responses. + +Estimated Time: 15 Minutes + +### Objectives + +In this lab, you will: + +- Create an APEX Application. + +- Create REST Data Sources for creating session + +- Create REST Data Source for Creating Ingestion Job + +## Task 1: Create an Application + +In this task, you will create an application that allow you to build pages, add components, and define business logic for your project. + +1. On the workspace home page, click down arrow **'⌄'** next to **App Builder** and click **Create**. + + ![Click Create](images/create.png " ") + +2. Select **Use Create App Wizard**. + + ![Use Create App Wizard](images/use-create-app-wizard.png " ") + +3. In Create an Application Wizard, enter/select the following: + + - Name : **GenAI Agents for APEX** + + ![Enter App name](images/app-name.png " ") + +4. Click **Add Page**. + + ![Blank Page Create](images/blank-page-create.png " ") + +5. Select **Blank**. + + ![Select Blank Page](images/create-blank-page.png " ") + +6. Under **Add Blank Page**, enter/select the following: + + - Name : **Chat With OCI Generative AI** + +7. Click **Add Page**. + + ![Blank Page Name](images/blank-page-name.png " ") + +8. Under **Pages**, click **Edit** beside **Home**. + + ![Edit Home Page](images/click-edit.png " ") + +9. Click **Delete**. + + ![Delete Home Page](images/delete-home-page.png " ") + +10. Click **Create Application**. + + ![Create Application](images/create-application.png " ") + +## Task 2: Invoke Create Session using REST Data Source + +1. Navigate to App Builder > Select your application > Shared Components **Shared Components**. + + ![Click REST Data Sources](images/shared-comp.png " ") + +2. Under **Data Sources**, select **REST Data Sources**. + + ![Click REST Data Sources](images/rest-data-source2.png " ") + +3. Click **Create**. + + ![Click Create](images/create-rest.png " ") + +4. Select **From scratch** and click **Next**. + + ![Click From scratch](images/rest-next.png " ") + +5. Under Create REST Data Source, enter/select the following: + + - REST Data Source Type: **Oracle Cloud Infrastructure (OCI)** + + - Name: **Create Session API** + + - URL Endpoint: + + - Value: your OCID from previos lab (lab 2 Task 3) + + Click **Next**. + + >**Note**: + - URL Endpoint may differ based on Region. Refer to the following link for more details- + - POST endpoint for Create Session: Refer to the following link for more details- + + ![Create REST Data Sources](images/general-tab.png " ") + +6. Under Create REST Data Source - Remote Server, click **Next**. + + ![Create REST Data Source - Remote Server](images/remote-server.png " ") + +7. Under Authentication, enter/select the following: + + - Authentication Required: Toggle **ON** + + - Credentials: **APEX\_OCI\_AI\_CRED** + +8. Click **Create REST Source Manually**. + The REST data source is created successfully. The next step is to configure the POST operation parameters for this REST Data Source. + + ![Click Create REST Source Manually](images/authentication-tab.png " ") + +9. On the REST Data Sources page, click **Create Session API**. + + ![Click Document Understanding API](images/click-create-session.png " ") + +10. Navigate to **Operations** tab , select **Edit icon** for the **POST** operation + + ![Click Edit POST](images/edit-post.png " ") + +11. For **Request Body Template**: Copy and paste the JSON given below. + + ``` + + { + "displayName": "#AGENT_NAME#", + "description": "#DESCRIPTION#" + } + + ``` + +12. Click **Synchronize with Body** and click **OK**. + + ![Request Body Teamplate](images/request-body-template.png " ") + + ![Synchronize with Body Ok](images/synchronize-ok.png " ") + +13. Under **Operation Parameters**, select **Add Parameter**. + + ![Click AGENT_NAME](images/add-parameter1.png " ") + +14. In the **Edit REST Data Source Parameter** dialog, add the following parameters: + + | | Type | Name | Direction | Default Value | Static | + |---|-------|------|----------| --------------| ------ | + | 1. | HTTP Header| Content-Type | In | application/json | ON | + | 2. | Request or Response Body| RESPONSE | Out | | | + {: title="POST Operation Parameters"} + + ![Content Type](images/content-type1.png " ") + +15. Click **Add Parameter**. + + ![Response](images/response.png " ") + +## Task 3: Invoke Ingestion Job using REST Data Source + +1. Navigate to **Shared Components**. + + ![Click REST Data Sources](images/shared-compss.png " ") + +2. Under **Data Sources**, select **REST Data Sources**. + + ![Click REST Data Sources](images/rest-data-source2.png " ") + +3. Click **Create**. + + ![Click Create](images/click-create-ingestion.png " ") + +4. Select **From scratch** and click **Next**. + + ![Click From scratch](images/rest-next.png " ") + +5. Under **Create REST Data Source**, enter/select the following: + + - REST Data Source Type: **Oracle Cloud Infrastructure (OCI)** + + - Name: **Create Ingestion Job API** + + - URL Endpoint: + + Click **Next**. + + >**Note**: + - URL Endpoint differs based on region not based on OCI Tenancy. Refer to the following link for more details- + - POST endpoint for Ingestion job Refer to the following link for more details + + ![Create REST Data Sources](images/general-tab2.png " ") + +6. Under Create REST Data Source - Remote Server, click **Next**. + + ![Create REST Data Source - Remote Server](images/remote-server-2.png " ") + +7. Under Authentication, enter/select the following: + + - Authentication Required: Toggle **ON** + + - Credentials: **APEX\_OCI\_AI\_CRED** + +8. Click **Create REST Source Manually**. + The REST data source is created successfully. The next step is to configure the POST operation parameters for this REST Data Source. + + ![Click Create REST Source Manually](images/authentication-tab.png " ") + +9. On the REST Data Sources page, click **Create Ingestion Job API**. + + ![Click Document Understanding API](images/click-create-ingestion-job.png " ") + +10. Navigate to **Operations** tab , select **Edit icon** for the **POST** operation. + + ![Click Edit POST](images/edit-post.png " ") + +11. For **Request Body Template**: Copy and paste the JSON given below. + + ``` + + { + "dataSourceId": "#DATASOURCEID#", + "compartmentId": "#COMPARTMENTID#", + "displayName": "#DISPLAYNAME#", + "description": "#DESCRIPTION#" + } + + ``` + +12. Click **Synchronize with Body** and click **OK**. + + ![Request Body Teamplate](images/request-body-template2.png " ") + + ![Synchronize with Body Ok](images/synchronize-ok2.png " ") + +13. Under **Operation Parameters**, select **Add Parameter**. + +14. In the **Edit REST Data Source Parameter** dialog, add the following two parameters one after the other: + + ![Add Parameter](images/add-parameter2.png " ") + + | | Type | Name | Direction | Default Value | Static | + |---|-------|------|----------| --------------| ------ | + | 1. | HTTP Header| Content-Type | In | application/json | ON | + | 2. | Request or Response Body| RESPONSE | Out | | | + {: title="POST Operation Parameters"} + +15. Click **Add Parameter**. + + ![Add Parameter](images/after-add.png " ") + +## Summary + +In this lab, you learned how to set up REST Data Sources for secure session creation and triggering ingestion jobs, enabling document embedding and AI agent access for RAG-based responses. + +You may now proceed to the next lab. + +## Acknowledgements + +- **Author(s)** - Roopesh Thokala, Senior Product Manager; Shailu Srivastava, Product Manager +- **Last Updated By/Date** - Shailu Srivastava, Product Manager, June 2025 diff --git a/oci-rag-agent/4-configure-restapi/images/add-parameter1.png b/oci-rag-agent/4-configure-restapi/images/add-parameter1.png new file mode 100644 index 00000000..5c2514a4 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/add-parameter1.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/add-parameter2.png b/oci-rag-agent/4-configure-restapi/images/add-parameter2.png new file mode 100644 index 00000000..b1e4a26e Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/add-parameter2.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/after-add.png b/oci-rag-agent/4-configure-restapi/images/after-add.png new file mode 100644 index 00000000..ea128df0 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/after-add.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/after-addparameter.png b/oci-rag-agent/4-configure-restapi/images/after-addparameter.png new file mode 100644 index 00000000..d2bff081 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/after-addparameter.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/agent-ocid.png b/oci-rag-agent/4-configure-restapi/images/agent-ocid.png new file mode 100644 index 00000000..12abbfcd Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/agent-ocid.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/app-name.png b/oci-rag-agent/4-configure-restapi/images/app-name.png new file mode 100644 index 00000000..da8a9827 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/app-name.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/apply-changes.png b/oci-rag-agent/4-configure-restapi/images/apply-changes.png new file mode 100644 index 00000000..d9042991 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/apply-changes.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/apply-changes1.png b/oci-rag-agent/4-configure-restapi/images/apply-changes1.png new file mode 100644 index 00000000..b3a4d099 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/apply-changes1.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/authentication-tab.png b/oci-rag-agent/4-configure-restapi/images/authentication-tab.png new file mode 100644 index 00000000..e2f44462 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/authentication-tab.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/blank-page-create.png b/oci-rag-agent/4-configure-restapi/images/blank-page-create.png new file mode 100644 index 00000000..1ee77176 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/blank-page-create.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/blank-page-name.png b/oci-rag-agent/4-configure-restapi/images/blank-page-name.png new file mode 100644 index 00000000..62ebb8c3 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/blank-page-name.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/click-create-ingestion-job.png b/oci-rag-agent/4-configure-restapi/images/click-create-ingestion-job.png new file mode 100644 index 00000000..d4133f77 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/click-create-ingestion-job.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/click-create-ingestion.png b/oci-rag-agent/4-configure-restapi/images/click-create-ingestion.png new file mode 100644 index 00000000..d059fa80 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/click-create-ingestion.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/click-create-session.png b/oci-rag-agent/4-configure-restapi/images/click-create-session.png new file mode 100644 index 00000000..ce4dc7a6 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/click-create-session.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/click-edit.png b/oci-rag-agent/4-configure-restapi/images/click-edit.png new file mode 100644 index 00000000..d1340733 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/click-edit.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/click-filesforrag.png b/oci-rag-agent/4-configure-restapi/images/click-filesforrag.png new file mode 100644 index 00000000..a5805d67 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/click-filesforrag.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/click-genairag.png b/oci-rag-agent/4-configure-restapi/images/click-genairag.png new file mode 100644 index 00000000..a676bb75 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/click-genairag.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/content-type.png b/oci-rag-agent/4-configure-restapi/images/content-type.png new file mode 100644 index 00000000..04cd7be2 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/content-type.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/content-type1.png b/oci-rag-agent/4-configure-restapi/images/content-type1.png new file mode 100644 index 00000000..a72a6e50 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/content-type1.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/create-application.png b/oci-rag-agent/4-configure-restapi/images/create-application.png new file mode 100644 index 00000000..8759a513 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/create-application.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/create-blank-page-option.png b/oci-rag-agent/4-configure-restapi/images/create-blank-page-option.png new file mode 100644 index 00000000..38c1dcd0 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/create-blank-page-option.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/create-blank-page.png b/oci-rag-agent/4-configure-restapi/images/create-blank-page.png new file mode 100644 index 00000000..38c1dcd0 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/create-blank-page.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/create-rest.png b/oci-rag-agent/4-configure-restapi/images/create-rest.png new file mode 100644 index 00000000..6eb2f5c6 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/create-rest.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/create.png b/oci-rag-agent/4-configure-restapi/images/create.png new file mode 100644 index 00000000..1abc6b8a Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/create.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/delete-home-page.png b/oci-rag-agent/4-configure-restapi/images/delete-home-page.png new file mode 100644 index 00000000..b6ee2cf3 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/delete-home-page.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/edit-agent-name.png b/oci-rag-agent/4-configure-restapi/images/edit-agent-name.png new file mode 100644 index 00000000..6cc3c5e8 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/edit-agent-name.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/edit-description.png b/oci-rag-agent/4-configure-restapi/images/edit-description.png new file mode 100644 index 00000000..5446e42e Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/edit-description.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/edit-post.png b/oci-rag-agent/4-configure-restapi/images/edit-post.png new file mode 100644 index 00000000..1ed7dbf9 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/edit-post.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/edit-rest-data-source.png b/oci-rag-agent/4-configure-restapi/images/edit-rest-data-source.png new file mode 100644 index 00000000..da2da023 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/edit-rest-data-source.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/edit-rest-data-source2.png b/oci-rag-agent/4-configure-restapi/images/edit-rest-data-source2.png new file mode 100644 index 00000000..e921d312 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/edit-rest-data-source2.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/general-tab.png b/oci-rag-agent/4-configure-restapi/images/general-tab.png new file mode 100644 index 00000000..393a2d5b Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/general-tab.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/general-tab2.png b/oci-rag-agent/4-configure-restapi/images/general-tab2.png new file mode 100644 index 00000000..5a019409 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/general-tab2.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/goto-knowledgebase.png b/oci-rag-agent/4-configure-restapi/images/goto-knowledgebase.png new file mode 100644 index 00000000..f5c3e904 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/goto-knowledgebase.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/ocid-datasource.png b/oci-rag-agent/4-configure-restapi/images/ocid-datasource.png new file mode 100644 index 00000000..b72e01e3 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/ocid-datasource.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/remote-server-2.png b/oci-rag-agent/4-configure-restapi/images/remote-server-2.png new file mode 100644 index 00000000..a8b5d2f1 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/remote-server-2.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/remote-server.png b/oci-rag-agent/4-configure-restapi/images/remote-server.png new file mode 100644 index 00000000..33cd8811 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/remote-server.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/request-body-template.png b/oci-rag-agent/4-configure-restapi/images/request-body-template.png new file mode 100644 index 00000000..489e467c Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/request-body-template.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/request-body-template2.png b/oci-rag-agent/4-configure-restapi/images/request-body-template2.png new file mode 100644 index 00000000..8d12f1b9 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/request-body-template2.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/response.png b/oci-rag-agent/4-configure-restapi/images/response.png new file mode 100644 index 00000000..742753c4 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/response.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/rest-data-source2.png b/oci-rag-agent/4-configure-restapi/images/rest-data-source2.png new file mode 100644 index 00000000..06e615c3 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/rest-data-source2.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/rest-next.png b/oci-rag-agent/4-configure-restapi/images/rest-next.png new file mode 100644 index 00000000..fe20ec6d Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/rest-next.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/shared-comp.png b/oci-rag-agent/4-configure-restapi/images/shared-comp.png new file mode 100644 index 00000000..3fa3f86d Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/shared-comp.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/shared-compss.png b/oci-rag-agent/4-configure-restapi/images/shared-compss.png new file mode 100644 index 00000000..62bbf2af Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/shared-compss.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/synchronize-ok.png b/oci-rag-agent/4-configure-restapi/images/synchronize-ok.png new file mode 100644 index 00000000..e6f0b6f1 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/synchronize-ok.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/synchronize-ok2.png b/oci-rag-agent/4-configure-restapi/images/synchronize-ok2.png new file mode 100644 index 00000000..a503a1d8 Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/synchronize-ok2.png differ diff --git a/oci-rag-agent/4-configure-restapi/images/use-create-app-wizard.png b/oci-rag-agent/4-configure-restapi/images/use-create-app-wizard.png new file mode 100644 index 00000000..ee87e1db Binary files /dev/null and b/oci-rag-agent/4-configure-restapi/images/use-create-app-wizard.png differ diff --git a/oci-rag-agent/5-create-app/5-create-app.md b/oci-rag-agent/5-create-app/5-create-app.md new file mode 100644 index 00000000..fba35839 --- /dev/null +++ b/oci-rag-agent/5-create-app/5-create-app.md @@ -0,0 +1,1434 @@ +# Add Page Items and Page Processes + +## Introduction + +Now that you have created the application, in this lab you will extend its functionality by creating the necessary processes and page items to support user interaction. Then, you will create interactive pages and invoke AI services using REST Data Sources. You'll also display AI-generated results and citations, add navigation buttons, and implement automation to fetch ingestion job details. + +Estimated Time: 45 Minutes + +### Objectives + +In this lab, you will: + +- Create Page Items and a Region for user input. + +- Create a Sub Region to add functional buttons. + +- Create Page Processes and Computations. + +- Create Pages for Document Processing and Viewing Citation. + +- Create Automation Process to fetch Ingestion Job details. + +## Task 1: Create Page Items and Region + +In this task, you will create Page Items, Static Content region and a subregion, and configure dynamic actions to control their behavior based on user interactions. + +1. Under **Rendering** tab, right-click **Body** and select **Create Page Item**. + + ![Create Pageitem](images/create-pageitem1.png " ") + +2. Create the following Page Items, one after another: + + | | Name | Type | Value Protected | Default > Static Value | + |---|-------|------|----------|---- | + | 1 | P1\_RESPONSE\_SESSION| Hidden | Toggle On || + | 2 | P1\_SESSION\_ID| Hidden | Toggle On || + | 3 | P1\_CONV\_ID| Hidden | Toggle On || + | 4 | P1\_APEX\_AI\_CRED| Hidden | Toggle Off || + | 5 | P1\_AGENT\_ENDPOINT\_ID| Hidden | Toggle Off || + | 6 | P1\_REGION| Hidden | Toggle On |us-chicago-1 (enter your region)| + {: title="Page Item Details"} + + ![Response Session](images/response-session.png " ") + + ![Session ID](images/session-id.png " ") + + ![Conv ID](images/conv-id.png " ") + + ![Create AI Cred](images/create-aicred.png " ") + + ![Create endpoint](images/create-endpointid.png " ") + + ![Region PageItem](images/region-pageitem.png " ") + +3. Select **P1\_APEX\_AI\_CRED** page item, enter/select the following: + + - Under Default: + + - Type: **Static** + + - Static value: **APEX\_OCI\_AI\_CRED** + +4. Select **P1\_AGENT\_ENDPOINT\_ID** page item, enter/select the following: + + - Under Default: + + - Type: **Static** + + - Static value: **ocid1.genaiagentendpoint.oc1.us-chicago-1.\*\*\*\*\*\*flywv7a** [Refer Lab 2, Task3, Step5](?lab=2-configure-kb-genai#Task3:FetchOCIDofGenerativeAIAgentandDataSource) + +5. In the **Rendering Tab**, right-Click **Body** and click **Create Region** + + ![Create Region](images/create-region.png " ") + +6. In the Property editor, enter/select the following: + + - Under Identification: + + - Name: **Chat with OCI Generative AI Agent** + + - Type: **Static Content** + + - Appearance > Template: **Blank with Attributes** + + - Advanced > Static ID : **functional_chat** + + ![Create Region](images/region-advanced.png " ") + +7. Right-click **Chat with OCI Generative AI Agent** region, select **Create Sub Region**. + + >* This sub-region is being created to display a chat conversation between user and AI agent, such as in a chatbot scenario. + +8. In the Property Editor, enter/select the following: + + - Under Identification: + + - Name: **AI Agents Conversation** + + - Type: **Classic Report** + + - Under Source: + + - Type: **SQL Query** + + - SQL Query : Copy and paste the below code + + ``` + + + SELECT + CONV_ID, + USER_NAME, + COMMENT_TEXT, + COMMENT_DATE, + APEX_STRING.GET_INITIALS(USER_NAME) USER_ICON, + CASE IS_OWN + WHEN 'Yes' THEN + NULL + ELSE + 'View Citations' + END ACTIONS, + NULL AS ATTRIBUTE_1, + NULL AS ATTRIBUTE_2, + NULL AS ATTRIBUTE_3, + NULL AS ATTRIBUTE_4, + CASE IS_OWN + WHEN 'Yes' THEN + 't-Chat--own' + ELSE + NULL + END COMMENT_MODIFIERS + FROM + RAG_CHATBOT + WHERE + SESSION_ID = :P1_SESSION_ID + ORDER BY + COMMENT_DATE ASC + + ``` + + ![Edit SubRegion](images/edit-subregion1.png " ") + + - Under Appearance: + + - Template: **Blank with Attributes** + + - CSS Class: **t-Chat** + + - Under Advanced > Static ID: **ai-agents-chat** + + ![Edit Appearance](images/subregion-appearance.png " ") + +9. Navigate to **Attributes** tab, enter/select the following: + + - Under Appearance: + + - Template Type: **Theme** + + - Template: **Comments** + + - Pagination > Type: **No Pagination (Show All Rows)** + + - Performance > Maximum Rows to Process: **500** + + - Message > When No Data Found: Copy the below HTML Code. + + ``` + + +

Start Conversation

+ +
+ ``` + + ![SubRegion Attributes](images/subregion-attributes.png " ") + +10. In the **Rendering** pane, select **AI Agents Conversation** sub region. Expand the columns and click **COMMENT_TEXT**. + +11. In the Property Editor, enter/select the following: + + - Identification > Type: **Rich Text** + + ![Comment Text](images/comment-text.png " ") + +12. Under **AI Agents Conversation** sub-region, click **ACTIONS**. + +13. In the property editor, enter/select the following: + + - Identification > Type: **Link** + + - Under Link: + + - Link Text: **#ACTIONS#** + + - Link Attributes: **target="_blank"** + + ![Edit Actions](images/edit-actions1.png " ") + + - Target: Click **No Link Defined**, enter/select the following: + + - Page : **7** + + - Under Set Items, enter the following: + + - Name: **P7\_CONV\_ID** + + - Value: **#CONV\_ID#** + + - Click **OK** + + ![Edit Link](images/edit-link1.png " ") + + >**Note**: Page 7 will create in next task + +14. Right-click **AI Agents Conversation** sub-region, click **Create Dynamic Action**. + + ![Create Dynamic Action](images/create-dynamicaction1.png " ") + +15. In the Property Editor, enter/select the following: + + - Name: **Scroll to bottom** + + - Under When: + + - Event: **After Refresh** + + - Selection **Type: Region** + + - Region: **AI Agents Conversation** + + ![Scroll to Bottom](images/scroll-tobottom.png " ") + +16. Under **True** action, click **Show**. + +17. In the Property Editor, enter/select the following: + + - Identification > Action : **Execute JavaScript Code** + + - Settings > Code : Copy and paste the below code + + ``` + + + $("#ai-agents-chat .t-Comments").scrollTop($("#ai-agents-chat .t-Comments")[0].scrollHeight); + + + ``` + + ![True Action](images/true-action1.png " ") + +## Task 2: Create Buttons Sub Region + +In this task, you will create buttons to trigger specific actions and configure subregions to logically group related components, enhancing the functionality. + +1. Right-click **Chat with OCI Generative AI Agent** region, select **Create Sub Region**. + +2. In the Property Editor, enter/select the following: + + - Under Identification: + + - Name: **Buttons** + + - Type: **Static Content** + + - Appearance > Template: **Blank with Attributes** + + ![Button Region](images/region-buttons.png " ") + +3. Right-click **Buttons** sub-region, click **Create Page Item**. + + ![Button PageItem](images/button-pageitem.png " ") + +4. In the Property Editor, enter/select the following: + + - Under Identification: + + - Name: **P1\_PROMPT** + + - Type: **Text Field** + + - Under Appearance: + + - Template: **Hidden** + + - Template Options: **Use Template Default** + + - Under Common: + + - General: Check **Use Template Defaults** and **Stretch From Item** + + - Size: **Large** + + - Click **OK** + + - Value Placeholder: **Enter your message...** + + ![Edit Prompt](images/edit-prompt.png " ") + +5. Right-click **P1_PROMPT** page item and click **Create Dynamic Action**. + +6. In the Property Editor, enter/select the following: + + - Identification > Name: **Prompt Item Enter Key Action** + + - Under When: + + - Event: **Key Down** + + - Selection Type: **Item(s)** + + - Items: **P1_PROMPT** + + - Under Client-side Condition: + + - Type: **JavaScript expression** + + - JavaScript expression: Copy the below code + + ``` + + this.browserEvent.key === 'Enter' && !apex.item("P1_PROMPT").isEmpty() + + ``` + + ![Prompt DynamicAction](images/prompt-dynamicaction.png " ") + +7. Under **True** action, click **Show**. + +8. In the Property Editor, enter/select the following: + + - Identification > Action: **Execute JavaScript Code** + + - Settings > Code : Copy the below code + + ``` + + this.browserEvent.preventDefault(); + apex.event.trigger($("#call-genai-agents"), "click"); + + ``` + + ![True Action](images/true-action2.png " ") + +9. Right-click **Buttons** sub-region, click **Create Button**. + + ![Create Button](images/create-button.png " ") + +10. In the Property Editor, enter/select the following: + + - Under Identification: + + - Name: **Send** + + - Label: **Send** + + - Under Layout: + + - Start New Row: **Toggle Off** + + - New Column: **Toggle On** + + - Column Span: **2** + + - Column Attributes: **style="align-self: center;"** + + ![Edit Button](images/send-edit1.png " ") + + - Under Appearance: + + - Button Template: **Icon** + - Hot: **Toggle On** + - Template Option > Click Use Template Defaults : + - Size: **Small** + - Type: **Normal** + - Icon : **fa-arrow-circle-up** + + - Under Behavior: + + - Action : **Defined by Dynamic Action** + - Execute Validations: **Toggle On** + + - Advanced > Static ID: **call-genai-agents** + + ![Edit SendButton1](images/send-edit2.png " ") + +11. Under **Button** sub-region, right-Click **Send** button, and click **Create Dynamic Action**. + +12. In the Property Editor, enter/select the following: + + - Identification > Name: **Interact with AI Agents on Button Click** + + - Under Client-side Condition: + - Type: **JavaScript expression** + - JavaScript Expression : **!apex.item("P1_PROMPT").isEmpty()** + + ![Send DynamicAction](images/send-dynamicaction.png " ") + +13. Under True action, click **Show**. + +14. In the Property Editor, enter/select the following: + + - Identification > Action: **Execute Server-side Code** + + - Under Settings, enter/select the following: + - Language: **PL/SQL** + - PL/SQL Code: Copy the below code: + + ``` + + + begin insert into RAG_CHATBOT ( + user_name, is_own, comment_text, comment_date, + session_ID + ) + values + ( + :APP_USER, 'Yes', :P1_PROMPT, sysdate, + :P1_SESSION_ID + ); + end; + + + ``` + + - Item to Submit: **P1\_PROMPT,P1\_SESSION\_ID** + - Item to Return: **P1\_CONV\_ID** + + ![Send True Action](images/send-true1.png " ") + +15. Right-click **True** action and click **Create TRUE Action**. + + ![Create True Action](images/create-trueaction.png " ") + +16. In the Property Editor, enter/select the following: + + - Identification > Action: **Execute Server-side Code** + - Under Settings > Code : Copy and paste the below code + + ``` + + apex.region("ai-agents-chat").refresh(); + var spinner = apex.util.showSpinner(); + + ``` + + ![True Action2](images/send-true2.png " ") + +17. Right-click **True** action and click **Create TRUE Action**. + +18. In the Property Editor, enter/select the following: + + - Under Identification: + - Name: Calling RAG Agent + - Action: **Execute Server-side Code** + + - Under Settings: + - Language: PL/SQL + - Code : Copy and paste the below code + + ``` + + + declare + l_body clob; + l_response clob; + l_url varchar2(2000); + l_result varchar2(4000); + begin + l_url := 'https://agent-runtime.generativeai.' + || :P1_REGION + ||'.oci.oraclecloud.com/20240531/agentEndpoints/' + || :P1_AGENT_ENDPOINT_ID + || '/actions/chat'; + l_body := '{"sessionId" : "' || :P1_SESSION_ID || '",' + || '"shouldStream" : "false",' + || '"userMessage" : "' || :P1_PROMPT || '"}'; + + apex_web_service.g_request_headers(1).name := 'Content-Type'; + apex_web_service.g_request_headers(1).value := 'application/json'; + + l_response := apex_web_service.make_rest_request( + p_url => l_url, + p_http_method => 'POST', + p_body => l_body, + p_credential_static_id => :P1_APEX_AI_CRED + ); + + + SELECT response_text into l_result + FROM JSON_TABLE(l_response, '$.message[*]' + COLUMNS (response_text varchar2(4000) PATH '$.content.text' + )) jt; + + insert into RAG_CHATBOT (user_name, is_own, comment_text, comment_date, session_ID) + values ('AI', 'No', l_result, sysdate, :P1_SESSION_ID) + returning CONV_ID into :P1_CONV_ID; + + -- Adding Citations + + for i in (SELECT jt.source_text, jt.source_location + FROM JSON_TABLE( + l_response, + '$.traces[*]' + COLUMNS ( + NESTED PATH '$.citations[*]' + COLUMNS ( + source_text VARCHAR2(4000) PATH '$.sourceText', + source_location VARCHAR2(4000) PATH '$.sourceLocation.url' + ) + ) + ) jt + where jt.source_text is not null and + jt.source_location is not null + ) + loop + insert into RAG_CITATIONS (conv_id, prompt, source_text, source_location, asked_on) + values (:P1_CONV_ID,:P1_PROMPT, i.source_text,i.source_location, systimestamp); + + end loop; + + end; + + + ``` + + - Item to Submit: **P1\_PROMPT,P1\_SESSION\_ID,P1\_AGENT\_ENDPOINT\_ID,P1\_APEX\_AI\_CRED**, **P1\_REGION** + + ![True Action3](images/send-true03.png " ") + +19. Right-click **True** action and click **Create TRUE Action**. + +20. In the Property Editor, enter/select the following: + + - Identification > Action: **Execute JavaScript Code** + - Under Settings > Code : Copy and paste the below code + + ``` + + apex.region("ai-agents-chat").refresh(); + apex.item("P1_PROMPT").setValue(""); + apex.item("P1_PROMPT").enable(); + apex.item("P1_PROMPT").setFocus(); + $("#apex_wait_overlay").remove(); + $(".u-Processing").remove(); + + ``` + + ![True Action4](images/send-true4.png " ") + +## Task 3: Create Page Processes and Computation + +In this task, we will create a Static Content region and a subregion, and configure dynamic actions to control their behavior based on user interactions. + +1. Under **Rendering** Tab, expand **Pre-Rendering**, right-click **Before Header** and select **Create Computation**. + + ![Create Computation](images/create-computation.png " ") + +2. In the Property Editor, enter/select the following: + + - Identification > Item Name: **P1_PROMPT** + - Computation > Type: **Static Value** + - Error > Error Message: **Clear the message if page is refreshed.** + + ![Create Prompt](images/p1-prompt.png " ") + +3. Right-click **Before Header** and select **Create Computation**. + +4. In the Property Editor, enter/select the following: + + - Identification > Item Name: **P1\_SESSION\_ID** + - Computation > Type: **Static Value** + + ![Create SessionId](images/process-sessionid.png " ") + +5. Right-click **Before Header** and select **Create Process**. + + ![Create Process](images/create-process.png " ") + +6. In the Property Editor, enter/select the following: + + - Under Identification: + - Item Name: **Create Session** + - Type: **Invoke API** + + - Under Settings: + - Type: **REST Source** + - REST Source: **Create Session API** [Refer Lab 4](?lab=4-configure-restapi) + - Operation: **POST** + + ![Enter Process](images/enter-process.png " ") + +7. Navigate to **Body**, click **P1\_SESSION\_ID**. + +8. In the Property Editor, enter/select the following: + + - Under Default: + + - Type: **SQL Query (return single value)** + + - SQL Query (return single value): Copy the below code + + ``` + + + SELECT id + FROM + JSON_TABLE( + : P1_RESPONSE_SESSION, + '$' COLUMNS ( + id VARCHAR2(4000) PATH '$.id' + ) + ) jt; + + + ``` + + ![Edit Default](images/edit-default.png " ") + +9. Navigate to **Pre-Rendering**. Select **Create Session** process and expand **Parameters**. + +10. Click **AGENT_NAME** parameter. In the Property Editor, enter/select the following: + + - Under Value: + - Type : **Static Value** + - Static Value: **RAGAgent** + + ![Agent Name](images/agent-name.png " ") + +11. Click **DESCRIPTION** parameter. In the Property Editor, enter/select the following: + + - Under Value: + - Type : **Static Value** + - Static Value: **Session for RAG Agent** + + ![Description](images/description.png " ") + +12. Click **RESPONSE** parameter. In the Property Editor, enter/select the following: + + - Under Value: + + - Parameter > Ignore Output : **Toggle Off** + + - Value > Item : **P1\_RESPONSE\_SESSION** + + ![Response Session](images/response-session1.png " ") + +## Task 4: Add Pages for Document Upload + +1. Navigate back to the Page Designer. In the page designer toolbar, click ( + v ) icon and select **Page**. + + ![Create Page](images/plus-page.png " ") + +2. Select **Form**. + + ![Create Page](images/select-form.png " ") + +3. In the Property Editor, enter/select the following: + + - Page Number : **5** + - Name: **Upload Documents to knowledge Base** + - Page Mode: **Drawer** + - Table/View Name: **DOC\_UPLOAD** + +4. Click **Next**. + + ![Edit Form](images/edit-form.png " ") + +5. Click **Create Page**. + + ![Edit Form](images/create-formpage.png " ") + +6. Once Page is created, navigate to the page, right-click on **Upload Documents to Knowledge Base** region and select **Create page Item**. + +7. Now, add the following nine page items one after the other: + + | | Identification > Name | Identification > Type | Default > Type | Default > Static | Session State > Datatype | SQL Query (return single value) + |---|-------|------|----------| --------------| ------ |------ | + | 1 | P5\_COMPARTMENT\_ID| Hidden | Static |Enter your OCI account Compartment OCID| + | 2 | P5\_CRED\_STATIC\_ID| Hidden | Static | APEX\_OCI\_AI\_CRED | + | 3 | P5\_NAMESPACE\_NAME| Hidden | Static | Enter Namespace which you copied while creating a Bucket| + | 4 | P5\_BUCKET\_NAME| Hidden | Static | Enter the Bucket Name which you copied while creating a Bucket(For this Lab we have **GenAIRAGBucket**) | + | 5 | P5\_REGION| Hidden | Static | Enter your Region. e.g. us-chicago-1 | + | 6 | P5\_DATASOURCE_ID| Hidden | | | [Refer Lab 2, Task3, Step10](?lab=2-configure-kb-genai#Task3:FetchOCIDofGenerativeAIAgentandDataSource) + | 7 | P5\_DISPLAY\_NAME| Hidden | SQL Query (return single value) | | | select concat('IngestionJob\_', ingestion\_seq.nextval) from dual; | + | 8 | P5\_DESCRIPTION| Hidden | | Creating an Ingestion Job for the latest files | | | + | 9 | P5\_ING\_RESPONSE| Hidden | | | | | + {: title="Form Page Items"} + + - Select **P5\_FILE\_NAME**, **P5\_MIME\_TYPE**, **P5\_OBJECT\_STORAGE\_URL**, **P5\_CREATED**, **P5\_CREATED\_BY**, **P5\_UPDATED**, **P5\_UPDATED\_BY**, **P5\_INGESTION\_RESPONSE**,**P5\_DATA\_ING\_JOB\_ID**. + + - Navigate to **Property Editor**, Identification > Type : **Hidden** + + ![Page Items](images/all-pageitem.png " ") + +8. Right-click **Upload Documents to Knowledge Base** region, click **Create Page Item**. + +9. In the Property Editor, enter/select the following: + + - Under Identification: + - Name: **P5\_DOC\_UPLOAD** + - Type: **File Upload** + + - Under Display: + - Display As: **Block Dropzone** + - Dropzone Title: **Upload your Document** + + ![Document Upload](images/doc-upload.png " ") + +10. Right-click **Content Body**, click **Create Page Item**. + +11. In the Property Editor, enter/select the following: + + - Under Identification: + - Name: **P5\_INGESTION\_COUNT** + - Type: **Hidden** + + ![Ingestion Count](images/ingestion-count.png " ") + +12. Right-click **P5\_INGESTION\_COUNT** page item, click **Create Computation**. + +13. In the Property Editor, enter/select the following: + + - Under Computation: + - Type: **SQL Query (return single value)** + - SQL Query: Copy the below code + ``` + + + select count(*) from DOC_UPLOAD where INGESTION_RESPONSE in ('ACCEPTED','IN_PROGRESS'); + + + ``` + + ![Ingestion computation](images/ingestion-computation.png " ") + +14. Right-click **Content Body**, click **Create Region**. + +15. In the Property Editor, enter/select the following: + + - Under Identification: + + - Name: **Ingestion Details** + - Type: **Static Content** + + - Source > HTML Code : **An Ingestion Job is currently In-Progress. Please wait before uploading Documents** + + ![Ingestion Details](images/ingestion-details1.png " ") + + - Under Server-side Condition: + + - Type: **Item is NOT zero** + - Item: **P5\_INGESTION\_COUNT** + + ![Ingestion Details](images/ingestion-details2.png " ") + +16. Under **Content Body**, select **Upload Documents to Knowledge Base** region. + +17. In the Property Editor, enter/select the following: + + - Under Server-side Condition: + - Type: **Item is zero** + - Item **P5\_INGESTION\_COUNT** + + ![Server Side](images/page5-serverside.png " ") + +## Task 5: Add Processes to the Page + +In this task you will learn how to create processes and will create processes: + +- **Process form Upload Documents to Knowledge Base**: This process handles the submission of uploaded documents from the form and initiates the upload to the Knowledge Base. It prepares the data to be vectorized and stored for use by Oracle Generative AI services. + +- **Work with Ingestion Jobs**: This process triggers a REST API call to start an ingestion job. The job processes uploaded documents, converting them into AI-readable embeddings to populate the Knowledge Base. + +- **Delete File in Object Storage**: This process connects to Oracle Object Storage and deletes selected files, helping manage storage efficiently and ensuring outdated or incorrect files are removed. + +- **Auto DML**: This process helps in Data Manipulation Language (DML) operations such as insert, update, or delete based on user actions on the form. + +1. On Page 5, Navigate to the **Processing** tab, select **Process form Upload Documents to Knowledge Base** process, enter/select the following: + + - Identification > Type: **Invoke API** + + - Under Settings: + - Type: **PL/SQL Package** + - Package: **OCI\_OBJECT\_STORAGE\_UTILS** + - Procedure or Function: **UPLOAD_FILE** + + - Under Server-side Condition: + + - When Button Pressed: **--Select--** + - Type: **Request is contained in Value** + - Value: **CREATE,SAVE** + + ![Process](images/process0.png " ") + +2. Expand the **Parameters** and map the following items one after another: + + | | Parameters | Value > Item | + |---|-------|------| + | 1 | p\_file_content| P5\_DOC\_UPLOAD | + | 2 | p\_static\_id| P5\_CRED\_STATIC\_ID | + | 3 | p\_namespace| P5\_NAMESPACE_NAME | + | 4 | p\_bucket| P5\_BUCKET_NAME | + | 5 | p\_region| P5\_REGION | + | 6 | p\_object_storage\_url| P5\_OBJECT\_STORAGE\_URL | + | 7 | p\_file_name| P5\_FILE_NAME| + | 8 | p\_mime_type| P5\_MIME_TYPE | + {: title="Parameters Mapping"} + + ![Parameters](images/parameters1.png " ") + +3. Right-click **Processes** and click **Create Process**. + +4. In the Property Editor, enter/select the following: + + - Under Identification: + - Name: **Work with Ingestion Jobs** + - Type: **Execution Chain** + + - Under Server-side Condition: + - Type: **Request is contained in Value** + - Value: **CREATE,SAVE** + + ![Process2](images/process2.png " ") + +5. Right-click **Work with Ingestion Jobs** processes, click **Add Child Process**. + +6. In the Property Editor, enter/select the following: + + - Under Identification: + - Name: **Call Ingestion API** + - Type: **Invoke API** + - Execution Chain: **Work with Ingestion Job** + + - Under Settings: + - Type: **REST Source** + - Value: **Create Ingestion Job API** + - Operation: **POST** + + ![Child Process1](images/child-process1.png " ") + +7. Under **Call Ingestion API** child process, expand the parameters and map the following parameters: + + | | Parameters | Parameter > Ignore Output|Value > Item | + |---|-------|------|----| + | 1 | COMPARTMENTID| |P5\_COMPARTMENT\_ID | + | 2 | DATASOURCEID| |P5\_DATASOURCE\_ID | + | 3 | DESCRIPTION| |P5\_DESCRIPTION | + | 4 | DISPLAYNAME| |P5\_DISPLAY\_NAME | + | 5 | RESPONSE| Toggle Off |P5\_ING\_RESPONSE | + {: title="Parameters Mapping"} + + ![Child Parameters1](images/child-parameters11.png " ") + +8. Right-click **Work with Ingestion Jobs** process, click **Add Child Process**. + +9. In the Property Editor, expand the **Parameters** and enter/select the following: + + - Under Identification: + - Name: **Set Ingestion Job Details** + - Type: **Execute Code** + - Execution Chain: **Work with Ingestion Job** + + - Under Source: + - Language: **PL/SQL** + - PL/SQL Code: Copy the below code: + ``` + + SELECT + jt.Status, + jt.job_id into : P5_INGESTION_RESPONSE, + :P5_DATA_ING_JOB_ID + FROM + JSON_TABLE( + :P5_ING_RESPONSE, + '$' COLUMNS ( + Status VARCHAR2(50) PATH '$.lifecycleState', + job_id varchar2(300) PATH '$.id' + ) + ) jt; + + + ``` + + ![Child Process2](images/child-process2.png " ") + +10. Right-click **Processes**, select **Create Process**. + +11. In the Property Editor, enter/select the following: + + - Under Identification: + - Name: **Delete File in Object Storage** + - Type: **Invoke API** + + - Under Settings: + - Type: **PL/SQL Package** + - Package: **OCI\_OBJECT\_STORAGE\_UTILS** + - Procedure or Function: **DELETE\_FILE** + + - Server-side Condition > When Button Pressed: **DELETE** + + ![Process](images/process3.png " ") + +12. Under **Delete File in Object Storage** process and map the following parameters: + + | | Parameters | Value > Item | + |---|-------|------| + | 1 | p\_object\_storage\_url| P5\_OBJECT\_STORAGE\_URL | + | 2 | p\_static\_id| P5\_CRED\_STATIC\_ID | + | 3 | p\_mime\_type| P5\_MIME\_TYPE | + {: title="Parameters Mapping"} + + ![Parameters](images/parameters3.png " ") + +13. Right-click **Processes** and click **Create Process**. + +14. In the Property Editor, enter/select the following: + + - Under Identification: + - Name: **Auto DML** + - Type: **Form - Automatic Row Processing (DML)** + - From Region: **Upload Documents to Knowledge Base** + + - Under Server-side Condition: + - Type: **Request is contained in Value** + - Value: **CREATE,SAVE,DELETE** + + ![Process](images/process4.png " ") + +15. Right-click **After Processing**, click **Create Branch**. + + ![Create Branch](images/create-branch.png " ") + +16. In the Property Editor, enter/select the following: + + - Identification > Name: **Go To Page 6** + + - Behavior > Target: **No Link Defined** + + - Link Builder - Target > Page : **6** + + ![Edit Branch](images/edit-branch.png " ") + +## Task 6: Create Page for Document Processing + +In this task we will create Application Items,Application Processes and Content Row Dialog page + +1. In the Page designer toolbar, click **Shared Components** icon. + + ![Shared Components](images/shared-components.png " ") + +2. Click **Application Items**. + + ![Application Items](images/click-applicationitems.png " ") + +3. Click **Create**. + + ![Click Create](images/click-createai.png " ") + +4. In the Property Editor, enter/select the following: + + - Name: **ID** + - Scope: **Application** + - Security > Session State Protection : **Unrestricted** + + ![Edit ApplicationItem](images/edit-applicationitem0.png " ") + + - Click **Create Application Item** + +5. Navigate back to **Shared Components** page. + +6. Under **Application Logic**, select **Application Processes**. + + ![Application Processes](images/click-processes.png " ") + +7. Click **Create**. + + ![Create Application Processes](images/create-applicationprocesses.png " ") + +8. Enter/select the following:: + + - Name : **DOWNLOAD_DOC** + - Sequence: **1** + - Point: **Ajax Callback:Run this application process when requested by a page process.** + + ![Edit Identification](images/identification.png " ") + + - Click **Next** + +9. Enter/select the following:: + + - Language : **PL/SQL** + - Code: Copy the below code + ``` + + + BEGIN + OCI_OBJECT_STORAGE_UTILS.get_file(:ID); + END; + + + ``` + + ![Edit Source](images/source.png " ") + + - Click **Next** + +10. Click **Create Process**. + + ![Create Application Process](images/create-applicationprocesses.png " ") + +11. Navigate to your Application ID and click **Create Page**. + + ![Navigate Application](images/navigate-application.png " ") + + ![Create Page](images/create-page2.png " ") + +12. Select **Content Row**. + + ![Create Page](images/create-contentrow.png " ") + +13. Enter/select the following:: + + - Page Number : **6** + - Name: **Documents Processing Tracker** + - Page Mode: **Drawer** + + ![Edit Form](images/document-tracker.png " ") + + - Click **Next** + +14. Click **Create Page**. + +15. Under Content Body, select **Document Processing Tracker**. + +16. In the property editor, enter/select the following + + - Identification > Name : **List Available Documents** + + - Under Source: + + - Type: **SQL Query** + - SQL Query: Copy the below code + + ``` + + + select + ID, + FILE_NAME, + MIME_TYPE, + OBJECT_STORAGE_URL, + CREATED, + CREATED_BY, + UPDATED, + UPDATED_BY, + INGESTION_RESPONSE, + case when INGESTION_RESPONSE = 'SUCCEEDED' + then 'success' when INGESTION_RESPONSE = 'ACCEPTED' then 'danger' else 'warning' end as response_color, + DATA_ING_JOB_ID + from + DOC_UPLOAD + + + ``` + + - Appearance > Template: **Blank with Attributes (No Grid)** + + ![Rename](images/rename.png " ") + + ![Edit Form](images/edit-documenttracker.png " ") + +17. In the Property Editor, select **Attributes** tab and enter/select the following: + + - Under Settings: + + - Title: **File Name: &FILE\_NAME.** + + - Description: **Ingestion Job ID: &DATA\_ING\_JOB\_ID.** + + - Miscellaneous: **Created By: &CREATED\_BY.** + + - Display Badge: **Toggle ON** + + - Under Badge: + + - Label: **&INGESTION\_RESPONSE.** + + - Value: **INGESTION\_RESPONSE** + + - State: **RESPONSE\_COLOR** + + - Column Width: **Auto** + + ![Document Attributes](images/document-attributes.png " ") + +18. Under **List Available Documents**, right-click **Action**, and click **Create Action**. + + ![Create Action](images/create-actionmenu.png " ") + +19. In the Property Editor, enter/select the following: + + - Under Identification : + - Position: **Primary Actions** + - Template : **Menu** + - Label : **Menu** + + - Under Appearance : + - Display Type: **Icon** + - Icon : **fa-ellipsis-v** + + ![Edit Menu](images/edit-menu.png " ") + +20. Under **Menu** action, right-click **Menus** add below items one after another: + + - Under Identification enter/select the following: + + - Type: **Menu Entry** + - Target: **Download PDF** + + - Under Link enter/select the following: + + - Type: **Redirect to Page in this Application** + - Label: Click **No Link Defined** + + - In the dialog **Under Link Builder - Target** enter/select the following: + + - Target > Page : **6** + + - Set Items > Name : **ID** + + - Set Items > Value : **&ID.** + + - Advanced > Request : **APPLICATION\_PROCESS=DOWNLOAD\_DOC** + + ![Download PDF](images/download-pdf.png " ") + +21. Under **Menu** action, right-click **Menus** add below items one after another: + + - Under Identification enter/select the following: + + - Type: **Menu Entry** + - Target: **Edit/Delete Document** + + - Under Link enter/select the following: + + - Type: **Redirect to Page in this Application** + - Label: Click **No Link Defined** + + - In the dialog **Under Link Builder - Target** enter/select the following: + + - Target > Page : **5** + + - Set Items > Name : **P5\_ID** + + - Set Items > Value : **&ID.** + + - Clear / Reset > Clear Cache : **5** + + ![Edit Document](images/edit-document.png " ") + +22. Right-click on **List Available Documents** click **Create Button**, create below buttons one after another. + + | | Identification > Button Name | Identification > Label | Layout > Slot | Appearance > Hot |Behavior > Action | Target > No Link Defined > Target > Page | Clear Cache | + |---|-------|------|----------| --------------| ---- | --- | --- | + | 1 | Chat\_with\_AI\_Agent| Chat With AI Agent | Top of Region [Legacy]| |Redirect to Page in this Application| 1 | 1 | + | 2 | Upload| Upload Document to KB | Top of Region [Legacy]| Toggle On |Redirect to Page in this Application| 5 | 5 | + {: title="Link Builder - Target"} + + ![Chat WithAI](images/chat-withai.png " ") + + ![Upload](images/upload.png " ") + +23. Right-click **Content Body**, click **Create Page Item**. + +24. In the Property Editor, enter/select the following: + + - Under Identification: + + - Name: **P6\_ID** + + - Type: **Hidden** + + ![Page6 Item](images/page-item.png " ") + +25. Navigate to **Page 6: Document Processing Tracker** root node. + +26. In the Property Editor, enter/select the following: + + - Template Options > Size: **Large** + + - Under Dialog > Chained : **Toggle On** + + ![Size](images/size-large.png " ") + +## Task 7: Add Buttons in HomePage + +1. Go to **Navigation Bar** and navigate to **Page 1**. + +2. In the **Rendering Pane**, right-click **Breadcrumb Bar** and select **Create Button**. + +3. In the Property Editor, enter/select the following: + + - Under Identification: + + - Button Name: **NewSession** + + - Label: **New Session** + + - Layout > Slot: **Before Navigation Bar** + + - Under Appearance: + + - Button Template: **Text with Icon** + - Hot: Toggle **On** + - Icon: **fa-plus-square-o** + + - Behavior >Action: **Submit Page** + + ![New Session](images/new-session.png " ") + +4. Right-click **Breadcrumb Bar** and select **Create Button**. + +5. In the Property Editor, enter/select the following: + + - Under Identification: + + - Button Name: **UploadDocuments** + - Label: **Upload Documents** + + - Layout > Slot: **Before Navigation Bar** + + - Under Appearance: + + - Button Template: **Text with Icon** + + - Hot: Toggle **On** + + - Icon: **fa-cloud-upload** + + - Behavior >Action: **Redirect to Page in this Application** + + - Target > Link Builder-Target > Page :**6** + + - Click **OK** + + ![Upload Document](images/upload-doc.png " ") + +## Task 8: Create Page to View Citations + +1. In the page designer toolbar, click ( + v ) icon and select **Page**. + + ![Create Page](images/plus-page.png " ") + +2. Select **Content Row** . + + ![Create Page](images/create-contentrow.png " ") + +3. Enter/select the following:: + + - Page Number : **7** + - Name: **View Citations** + - Page Mode: **Drawer** + + ![View Citations](images/view-citations.png " ") + +4. Click **Create Page** + +5. Right-click **Content Body**, select **Create Page Item**. + +6. In the property editor enter/select the following: + + - Identification > Name: **P7\_CONV\_ID** + - Identification > Type: **Hidden** + + ![Page Item7](images/p7_convid.png " ") + +7. Select **View Citations** region, in the property editor enter/select the following: + + - Under Source: + + - Type: **SQL Query** + + - SQL Query: Copy the below code + + ``` + + + select * from RAG_CITATIONS WHERE CONV_ID = :P7_CONV_ID; + + + ``` + + - Appearance > Template: **Blank with Attributes (No Grid)** + + ![Edit Citations](images/edit-citation.png " ") + +8. Navigate to **Attributes** tab, enter/select the following: + + - Under Settings: (including period (**.**) ): + + - Overline: **CONVERSATION ID: &CONV_ID.** + + - Title: **PROMPT: &PROMPT.** + + - Description: Copy and paste the below HTML code: + + ``` + + SOURCE TEXT: &SOURCE_TEXT.


+ SOURCE LOCATION: &SOURCE_LOCATION. +
+ ``` + + - Display Avatar: Toggle **On** + + - Under Avatar: + + - Type: **Icon** + - Icon: **fa-chatbot** + + ![Citations Attributes](images/citation-attributes.png " ") + +## Task 9: Create Automation + +1. In the Page designer toolbar, click **Shared Components** icon. + + ![Shared Components](images/shared-components.png " ") + +2. Under Workflows and Automations, click **Automations** + + ![Click Automations](images/click-automations.png " ") + +3. Click **Create** + + ![Click Create](images/create10.png " ") + +4. Under Create Automation, enter/select the following: + + - Name: **Get Ingestion Status** + - Type: **Scheduled** + - Actions initiated on: **Query** + - Execution Schedule: **Custom** + - Frequency: **Minutely** + - Interval: **2** + +5. Click **Next**. + + ![Click Automations Text](images/create-automationstext.png " ") + +6. Under Create Automation > Table/View name: **DOC_UPLOAD(table)**, leave others default. + +7. Click **Create**. + + ![Click Automations Text](images/create-automationstext2.png " ") + +8. Under Actions, click **Edit Icon** + + ![Edit Actions](images/edit-aicon.png " ") + +9. Under Edit Action, enter/select the following: + + ![Edit Actions](images/edit-aicon.png " ") + + - Name: **Get Ingestion Job Status** + - Type: **Execute Code** + - Execution Sequence: **10** + +10. Under Code, copy paste the below PL/SQL: + + ``` + + + declare + l_ing_jobid varchar2(300); + l_response clob; + l_json varchar2(1000); + l_status varchar2(100); + + cursor c_jobid is select id, DATA_ING_JOB_ID,INGESTION_RESPONSE from doc_upload where upper(INGESTION_RESPONSE) <> 'SUCCEEDED'; + + begin + apex_web_service.set_request_headers( + p_name_01 => 'Content-Type' + , p_value_01 => 'application/json' + ); + + FOR i in c_jobid + LOOP + l_ing_jobid := i.DATA_ING_JOB_ID; + + l_response := apex_web_service.make_rest_request( + p_http_method => 'GET' + , p_url => 'https://agent.generativeai.us-chicago-1.oci.oraclecloud.com/20240531/dataIngestionJobs/' + || l_ing_jobid + , p_credential_static_id => 'APEX_OCI_AI_CRED' + ); + + SELECT jt.Status into l_status + FROM JSON_TABLE( + l_response, + '$' + COLUMNS ( + Status VARCHAR2(50) PATH '$.lifecycleState' + ) + ) jt; + + update doc_upload set INGESTION_RESPONSE = l_status where id = i.id; + dbms_output.Put_line(l_response); + END LOOP; + end; + + + ``` + +11. Click **Apply Changes**. + + ![Edit Action](images/edit-action2.png " ") + +12. Under Settings, Schedule Status > Active. + +13. Click **Save and Run**. + + ![Status Active](images/status-active.png " ") + +## Summary + +In this lab, you have learned how to work with static components, create computations and processes, define page items, invoke REST APIs. Additionally, you created an automation process to fetch ingestion job details. + +You may now proceed to the next lab + +## Acknowledgements + +- **Author(s)** - Roopesh Thokala, Senior Product Manager; Shailu Srivastava, Product Manager +- **Last Updated By/Date** - Shailu Srivastava, Product Manager, June 2025 diff --git a/oci-rag-agent/5-create-app/images/agent-name.png b/oci-rag-agent/5-create-app/images/agent-name.png new file mode 100644 index 00000000..15d1b7ee Binary files /dev/null and b/oci-rag-agent/5-create-app/images/agent-name.png differ diff --git a/oci-rag-agent/5-create-app/images/all-pageitem.png b/oci-rag-agent/5-create-app/images/all-pageitem.png new file mode 100644 index 00000000..82c7bdb4 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/all-pageitem.png differ diff --git a/oci-rag-agent/5-create-app/images/all-pageitems.png b/oci-rag-agent/5-create-app/images/all-pageitems.png new file mode 100644 index 00000000..864fe600 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/all-pageitems.png differ diff --git a/oci-rag-agent/5-create-app/images/app-name.png b/oci-rag-agent/5-create-app/images/app-name.png new file mode 100644 index 00000000..da8a9827 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/app-name.png differ diff --git a/oci-rag-agent/5-create-app/images/blank-page-create.png b/oci-rag-agent/5-create-app/images/blank-page-create.png new file mode 100644 index 00000000..1ee77176 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/blank-page-create.png differ diff --git a/oci-rag-agent/5-create-app/images/blank-page-name.png b/oci-rag-agent/5-create-app/images/blank-page-name.png new file mode 100644 index 00000000..62ebb8c3 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/blank-page-name.png differ diff --git a/oci-rag-agent/5-create-app/images/breadcrumb.png b/oci-rag-agent/5-create-app/images/breadcrumb.png new file mode 100644 index 00000000..09d5997f Binary files /dev/null and b/oci-rag-agent/5-create-app/images/breadcrumb.png differ diff --git a/oci-rag-agent/5-create-app/images/button-pageitem.png b/oci-rag-agent/5-create-app/images/button-pageitem.png new file mode 100644 index 00000000..648f6ad4 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/button-pageitem.png differ diff --git a/oci-rag-agent/5-create-app/images/chained.png b/oci-rag-agent/5-create-app/images/chained.png new file mode 100644 index 00000000..d9b96124 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/chained.png differ diff --git a/oci-rag-agent/5-create-app/images/chat-withai.png b/oci-rag-agent/5-create-app/images/chat-withai.png new file mode 100644 index 00000000..3961b810 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/chat-withai.png differ diff --git a/oci-rag-agent/5-create-app/images/child-parameters1.png b/oci-rag-agent/5-create-app/images/child-parameters1.png new file mode 100644 index 00000000..38e7c79b Binary files /dev/null and b/oci-rag-agent/5-create-app/images/child-parameters1.png differ diff --git a/oci-rag-agent/5-create-app/images/child-parameters11.png b/oci-rag-agent/5-create-app/images/child-parameters11.png new file mode 100644 index 00000000..f36873f1 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/child-parameters11.png differ diff --git a/oci-rag-agent/5-create-app/images/child-process1.png b/oci-rag-agent/5-create-app/images/child-process1.png new file mode 100644 index 00000000..6ac4ef5a Binary files /dev/null and b/oci-rag-agent/5-create-app/images/child-process1.png differ diff --git a/oci-rag-agent/5-create-app/images/child-process2.png b/oci-rag-agent/5-create-app/images/child-process2.png new file mode 100644 index 00000000..b3b7bdaa Binary files /dev/null and b/oci-rag-agent/5-create-app/images/child-process2.png differ diff --git a/oci-rag-agent/5-create-app/images/citation-attributes.png b/oci-rag-agent/5-create-app/images/citation-attributes.png new file mode 100644 index 00000000..841435c2 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/citation-attributes.png differ diff --git a/oci-rag-agent/5-create-app/images/click-applicationitems.png b/oci-rag-agent/5-create-app/images/click-applicationitems.png new file mode 100644 index 00000000..9a3ad67e Binary files /dev/null and b/oci-rag-agent/5-create-app/images/click-applicationitems.png differ diff --git a/oci-rag-agent/5-create-app/images/click-automations.png b/oci-rag-agent/5-create-app/images/click-automations.png new file mode 100644 index 00000000..e834b8f6 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/click-automations.png differ diff --git a/oci-rag-agent/5-create-app/images/click-body.png b/oci-rag-agent/5-create-app/images/click-body.png new file mode 100644 index 00000000..0dd1cf29 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/click-body.png differ diff --git a/oci-rag-agent/5-create-app/images/click-createai.png b/oci-rag-agent/5-create-app/images/click-createai.png new file mode 100644 index 00000000..ae9d7fb1 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/click-createai.png differ diff --git a/oci-rag-agent/5-create-app/images/click-edit.png b/oci-rag-agent/5-create-app/images/click-edit.png new file mode 100644 index 00000000..d1340733 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/click-edit.png differ diff --git a/oci-rag-agent/5-create-app/images/click-processes.png b/oci-rag-agent/5-create-app/images/click-processes.png new file mode 100644 index 00000000..2fcf2a15 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/click-processes.png differ diff --git a/oci-rag-agent/5-create-app/images/comment-text.png b/oci-rag-agent/5-create-app/images/comment-text.png new file mode 100644 index 00000000..14d44971 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/comment-text.png differ diff --git a/oci-rag-agent/5-create-app/images/comp-session.png b/oci-rag-agent/5-create-app/images/comp-session.png new file mode 100644 index 00000000..d50d30ac Binary files /dev/null and b/oci-rag-agent/5-create-app/images/comp-session.png differ diff --git a/oci-rag-agent/5-create-app/images/conditionality.png b/oci-rag-agent/5-create-app/images/conditionality.png new file mode 100644 index 00000000..a34cfd10 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/conditionality.png differ diff --git a/oci-rag-agent/5-create-app/images/conv-id.png b/oci-rag-agent/5-create-app/images/conv-id.png new file mode 100644 index 00000000..22e2b67f Binary files /dev/null and b/oci-rag-agent/5-create-app/images/conv-id.png differ diff --git a/oci-rag-agent/5-create-app/images/create-actionmenu.png b/oci-rag-agent/5-create-app/images/create-actionmenu.png new file mode 100644 index 00000000..21f66591 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-actionmenu.png differ diff --git a/oci-rag-agent/5-create-app/images/create-aicred.png b/oci-rag-agent/5-create-app/images/create-aicred.png new file mode 100644 index 00000000..a026e55c Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-aicred.png differ diff --git a/oci-rag-agent/5-create-app/images/create-application.png b/oci-rag-agent/5-create-app/images/create-application.png new file mode 100644 index 00000000..8759a513 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-application.png differ diff --git a/oci-rag-agent/5-create-app/images/create-applicationprocesses.png b/oci-rag-agent/5-create-app/images/create-applicationprocesses.png new file mode 100644 index 00000000..bf123bca Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-applicationprocesses.png differ diff --git a/oci-rag-agent/5-create-app/images/create-automationstext.png b/oci-rag-agent/5-create-app/images/create-automationstext.png new file mode 100644 index 00000000..ee1aff9f Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-automationstext.png differ diff --git a/oci-rag-agent/5-create-app/images/create-automationstext2.png b/oci-rag-agent/5-create-app/images/create-automationstext2.png new file mode 100644 index 00000000..860f47d6 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-automationstext2.png differ diff --git a/oci-rag-agent/5-create-app/images/create-blank-page-option.png b/oci-rag-agent/5-create-app/images/create-blank-page-option.png new file mode 100644 index 00000000..38c1dcd0 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-blank-page-option.png differ diff --git a/oci-rag-agent/5-create-app/images/create-blank-page.png b/oci-rag-agent/5-create-app/images/create-blank-page.png new file mode 100644 index 00000000..38c1dcd0 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-blank-page.png differ diff --git a/oci-rag-agent/5-create-app/images/create-branch.png b/oci-rag-agent/5-create-app/images/create-branch.png new file mode 100644 index 00000000..178b6d1d Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-branch.png differ diff --git a/oci-rag-agent/5-create-app/images/create-button.png b/oci-rag-agent/5-create-app/images/create-button.png new file mode 100644 index 00000000..9498ae30 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-button.png differ diff --git a/oci-rag-agent/5-create-app/images/create-computation.png b/oci-rag-agent/5-create-app/images/create-computation.png new file mode 100644 index 00000000..adef883c Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-computation.png differ diff --git a/oci-rag-agent/5-create-app/images/create-contentrow.png b/oci-rag-agent/5-create-app/images/create-contentrow.png new file mode 100644 index 00000000..bac680ad Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-contentrow.png differ diff --git a/oci-rag-agent/5-create-app/images/create-dynamicaction1.png b/oci-rag-agent/5-create-app/images/create-dynamicaction1.png new file mode 100644 index 00000000..07a0dae2 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-dynamicaction1.png differ diff --git a/oci-rag-agent/5-create-app/images/create-endpointid.png b/oci-rag-agent/5-create-app/images/create-endpointid.png new file mode 100644 index 00000000..0e498149 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-endpointid.png differ diff --git a/oci-rag-agent/5-create-app/images/create-formpage.png b/oci-rag-agent/5-create-app/images/create-formpage.png new file mode 100644 index 00000000..e9d794bf Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-formpage.png differ diff --git a/oci-rag-agent/5-create-app/images/create-page2.png b/oci-rag-agent/5-create-app/images/create-page2.png new file mode 100644 index 00000000..216d776f Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-page2.png differ diff --git a/oci-rag-agent/5-create-app/images/create-pageitem1.png b/oci-rag-agent/5-create-app/images/create-pageitem1.png new file mode 100644 index 00000000..6048c478 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-pageitem1.png differ diff --git a/oci-rag-agent/5-create-app/images/create-pageitem5.png b/oci-rag-agent/5-create-app/images/create-pageitem5.png new file mode 100644 index 00000000..60e9da46 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-pageitem5.png differ diff --git a/oci-rag-agent/5-create-app/images/create-process.png b/oci-rag-agent/5-create-app/images/create-process.png new file mode 100644 index 00000000..a7fd7936 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-process.png differ diff --git a/oci-rag-agent/5-create-app/images/create-region.png b/oci-rag-agent/5-create-app/images/create-region.png new file mode 100644 index 00000000..77c54166 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-region.png differ diff --git a/oci-rag-agent/5-create-app/images/create-trueaction.png b/oci-rag-agent/5-create-app/images/create-trueaction.png new file mode 100644 index 00000000..12171ba6 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create-trueaction.png differ diff --git a/oci-rag-agent/5-create-app/images/create.png b/oci-rag-agent/5-create-app/images/create.png new file mode 100644 index 00000000..1abc6b8a Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create.png differ diff --git a/oci-rag-agent/5-create-app/images/create10.png b/oci-rag-agent/5-create-app/images/create10.png new file mode 100644 index 00000000..599621b6 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/create10.png differ diff --git a/oci-rag-agent/5-create-app/images/cred-default.png b/oci-rag-agent/5-create-app/images/cred-default.png new file mode 100644 index 00000000..af6c72b7 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/cred-default.png differ diff --git a/oci-rag-agent/5-create-app/images/delete-home-page.png b/oci-rag-agent/5-create-app/images/delete-home-page.png new file mode 100644 index 00000000..b6ee2cf3 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/delete-home-page.png differ diff --git a/oci-rag-agent/5-create-app/images/description.png b/oci-rag-agent/5-create-app/images/description.png new file mode 100644 index 00000000..98cb83db Binary files /dev/null and b/oci-rag-agent/5-create-app/images/description.png differ diff --git a/oci-rag-agent/5-create-app/images/developer-toolbar.png b/oci-rag-agent/5-create-app/images/developer-toolbar.png new file mode 100644 index 00000000..1cae1121 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/developer-toolbar.png differ diff --git a/oci-rag-agent/5-create-app/images/doc-upload.png b/oci-rag-agent/5-create-app/images/doc-upload.png new file mode 100644 index 00000000..e3c1cc42 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/doc-upload.png differ diff --git a/oci-rag-agent/5-create-app/images/document-attributes.png b/oci-rag-agent/5-create-app/images/document-attributes.png new file mode 100644 index 00000000..efb53f74 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/document-attributes.png differ diff --git a/oci-rag-agent/5-create-app/images/document-tracker.png b/oci-rag-agent/5-create-app/images/document-tracker.png new file mode 100644 index 00000000..531e0300 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/document-tracker.png differ diff --git a/oci-rag-agent/5-create-app/images/download-pdf.png b/oci-rag-agent/5-create-app/images/download-pdf.png new file mode 100644 index 00000000..47b451e5 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/download-pdf.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-action2.png b/oci-rag-agent/5-create-app/images/edit-action2.png new file mode 100644 index 00000000..6bc0c388 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-action2.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-actions.png b/oci-rag-agent/5-create-app/images/edit-actions.png new file mode 100644 index 00000000..0a5ea3f5 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-actions.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-actions1.png b/oci-rag-agent/5-create-app/images/edit-actions1.png new file mode 100644 index 00000000..610a2140 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-actions1.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-aicon.png b/oci-rag-agent/5-create-app/images/edit-aicon.png new file mode 100644 index 00000000..c54f1b14 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-aicon.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-applicationitem.png b/oci-rag-agent/5-create-app/images/edit-applicationitem.png new file mode 100644 index 00000000..294e2f19 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-applicationitem.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-applicationitem0.png b/oci-rag-agent/5-create-app/images/edit-applicationitem0.png new file mode 100644 index 00000000..2efd48c8 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-applicationitem0.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-branch.png b/oci-rag-agent/5-create-app/images/edit-branch.png new file mode 100644 index 00000000..4ed45211 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-branch.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-citation.png b/oci-rag-agent/5-create-app/images/edit-citation.png new file mode 100644 index 00000000..0bc228e7 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-citation.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-default.png b/oci-rag-agent/5-create-app/images/edit-default.png new file mode 100644 index 00000000..d560678d Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-default.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-document.png b/oci-rag-agent/5-create-app/images/edit-document.png new file mode 100644 index 00000000..c51d2801 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-document.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-documenttracker.png b/oci-rag-agent/5-create-app/images/edit-documenttracker.png new file mode 100644 index 00000000..9b96c82d Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-documenttracker.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-form.png b/oci-rag-agent/5-create-app/images/edit-form.png new file mode 100644 index 00000000..d56cb22d Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-form.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-link.png b/oci-rag-agent/5-create-app/images/edit-link.png new file mode 100644 index 00000000..756e8f9c Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-link.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-link1.png b/oci-rag-agent/5-create-app/images/edit-link1.png new file mode 100644 index 00000000..d3247809 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-link1.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-menu.png b/oci-rag-agent/5-create-app/images/edit-menu.png new file mode 100644 index 00000000..2ae46d18 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-menu.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-prompt.png b/oci-rag-agent/5-create-app/images/edit-prompt.png new file mode 100644 index 00000000..0742bb7d Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-prompt.png differ diff --git a/oci-rag-agent/5-create-app/images/edit-subregion1.png b/oci-rag-agent/5-create-app/images/edit-subregion1.png new file mode 100644 index 00000000..770513e3 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/edit-subregion1.png differ diff --git a/oci-rag-agent/5-create-app/images/endpoint-default.png b/oci-rag-agent/5-create-app/images/endpoint-default.png new file mode 100644 index 00000000..e474ecf5 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/endpoint-default.png differ diff --git a/oci-rag-agent/5-create-app/images/enter-process.png b/oci-rag-agent/5-create-app/images/enter-process.png new file mode 100644 index 00000000..aa026903 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/enter-process.png differ diff --git a/oci-rag-agent/5-create-app/images/identification.png b/oci-rag-agent/5-create-app/images/identification.png new file mode 100644 index 00000000..2ca5f1aa Binary files /dev/null and b/oci-rag-agent/5-create-app/images/identification.png differ diff --git a/oci-rag-agent/5-create-app/images/ingestion-computation.png b/oci-rag-agent/5-create-app/images/ingestion-computation.png new file mode 100644 index 00000000..afe20c6e Binary files /dev/null and b/oci-rag-agent/5-create-app/images/ingestion-computation.png differ diff --git a/oci-rag-agent/5-create-app/images/ingestion-count.png b/oci-rag-agent/5-create-app/images/ingestion-count.png new file mode 100644 index 00000000..289ce995 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/ingestion-count.png differ diff --git a/oci-rag-agent/5-create-app/images/ingestion-details1.png b/oci-rag-agent/5-create-app/images/ingestion-details1.png new file mode 100644 index 00000000..30cf3f7e Binary files /dev/null and b/oci-rag-agent/5-create-app/images/ingestion-details1.png differ diff --git a/oci-rag-agent/5-create-app/images/ingestion-details2.png b/oci-rag-agent/5-create-app/images/ingestion-details2.png new file mode 100644 index 00000000..9e78e888 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/ingestion-details2.png differ diff --git a/oci-rag-agent/5-create-app/images/navigate-application.png b/oci-rag-agent/5-create-app/images/navigate-application.png new file mode 100644 index 00000000..4287b105 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/navigate-application.png differ diff --git a/oci-rag-agent/5-create-app/images/new-session.png b/oci-rag-agent/5-create-app/images/new-session.png new file mode 100644 index 00000000..06efc41a Binary files /dev/null and b/oci-rag-agent/5-create-app/images/new-session.png differ diff --git a/oci-rag-agent/5-create-app/images/p1-prompt.png b/oci-rag-agent/5-create-app/images/p1-prompt.png new file mode 100644 index 00000000..f6af35c1 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/p1-prompt.png differ diff --git a/oci-rag-agent/5-create-app/images/p7_convid.png b/oci-rag-agent/5-create-app/images/p7_convid.png new file mode 100644 index 00000000..96b41a49 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/p7_convid.png differ diff --git a/oci-rag-agent/5-create-app/images/page-item.png b/oci-rag-agent/5-create-app/images/page-item.png new file mode 100644 index 00000000..461d371a Binary files /dev/null and b/oci-rag-agent/5-create-app/images/page-item.png differ diff --git a/oci-rag-agent/5-create-app/images/page1.png b/oci-rag-agent/5-create-app/images/page1.png new file mode 100644 index 00000000..24089aab Binary files /dev/null and b/oci-rag-agent/5-create-app/images/page1.png differ diff --git a/oci-rag-agent/5-create-app/images/page5-serverside.png b/oci-rag-agent/5-create-app/images/page5-serverside.png new file mode 100644 index 00000000..2043bb57 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/page5-serverside.png differ diff --git a/oci-rag-agent/5-create-app/images/parameters1.png b/oci-rag-agent/5-create-app/images/parameters1.png new file mode 100644 index 00000000..738888dc Binary files /dev/null and b/oci-rag-agent/5-create-app/images/parameters1.png differ diff --git a/oci-rag-agent/5-create-app/images/parameters3.png b/oci-rag-agent/5-create-app/images/parameters3.png new file mode 100644 index 00000000..c1f7b75b Binary files /dev/null and b/oci-rag-agent/5-create-app/images/parameters3.png differ diff --git a/oci-rag-agent/5-create-app/images/plus-page.png b/oci-rag-agent/5-create-app/images/plus-page.png new file mode 100644 index 00000000..8b31a229 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/plus-page.png differ diff --git a/oci-rag-agent/5-create-app/images/process-sessionid.png b/oci-rag-agent/5-create-app/images/process-sessionid.png new file mode 100644 index 00000000..34a05ef7 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/process-sessionid.png differ diff --git a/oci-rag-agent/5-create-app/images/process0.png b/oci-rag-agent/5-create-app/images/process0.png new file mode 100644 index 00000000..06f2deaa Binary files /dev/null and b/oci-rag-agent/5-create-app/images/process0.png differ diff --git a/oci-rag-agent/5-create-app/images/process1.png b/oci-rag-agent/5-create-app/images/process1.png new file mode 100644 index 00000000..cce40e1c Binary files /dev/null and b/oci-rag-agent/5-create-app/images/process1.png differ diff --git a/oci-rag-agent/5-create-app/images/process2.png b/oci-rag-agent/5-create-app/images/process2.png new file mode 100644 index 00000000..e4000cf7 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/process2.png differ diff --git a/oci-rag-agent/5-create-app/images/process3.png b/oci-rag-agent/5-create-app/images/process3.png new file mode 100644 index 00000000..bb95b54c Binary files /dev/null and b/oci-rag-agent/5-create-app/images/process3.png differ diff --git a/oci-rag-agent/5-create-app/images/process4.png b/oci-rag-agent/5-create-app/images/process4.png new file mode 100644 index 00000000..e07e16df Binary files /dev/null and b/oci-rag-agent/5-create-app/images/process4.png differ diff --git a/oci-rag-agent/5-create-app/images/prompt-dynamicaction.png b/oci-rag-agent/5-create-app/images/prompt-dynamicaction.png new file mode 100644 index 00000000..da7a49b4 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/prompt-dynamicaction.png differ diff --git a/oci-rag-agent/5-create-app/images/redwood-theme.png b/oci-rag-agent/5-create-app/images/redwood-theme.png new file mode 100644 index 00000000..301e3210 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/redwood-theme.png differ diff --git a/oci-rag-agent/5-create-app/images/redwood-ui.png b/oci-rag-agent/5-create-app/images/redwood-ui.png new file mode 100644 index 00000000..47f7abc7 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/redwood-ui.png differ diff --git a/oci-rag-agent/5-create-app/images/region-advanced.png b/oci-rag-agent/5-create-app/images/region-advanced.png new file mode 100644 index 00000000..6af9a5aa Binary files /dev/null and b/oci-rag-agent/5-create-app/images/region-advanced.png differ diff --git a/oci-rag-agent/5-create-app/images/region-buttons.png b/oci-rag-agent/5-create-app/images/region-buttons.png new file mode 100644 index 00000000..a3f9c17a Binary files /dev/null and b/oci-rag-agent/5-create-app/images/region-buttons.png differ diff --git a/oci-rag-agent/5-create-app/images/region-pageitem.png b/oci-rag-agent/5-create-app/images/region-pageitem.png new file mode 100644 index 00000000..c371679b Binary files /dev/null and b/oci-rag-agent/5-create-app/images/region-pageitem.png differ diff --git a/oci-rag-agent/5-create-app/images/rename.png b/oci-rag-agent/5-create-app/images/rename.png new file mode 100644 index 00000000..8ffe243e Binary files /dev/null and b/oci-rag-agent/5-create-app/images/rename.png differ diff --git a/oci-rag-agent/5-create-app/images/response-session.png b/oci-rag-agent/5-create-app/images/response-session.png new file mode 100644 index 00000000..92c1fc1d Binary files /dev/null and b/oci-rag-agent/5-create-app/images/response-session.png differ diff --git a/oci-rag-agent/5-create-app/images/response-session1.png b/oci-rag-agent/5-create-app/images/response-session1.png new file mode 100644 index 00000000..2256b5ee Binary files /dev/null and b/oci-rag-agent/5-create-app/images/response-session1.png differ diff --git a/oci-rag-agent/5-create-app/images/run-app.png b/oci-rag-agent/5-create-app/images/run-app.png new file mode 100644 index 00000000..98a068fa Binary files /dev/null and b/oci-rag-agent/5-create-app/images/run-app.png differ diff --git a/oci-rag-agent/5-create-app/images/scroll-tobottom.png b/oci-rag-agent/5-create-app/images/scroll-tobottom.png new file mode 100644 index 00000000..7c331165 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/scroll-tobottom.png differ diff --git a/oci-rag-agent/5-create-app/images/select-form.png b/oci-rag-agent/5-create-app/images/select-form.png new file mode 100644 index 00000000..beb8e5e2 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/select-form.png differ diff --git a/oci-rag-agent/5-create-app/images/send-dynamicaction.png b/oci-rag-agent/5-create-app/images/send-dynamicaction.png new file mode 100644 index 00000000..bbf72edc Binary files /dev/null and b/oci-rag-agent/5-create-app/images/send-dynamicaction.png differ diff --git a/oci-rag-agent/5-create-app/images/send-edit1.png b/oci-rag-agent/5-create-app/images/send-edit1.png new file mode 100644 index 00000000..3665596c Binary files /dev/null and b/oci-rag-agent/5-create-app/images/send-edit1.png differ diff --git a/oci-rag-agent/5-create-app/images/send-edit2.png b/oci-rag-agent/5-create-app/images/send-edit2.png new file mode 100644 index 00000000..deb1858e Binary files /dev/null and b/oci-rag-agent/5-create-app/images/send-edit2.png differ diff --git a/oci-rag-agent/5-create-app/images/send-true03.png b/oci-rag-agent/5-create-app/images/send-true03.png new file mode 100644 index 00000000..491e19fc Binary files /dev/null and b/oci-rag-agent/5-create-app/images/send-true03.png differ diff --git a/oci-rag-agent/5-create-app/images/send-true1.png b/oci-rag-agent/5-create-app/images/send-true1.png new file mode 100644 index 00000000..b5f1a8ea Binary files /dev/null and b/oci-rag-agent/5-create-app/images/send-true1.png differ diff --git a/oci-rag-agent/5-create-app/images/send-true2.png b/oci-rag-agent/5-create-app/images/send-true2.png new file mode 100644 index 00000000..60e6224f Binary files /dev/null and b/oci-rag-agent/5-create-app/images/send-true2.png differ diff --git a/oci-rag-agent/5-create-app/images/send-true3.png b/oci-rag-agent/5-create-app/images/send-true3.png new file mode 100644 index 00000000..5fc32d95 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/send-true3.png differ diff --git a/oci-rag-agent/5-create-app/images/send-true4.png b/oci-rag-agent/5-create-app/images/send-true4.png new file mode 100644 index 00000000..c54d9774 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/send-true4.png differ diff --git a/oci-rag-agent/5-create-app/images/session-id.png b/oci-rag-agent/5-create-app/images/session-id.png new file mode 100644 index 00000000..0744c1e1 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/session-id.png differ diff --git a/oci-rag-agent/5-create-app/images/shared-components.png b/oci-rag-agent/5-create-app/images/shared-components.png new file mode 100644 index 00000000..54444539 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/shared-components.png differ diff --git a/oci-rag-agent/5-create-app/images/size-large.png b/oci-rag-agent/5-create-app/images/size-large.png new file mode 100644 index 00000000..3bdf84a9 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/size-large.png differ diff --git a/oci-rag-agent/5-create-app/images/source.png b/oci-rag-agent/5-create-app/images/source.png new file mode 100644 index 00000000..cf00f209 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/source.png differ diff --git a/oci-rag-agent/5-create-app/images/status-active.png b/oci-rag-agent/5-create-app/images/status-active.png new file mode 100644 index 00000000..4a0c00e6 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/status-active.png differ diff --git a/oci-rag-agent/5-create-app/images/subregion-appearance.png b/oci-rag-agent/5-create-app/images/subregion-appearance.png new file mode 100644 index 00000000..47f7ec4f Binary files /dev/null and b/oci-rag-agent/5-create-app/images/subregion-appearance.png differ diff --git a/oci-rag-agent/5-create-app/images/subregion-attributes.png b/oci-rag-agent/5-create-app/images/subregion-attributes.png new file mode 100644 index 00000000..c5d3b0a8 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/subregion-attributes.png differ diff --git a/oci-rag-agent/5-create-app/images/true-action1.png b/oci-rag-agent/5-create-app/images/true-action1.png new file mode 100644 index 00000000..09027b22 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/true-action1.png differ diff --git a/oci-rag-agent/5-create-app/images/true-action2.png b/oci-rag-agent/5-create-app/images/true-action2.png new file mode 100644 index 00000000..165b76a0 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/true-action2.png differ diff --git a/oci-rag-agent/5-create-app/images/upload-doc.png b/oci-rag-agent/5-create-app/images/upload-doc.png new file mode 100644 index 00000000..fa81274c Binary files /dev/null and b/oci-rag-agent/5-create-app/images/upload-doc.png differ diff --git a/oci-rag-agent/5-create-app/images/upload.png b/oci-rag-agent/5-create-app/images/upload.png new file mode 100644 index 00000000..e8964572 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/upload.png differ diff --git a/oci-rag-agent/5-create-app/images/use-create-app-wizard.png b/oci-rag-agent/5-create-app/images/use-create-app-wizard.png new file mode 100644 index 00000000..ee87e1db Binary files /dev/null and b/oci-rag-agent/5-create-app/images/use-create-app-wizard.png differ diff --git a/oci-rag-agent/5-create-app/images/view-citations.png b/oci-rag-agent/5-create-app/images/view-citations.png new file mode 100644 index 00000000..9ccb0d86 Binary files /dev/null and b/oci-rag-agent/5-create-app/images/view-citations.png differ diff --git a/oci-rag-agent/6-enhance-ui/6-enhance-ui.md b/oci-rag-agent/6-enhance-ui/6-enhance-ui.md new file mode 100644 index 00000000..58abf09e --- /dev/null +++ b/oci-rag-agent/6-enhance-ui/6-enhance-ui.md @@ -0,0 +1,114 @@ +# Enhance Application UI + +## Introduction + +In this lab, we will focus on improving the visual design and user experience of the application. You will apply the Redwood theme, use inline CSS for styling specific components, and explore Theme Roller to customize the look and feel of your application. These enhancements help create a more modern, consistent, and user-friendly interface. + +Estimated Time: 5 Minutes + +### Objectives + +In this lab, you will: + +- Add Inline CSS. + +- Customize Theme using Theme Roller. + +## Task 1: Add Inline CSS + +1. Navigate to Page 1 **Chat With OCI Generative AI**. + +2. Under **Breadcrumb Bar**, click **GenAI Agents for APEX** . + +3. In the Property Editor, enter/select the following: + + - Identification > Type: **Static Content** + + - Appearance > Template: **Blank with Attributes** + + ![Breadcrumb](images/breadcrumb.png " ") + +4. Navigate to **Page 1 : Chat With OCI Generative AI** root node and in the Property Editor, enter/select the following: + + - Navigation Menu > Override User Interface Level: **Toggle On** + + - CSS > Inline: Copy and paste the below CSS in the code editor: + + ``` + + + .t-Chat, .t-Chat .t-Comments { + height: 470px; + overflow: scroll; + } + + .t-Chat .t-Chat--own { + flex-direction: row-reverse; + } + + .t-Chat .t-Chat--own .t-Comments-icon { + margin: 0 0 0 12px; + } + + .t-Chat .t-Chat--own .t-Comments-body { + align-items: flex-end; + } + + .t-Chat .t-Chat--own .t-Comments-comment:after { + border-left-color: var(--ut-comment-chat-background-color); + border-right-color: transparent; + right: auto; + left: 100%; + } + + + ``` + + ![Breadcrumb](images/page1.png " ") + +5. Now, run the application. + +## Task 2: Explore Theme Roller to customize the look and feel + +1. At bottom navigate to **Developer Toolbar**. Click **Customize > Theme Roller**. + + ![Developer Toolbar](images/developer-toolbar.png " ") + +2. Theme > Select Theme > **Redwood Light**. + +3. Under Redwood Options, enter/select the following: + + - Pillar > **Neutral(Default)** + + - Layout > **Floating** + +4. Under Appearance, enter/select the following: + + - Header > **Dark** + + - Navigation > **Pillar** + + - Body Header > **Dark** + + - Body Background > **Light(Default)** + +5. Click **Save As**. + + ![Theme](images/theme-roller.png " ") + +6. Enter Style Name: **Theme**, click **Save**. + + ![Save Theme](images/save-theme.png " ") + + ![Final App](images/final-app.png " ") + +## Summary + +In this lab, you have learned how to work with and the Theme Roller. + +You may now proceed to the next lab. + +## Acknowledgements + +- **Author(s)**: Roopesh Thokala, Senior Product Manager; Shailu Srivastava, Product Manager +- **Last Updated By/Date**: Shailu Srivastava, Product Manager, June 2025 diff --git a/oci-rag-agent/6-enhance-ui/images/breadcrumb.png b/oci-rag-agent/6-enhance-ui/images/breadcrumb.png new file mode 100644 index 00000000..09d5997f Binary files /dev/null and b/oci-rag-agent/6-enhance-ui/images/breadcrumb.png differ diff --git a/oci-rag-agent/6-enhance-ui/images/developer-toolbar.png b/oci-rag-agent/6-enhance-ui/images/developer-toolbar.png new file mode 100644 index 00000000..1cae1121 Binary files /dev/null and b/oci-rag-agent/6-enhance-ui/images/developer-toolbar.png differ diff --git a/oci-rag-agent/6-enhance-ui/images/final-app.png b/oci-rag-agent/6-enhance-ui/images/final-app.png new file mode 100644 index 00000000..9bb187d9 Binary files /dev/null and b/oci-rag-agent/6-enhance-ui/images/final-app.png differ diff --git a/oci-rag-agent/6-enhance-ui/images/page1.png b/oci-rag-agent/6-enhance-ui/images/page1.png new file mode 100644 index 00000000..24089aab Binary files /dev/null and b/oci-rag-agent/6-enhance-ui/images/page1.png differ diff --git a/oci-rag-agent/6-enhance-ui/images/save-theme.png b/oci-rag-agent/6-enhance-ui/images/save-theme.png new file mode 100644 index 00000000..d567218d Binary files /dev/null and b/oci-rag-agent/6-enhance-ui/images/save-theme.png differ diff --git a/oci-rag-agent/6-enhance-ui/images/theme-roller.png b/oci-rag-agent/6-enhance-ui/images/theme-roller.png new file mode 100644 index 00000000..f32176dc Binary files /dev/null and b/oci-rag-agent/6-enhance-ui/images/theme-roller.png differ diff --git a/oci-rag-agent/7-run-app/7-run-app.md b/oci-rag-agent/7-run-app/7-run-app.md new file mode 100644 index 00000000..5be9ae2e --- /dev/null +++ b/oci-rag-agent/7-run-app/7-run-app.md @@ -0,0 +1,86 @@ +# Run the Application + +## Introduction + +In this lab, you will begin by running the application to explore its key features in action. Specifically, you'll interact with the **Upload Document**, **Create Session** functionality, experience how to chat with the RAG Agent, and perform essential file operations such as deleting and saving files. + +Estimated Time: 5 Minutes + +### Objectives + +In this lab, you will: + +- Add document to Object Storage, using APEX. + +- Chat with Generative AI Agent on the documents uploaded. + +- View Citations for the response from Agent. + +- Establish New Session. + +- Download/delete the file from Object Store by using APEX. + +## Task 1: Add document to Object Storage, using APEX + +In this task you will upload document to OVI Object storage using APEX. + +1. In the **Navigation Bar**, click **Upload Documents** . + + ![UI UploadDoc](images/ui-uploaddoc.png " ") + +2. Click **Choose File** option or drag and drop the [apex\_document.pdf](files/apex_document.pdf) file on to the dialog window. + +3. Click **Create**. + + ![UI Upload](images/ui-upload.png " ") + +4. File gets added to OCI Object Storage bucket and ingestion job will run at the backend and details like ingestion id will be stored in database table. + + ![Ingestion Job](images/ingestionjob.png " ") + +5. Once the document uploaded successfully, click **Chat With AI Agent** + + ![Ingestion Job](images/ingestionjob-success.png " ") + +## Task 2: Chat with AI and view citations of the response + +In this task you will chat with AI and can view the citations of the response, so you can verify the information and gain more context. + +1. Enter your question and press **Enter**. + + ![Type](images/type.png " ") + + ![Type](images/type-chat.png " ") + +2. Click **View Citations** link. + + ![Type](images/click-citation.png " ") + +3. Close the dialog. + +## Task 3: Create a New Chat session + +In this task you can create new session which refreshes the current chat and starts a new session and download or delete your existing document. + +1. On the **Navigation Bar**, click **New Session**. + + ![New Session1](images/new-session1.png " ") + + ![Refresh Session](images/refresh.png " ") + +2. Click **Upload Documents** in the navigation bar. + + ![UI UploadDoc](images/ui-uploaddoc.png " ") + +3. Click three dot and select **Download** or **Delete**. + + ![Three Menu](images/three-menu.png " ") + +## Summary + +In this lab, you have learned how to work with static components, create computations and processes, define page items, invoke REST APIs. Additionally, you created an automation process to fetch ingestion job details. + +## Acknowledgements + +- **Author(s)**: Roopesh Thokala, Senior Product Manager; Shailu Srivastava, Product Manager +- **Last Updated By/Date**: Shailu Srivastava, Product Manager, June 2025 diff --git a/oci-rag-agent/7-run-app/files/apex_document.pdf b/oci-rag-agent/7-run-app/files/apex_document.pdf new file mode 100644 index 00000000..0d714be7 Binary files /dev/null and b/oci-rag-agent/7-run-app/files/apex_document.pdf differ diff --git a/oci-rag-agent/7-run-app/images/Ingestionjob.png b/oci-rag-agent/7-run-app/images/Ingestionjob.png new file mode 100644 index 00000000..5d7a371c Binary files /dev/null and b/oci-rag-agent/7-run-app/images/Ingestionjob.png differ diff --git a/oci-rag-agent/7-run-app/images/click-citation.png b/oci-rag-agent/7-run-app/images/click-citation.png new file mode 100644 index 00000000..0402db07 Binary files /dev/null and b/oci-rag-agent/7-run-app/images/click-citation.png differ diff --git a/oci-rag-agent/7-run-app/images/ingestionjob-success.png b/oci-rag-agent/7-run-app/images/ingestionjob-success.png new file mode 100644 index 00000000..a073928f Binary files /dev/null and b/oci-rag-agent/7-run-app/images/ingestionjob-success.png differ diff --git a/oci-rag-agent/7-run-app/images/new-session1.png b/oci-rag-agent/7-run-app/images/new-session1.png new file mode 100644 index 00000000..59371a08 Binary files /dev/null and b/oci-rag-agent/7-run-app/images/new-session1.png differ diff --git a/oci-rag-agent/7-run-app/images/refresh.png b/oci-rag-agent/7-run-app/images/refresh.png new file mode 100644 index 00000000..98642ce1 Binary files /dev/null and b/oci-rag-agent/7-run-app/images/refresh.png differ diff --git a/oci-rag-agent/7-run-app/images/three-menu.png b/oci-rag-agent/7-run-app/images/three-menu.png new file mode 100644 index 00000000..1723f3a5 Binary files /dev/null and b/oci-rag-agent/7-run-app/images/three-menu.png differ diff --git a/oci-rag-agent/7-run-app/images/type-chat.png b/oci-rag-agent/7-run-app/images/type-chat.png new file mode 100644 index 00000000..1b5cdbd4 Binary files /dev/null and b/oci-rag-agent/7-run-app/images/type-chat.png differ diff --git a/oci-rag-agent/7-run-app/images/type.png b/oci-rag-agent/7-run-app/images/type.png new file mode 100644 index 00000000..09c0ec0d Binary files /dev/null and b/oci-rag-agent/7-run-app/images/type.png differ diff --git a/oci-rag-agent/7-run-app/images/ui-upload.png b/oci-rag-agent/7-run-app/images/ui-upload.png new file mode 100644 index 00000000..8f56736a Binary files /dev/null and b/oci-rag-agent/7-run-app/images/ui-upload.png differ diff --git a/oci-rag-agent/7-run-app/images/ui-uploaddoc.png b/oci-rag-agent/7-run-app/images/ui-uploaddoc.png new file mode 100644 index 00000000..d6ffefef Binary files /dev/null and b/oci-rag-agent/7-run-app/images/ui-uploaddoc.png differ diff --git a/oci-rag-agent/7-run-app/images/ui-uploadtokb.png b/oci-rag-agent/7-run-app/images/ui-uploadtokb.png new file mode 100644 index 00000000..aaa86188 Binary files /dev/null and b/oci-rag-agent/7-run-app/images/ui-uploadtokb.png differ diff --git a/oci-rag-agent/workshops/tenancy/index.html b/oci-rag-agent/workshops/tenancy/index.html new file mode 100644 index 00000000..f1ce1cf2 --- /dev/null +++ b/oci-rag-agent/workshops/tenancy/index.html @@ -0,0 +1,63 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/oci-rag-agent/workshops/tenancy/manifest.json b/oci-rag-agent/workshops/tenancy/manifest.json new file mode 100644 index 00000000..71dc120c --- /dev/null +++ b/oci-rag-agent/workshops/tenancy/manifest.json @@ -0,0 +1,48 @@ +{ + "workshoptitle": "Enhance your Oracle APEX App with Document-Aware Generative AI Agents", + "tutorials": [ + { + "title": "Introduction", + "filename": "../../0-introduction/0-introduction.md" + }, + { + "title": "Get Started", + "filename": "../../../common-242/1-sign-up-apex/1-sign-up-apex.md" + }, + { + "title": "Lab 1: Configure OCI API Keys and Bucket", + "filename": "../../1-configure-oci-keys/1-configure-oci-keys.md" + }, + { + "title": "Lab 2: Create Knowledge Base and Generative AI Agent", + "filename": "../../2-configure-kb-genai/2-configure-kb-genai.md" + }, + { + "title": "Lab 3: Setup Task for Application Development", + "filename": "../../3-setup-task/3-setup-task.md" + }, + { + "title": "Lab 4: Create APEX App and Configure REST Data Source", + "filename": "../../4-configure-restapi/4-configure-restapi.md" + }, + { + "title": "Lab 5: Add Page Items and Page Processes", + "filename": "../../5-create-app/5-create-app.md" + }, + { + "title": "Lab 6: Enhance Application UI", + "filename": "../../6-enhance-ui/6-enhance-ui.md" + }, + { + "title": "Lab 7: Run the Application", + "filename": "../../7-run-app/7-run-app.md" + }, + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename":"https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + ] +} + +