Skip to content

added the new 3 RAG SOLUTIONS #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ We even allow visibility on the chunking results from the proximitiy search pass
Please refer to the "Show Documentation" button in the app or the field help info (press the '?' next to each field).


## Important - please deploy the solution in one of the listed regions below as the GenAI it's only available in this regions. If you deploy it in other regions, the solution will not work. If you don't have any of the regions available in your tenancy, please subscribe to one of them.


Some regions don't offer all the models. See the region for each pretrained model to find out which models are available in a region near you.

| Region Name | Location | Region Identifier | Region Key |
|--------------------------|----------|-------------------|------------|
| Brazil East (Sao Paulo) | Sao Paulo | sa-saopaulo-1 | GRU |
| Germany Central (Frankfurt) | Frankfurt | eu-frankfurt-1 | FRA |
| Japan Central (Osaka) | Osaka | ap-osaka-1 | KIX |
| UK South (London) | London | uk-london-1 | LHR |
| US Midwest (Chicago) | Chicago | us-chicago-1 | ORD |



## <a name="deliverables"></a>Deliverables
----------------

Expand Down Expand Up @@ -65,7 +80,7 @@ If you don't have the required permissions and quota, contact your tenancy admin

# <a name="Deploy-Using-Oracle-Resource-Manager"></a>Deploy Using Oracle Resource Manager

1. Click [![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?region=home&zipUrl=https://github.com/oracle-devrel/terraform-oci-oracle-cloud-foundation/releases/download/v1.0.0/easyRAG-IN-A-BOX-RM.zip)
1. Click [![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?region=home&zipUrl=https://github.com/oracle-devrel/terraform-oci-oracle-cloud-foundation/releases/download/v1.0.0/RAG-in-a-Box-Easy-RM.zip)


If you aren't already signed in, when prompted, enter the tenancy and user credentials.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ output "apex_url" {
}

output "easyRAG_IN_A_BOX_URL" {
value = join("", [lower(trimsuffix(join("\n", [for b in oci_database_autonomous_database.adw : b.connection_urls.0.graph_studio_url]), "/graphstudio/")),"/ords/r/riab/rag-in-a-box102"])
value = join("", [lower(trimsuffix(join("\n", [for b in oci_database_autonomous_database.adw : b.connection_urls.0.graph_studio_url]), "/graphstudio/")),"/ords/r/riab/erag-in-a-box102"])
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2025, Oracle and/or its affiliates.
# Copyright © 2022, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

data "oci_objectstorage_namespace" "os" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2025, Oracle and/or its affiliates.
# Copyright © 2022, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

# output "buckets" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2025, Oracle and/or its affiliates.
# Copyright © 2022, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ resource "null_resource" "sqlcl-create-usr" {
echo 'Creating the APEX WORKSPACE and APEX USER running easyRAG-IN-A-BOX_APEX_ADMIN_v2.0.sql'
sql -cloudconfig wallet_${var.db_name}.zip admin/${var.db_password}@'${local.conn_db}' @./scripts/easyRAG-IN-A-BOX_APEX_ADMIN_v2.0.sql ${var.apex_workspace} ${var.riab_user} ${var.apex_user} ${var.apex_password} ${var.apex_password}

echo 'Start running easyRAG-IN-A-BOX_USER_v2.0.sql script'
sql -cloudconfig wallet_${var.db_name}.zip ${var.riab_user}/${var.riab_password}@'${local.conn_db}' @./scripts/easyRAG-IN-A-BOX_USER_v2.0.sql
echo 'Start running easyRAG-IN-A-BOX_USER_v2.2.sql script'
sql -cloudconfig wallet_${var.db_name}.zip ${var.riab_user}/${var.riab_password}@'${local.conn_db}' @./scripts/easyRAG-IN-A-BOX_USER_v2.2.sql

echo 'Start running easyRAG-IN-A-BOX_USER_CREDS.sql script'
sql -cloudconfig wallet_${var.db_name}.zip ${var.riab_user}/${var.riab_password}@'${local.conn_db}' @./scripts/easyRAG-IN-A-BOX_USER_CREDS.sql ${var.apex_user} ${var.user_ocid} ${var.tenancy_ocid} "${local.final_bucket_url}" "${var.private_key}" ${var.fingerprint} ${var.compartment_id}
echo 'Start running easyRAG-IN-A-BOX_USER_CREDS_v1.1.sql script'
sql -cloudconfig wallet_${var.db_name}.zip ${var.riab_user}/${var.riab_password}@'${local.conn_db}' @./scripts/easyRAG-IN-A-BOX_USER_CREDS_v1.1.sql ${var.apex_user} ${var.user_ocid} ${var.tenancy_ocid} "${local.final_bucket_url}" "${var.private_key}" ${var.fingerprint} ${var.compartment_id}

echo 'Install the APEX APP in a box application running easyRAG-IN-A-BOX_APEX_USER_v2.0.sql'
sql -cloudconfig wallet_${var.db_name}.zip ${var.riab_user}/${var.riab_password}@'${local.conn_db}' @./scripts/easyRAG-IN-A-BOX_APEX_USER_v2.0.sql ${var.apex_workspace} ${var.riab_user} ./scripts/easyRAG-IN-A-BOX_f102_v1.6.sql
sql -cloudconfig wallet_${var.db_name}.zip ${var.riab_user}/${var.riab_password}@'${local.conn_db}' @./scripts/easyRAG-IN-A-BOX_APEX_USER_v2.0.sql ${var.apex_workspace} ${var.riab_user} ./scripts/easyRAG-IN-A-BOX_f103_v2.1.sql

EOT
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,33 @@
----------------------------------------------------------------
-- Copyright © 2025, Oracle and/or its affiliates.
-- All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl
--------------------------------------------------------------------------------------------------------------------------------
--
-- easyRAG-IN-A-BOX ADMIN.txt
-- easyRAG-IN-A-BOX_ADMIN.sql
--
-- this script will setup up a new user in an autonomous DB
-- and create a RAG system loading from source documents on
-- object store and the select AI framework.
--
--
-- v1.0 initial release
-- v1.1 add credentials management
-- v1.2 add username parametrization
-- v1.3 fix grant on pipeline to avoid silent error
-- v1.4 added user creation
-- v1.5 refactored user creation and added exit for terraform
-- v1.0 mac initial release
-- v1.1 mac add credentials management
-- v1.2 mac add username parametrization
-- v1.3 mac fix grant on pipeline to avoid silent error
-- v1.4 mac added user creation
-- v1.5 mac refactored user creation and added exit for terraform
-- v2.0 mac first production
--
----------------------------------------------------------------

----------------------------------------------------------------
-- Parameters
--
-- ************ IN SHELL
-- &1 DB user name (e.g., RIABDB) - the db user that owns the code
-- &2 DB password
--
----------------------------------------------------------------
--
-- If never done before, create API Key, download both PRIVATE and PUBLIC key files
-- Convert PRIVATE KEY into the needed format for the credentials
-- DO NOT USE rtf, just plain text files
--
-- awk -v ORS='\\n' '1' /Users/massimo/Downloads/[email protected]_2024-11-14T14_26_42.293Z.pem | pbcopy
--
--

----------------------------------------------------------------
--
-- ************ AS ADMIN
--
-- Run this script in ADMIN like this
--
-- @easyRAG-IN-A-BOX_ADMIN_v1.2 <user> <password>
--
----------------------------------------------------------------

-- make sure to be ADMIN
Expand All @@ -59,31 +50,31 @@ grant DB_DEVELOPER_ROLE to &1;
--grant OML_DEVELOPER to &1;
--ALTER USER &1 DEFAULT ROLE CONNECT,DB_DEVELOPER_ROLE,RESOURCE,CONSOLE_DEVELOPER,DWROLE,GRAPH_DEVELOPER,OML_DEVELOPER;

-- Grants to allow creation and manipulation of vector tables
-- Grants to allow creation and manipulation of vector tables
GRANT CREATE TABLE TO &1;

ALTER USER &1 DEFAULT TABLESPACE DATA TEMPORARY TABLESPACE TEMP;
ALTER USER &1 QUOTA UNLIMITED ON DATA;

-- PRIVILEGES
-- needed to use the SLEEP function in ingestion routine
ALTER USER &1 DEFAULT TABLESPACE DATA TEMPORARY TABLESPACE TEMP;
ALTER USER &1 QUOTA UNLIMITED ON DATA;
-- PRIVILEGES
-- needed to use the SLEEP function in ingestion routine
GRANT EXECUTE ON DBMS_LOCK TO &1;

-- needed if you use select AI
GRANT EXECUTE ON DBMS_CLOUD_AI TO &1;

-- DBMS_VECTOR for vector search operations
GRANT EXECUTE ON DBMS_VECTOR TO &1;

-- DBMS_CLOUD for accessing Object Storage (if used in your setup)
GRANT EXECUTE ON DBMS_CLOUD TO &1;

-- DBMS_CREDENTIAL for managing and using stored OCI credentials
GRANT EXECUTE ON DBMS_CREDENTIAL TO &1;

-- JSON functions, if JSON is used in vector search
GRANT EXECUTE ON DBMS_JSON TO &1;

GRANT EXECUTE ON DBMS_CLOUD_AI TO &1;
-- DBMS_VECTOR for vector search operations
GRANT EXECUTE ON DBMS_VECTOR TO &1;
-- DBMS_CLOUD for accessing Object Storage (if used in your setup)
GRANT EXECUTE ON DBMS_CLOUD TO &1;
-- DBMS_CREDENTIAL for managing and using stored OCI credentials
GRANT EXECUTE ON DBMS_CREDENTIAL TO &1;
-- JSON functions, if JSON is used in vector search
GRANT EXECUTE ON DBMS_JSON TO &1;
-- without these roles the user will not be able to fully create a vector index using the select AI packages.
GRANT EXECUTE ON DBMS_CLOUD_PIPELINE to &1;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
-- Copyright © 2025, Oracle and/or its affiliates.
-- All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl
----------------------------------------------------------------
--
-- easyRAG-IN-A-BOX_APEX_ADMIN.sql
--
-- this script will setup up a new workspace in APEX and add
-- the admin user.
--
-- MUST run as ADMIN
-- v2.0 mac initial release
--
-- Parameters:
-- 1 workspace name
-- 2 base oracle schema
-- 3 apex admin username
-- 4 apex admin password for db
-- 5 apex admin password for apex
--
-- v2.0 initial release
-- 1 apex workspace name (e.g., ERIAB)
-- 2 base oracle schema (as entered in the USER script)
-- 3 apex admin username (e.g., ERIAB)
-- 4 apex admin password for db (must comply with min password lenght, etc)
-- 5 apex admin password for apex (can be same as username, e.g., ERIAB)
--
----------------------------------------------------------------

----------------------------------------------------------------
--
-- ************ AS ADMIN
--
----------------------------------------------------------------
declare
l_workspace varchar2(50) := '&1';
l_db_schema varchar2(50) := '&2';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
-- Copyright © 2025, Oracle and/or its affiliates.
-- All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl
--------------------------------------------------------------------------------------------------------------------------------
--
-- easyRAG-IN-A-BOX_APEX_USER.sql
--
-- this script will load the application code
--
-- v1.0 mac initial release
-- v2.0 mac added file to load
--
-- Parameters:
--
-- 1 workspace name as entered in the APEX ADMIN script
-- 2 base oracle schema as entered in the ADMIN
-- 3 application file to load, including path if needed
--
----------------------------------------------------------------

----------------------------------------------------------------
--
-- ************ AS APEX ADMIN user (using the DB password!)
--
----------------------------------------------------------------

declare
l_workspace_id number;
begin
select workspace_id into l_workspace_id
from apex_workspaces
where workspace = '&1';
--
apex_application_install.set_workspace_id( l_workspace_id );
apex_application_install.generate_offset;
apex_application_install.set_schema( '&2' );
end;
/

@&3

--
-- end of script
--
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
-- Copyright © 2025, Oracle and/or its affiliates.
-- All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl
----------------------------------------------------------------
--
-- easyRAG-IN-A-BOX.txt
-- easyRAG-IN-A-BOX_USER_CREDS.sql
--
-- this script will create the necesarry credentials set to
-- populate and use the rag agent
-- this script will create the necessary credentials set, and
-- complete the initial setup for immediate use of RIAB
--
-- Parameters
--
----------------------------------------------------------------

----------------------------------------------------------------
-- AS DATABASE USER
----------------------------------------------------------------
----------------------------------------------------------------
-- Create USER_CREDS credentials for the DB USER
----------------------------------------------------------------
-- '&1' - ${var.apex_user}
-- "&2" - ${var.user_ocid}
-- "&3" - ${var.tenancy_ocid}
-- "&4" - ${var.bucket_url}
-- "&5" - ${var.private_key}
-- "&6" - ${var.fingerprint}
-- "&7" - ${var.compartment_id}
--
-- v1.0 iop initial release
-- v1.1 mac update docs
--
----------------------------------------------------------------
-- Create user settings table

----------------------------------------------------------------
-- AS DATABASE USER
----------------------------------------------------------------

-- Insert data into the q_logs table
Expand All @@ -37,9 +39,6 @@ INSERT INTO eriab_user_settings VALUES (
"refresh" : 1040
}'));

-- exercise the setting table
select * from eriab_user_settings;

-- Insert credentials data into the setting table
INSERT INTO eriab_user_settings VALUES (
'&1',
Expand All @@ -51,7 +50,6 @@ INSERT INTO eriab_user_settings VALUES (
"fingerprint" : "&6"
}'));


-- Insert credentials data into the setting table
INSERT INTO eriab_user_settings VALUES (
'&1',
Expand All @@ -63,11 +61,10 @@ INSERT INTO eriab_user_settings VALUES (
"fingerprint" : "&6"
}'));


-- exercise the setting table
select * from eriab_user_settings;


-- create bucket and llm credential, start ingestion and index creation
begin
eriab_create_bucket_cred('&1');
eriab_create_llm_cred('&1');
Expand Down
Loading