forked from oracle-devrel/oracle-autonomous-database-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectAI4Py -3- Retrieval Augmented Generation (RAG).dsnb
More file actions
1 lines (1 loc) · 106 KB
/
SelectAI4Py -3- Retrieval Augmented Generation (RAG).dsnb
File metadata and controls
1 lines (1 loc) · 106 KB
1
[{"layout":"jupyter","isRunnable":true,"template":null,"templateConfig":null,"isEditable":true,"name":"SelectAI4Py -3- Retrieval Augmented Generation (RAG)","description":null,"type":"low","paragraphs":[{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":null,"message":[],"enabled":true,"result":{"startTime":1760326824283,"interpreter":"md.low","endTime":1760326824740,"results":[],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":0,"hideResult":true,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","# Select AI with Retrieval Augmented Generation (RAG)","","Select AI supports retreival augmented generation (RAG) to enhance LLM responses by augmenting the user prompt with your specific content retrieved using semantic similarity search. ","RAG is supported in Oracle Autonomous Database 23ai and uses the AI Vector Search feature. ","RAG enables more accurate and contextually relevant responses while reducing hallucinations. RAG bridges the gap between the general ","knowledge of the LLM and your proprietary information, without LLM fine-tuning. ","","Select AI RAG can also provide document sources and text chunk offsets within those documents that contribute to responses. The document sources enhances explainability. ","You can also view the specific text chunks that are provided to the LLM for a given prompt. ","","Select AI RAG provides the following capabilities:","","* Create and populate an Autonomous Database 23ai vector store and vector index based on content in object storage ","* Periodically update the vector index based on content in object storage with a frequency you set","* Augment prompts with content retrieved using semantic similarity search","* Send the augmented prompt to your specified LLM and return generated results with optional sources","* View the specific text chunks that are provided to the LLM for a given prompt","","Select AI RAG simplifies and automates retrieval augmentation generation.","","---","","Copyright (c) 2025 Oracle Corporation ","###### [The Universal Permissive License (UPL), Version 1.0](https://oss.oracle.com/licenses/upl/)"],"enabled":true,"result":{"startTime":1760326825129,"interpreter":"md.low","endTime":1760326825498,"results":[{"message":"<h1 id=\"select-ai-with-retrieval-augmented-generation-rag\">Select AI with Retrieval Augmented Generation (RAG)<\/h1>\n<p>Select AI supports retreival augmented generation (RAG) to enhance LLM responses by augmenting the user prompt with your specific content retrieved using semantic similarity search.\nRAG is supported in Oracle Autonomous Database 23ai and uses the AI Vector Search feature.\nRAG enables more accurate and contextually relevant responses while reducing hallucinations. RAG bridges the gap between the general\nknowledge of the LLM and your proprietary information, without LLM fine-tuning.<\/p>\n<p>Select AI RAG can also provide document sources and text chunk offsets within those documents that contribute to responses. The document sources enhances explainability.\nYou can also view the specific text chunks that are provided to the LLM for a given prompt.<\/p>\n<p>Select AI RAG provides the following capabilities:<\/p>\n<ul>\n<li>Create and populate an Autonomous Database 23ai vector store and vector index based on content in object storage<\/li>\n<li>Periodically update the vector index based on content in object storage with a frequency you set<\/li>\n<li>Augment prompts with content retrieved using semantic similarity search<\/li>\n<li>Send the augmented prompt to your specified LLM and return generated results with optional sources<\/li>\n<li>View the specific text chunks that are provided to the LLM for a given prompt<\/li>\n<\/ul>\n<p>Select AI RAG simplifies and automates retrieval augmentation generation.<\/p>\n<hr />\n<p>Copyright (c) 2025 Oracle Corporation<\/p>\n<h6 id=\"the-universal-permissive-license-upl-version-10\"><a href=\"https://oss.oracle.com/licenses/upl/\">The Universal Permissive License (UPL), Version 1.0<\/a><\/h6>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### For more information...","","<a href=\"https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/pysai/index.html\" target=\"_blank\">Select AI for Python documentation<\/a>"],"enabled":true,"result":{"startTime":1760326825882,"interpreter":"md.low","endTime":1760326826231,"results":[{"message":"<h3 id=\"for-more-information\">For more information...<\/h3>\n<p><a href=\"https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/pysai/index.html\" target=\"_blank\">Select AI for Python documentation<\/a><\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Prerequisites"," ","Before proceeding, you must complete the required setup steps in the **SelectAI4Py -0- Prerequisites and Setup** notebook:","","###### ADMIN:","* Grants and network access","* Access to Object Storage with data for vector embedding","","###### Select AI user:","* OCI_GENAI_RAG_PY_DEMO profile definition with vector store configuration","* Optional: Load the augmented Hugging Face transformer models to the database","","The admin and user requirements (excluding optional steps) must be completed to run the RAG commands in this notebook."],"enabled":true,"result":{"startTime":1760326826611,"interpreter":"md.low","endTime":1760326826978,"results":[{"message":"<h3 id=\"prerequisites\">Prerequisites<\/h3>\n<p>Before proceeding, you must complete the required setup steps in the <strong>SelectAI4Py -0- Prerequisites and Setup<\/strong> notebook:<\/p>\n<h6 id=\"admin\">ADMIN:<\/h6>\n<ul>\n<li>Grants and network access<\/li>\n<li>Access to Object Storage with data for vector embedding<\/li>\n<\/ul>\n<h6 id=\"select-ai-user\">Select AI user:<\/h6>\n<ul>\n<li>OCI_GENAI_RAG_PY_DEMO profile definition with vector store configuration<\/li>\n<li>Optional: Load the augmented Hugging Face transformer models to the database<\/li>\n<\/ul>\n<p>The admin and user requirements (excluding optional steps) must be completed to run the RAG commands in this notebook.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Use Select AI to create a vector index on OML blogs","","Use the blog content derived from https://blogs.oracle.com/machinelearning that has been saved as individual text files in Oracle Object Storage.","","Create a vector index named `MY_VECTOR_INDEX2` that will store vector embeddings, which are semantic representations of your content from object storage. ","","For each document in object storage, Select AI:","1. Breaks it into chunks (configured via `chunk_size` and `chunk_overlap` parameters)","2. Converts each chunk into a numerical vector using a transformer (also known as an embedding model)","3. Stores these vectors with their source information for retrieval via semantic similarity search","4. Creates a vector index for optimized retrieval performance","","When users supply their prompt, Select AI vectorizes the prompt and searches for semantically similar content in the vector index. ","","> **Note:** The same transformer must be used for creating the vector index and vectorizing the user prompt. ","","This content is used to augment the user prompt before sending it to the LLM. The quality of retrieval can be tuned ","through parameters like chunk size, overlap, and distance metric based on your specific content."],"enabled":true,"result":{"startTime":1760326827357,"interpreter":"md.low","endTime":1760326827714,"results":[{"message":"<h3 id=\"use-select-ai-to-create-a-vector-index-on-oml-blogs\">Use Select AI to create a vector index on OML blogs<\/h3>\n<p>Use the blog content derived from <a href=\"https://blogs.oracle.com/machinelearning\">https://blogs.oracle.com/machinelearning<\/a> that has been saved as individual text files in Oracle Object Storage.<\/p>\n<p>Create a vector index named <code>MY_VECTOR_INDEX2<\/code> that will store vector embeddings, which are semantic representations of your content from object storage.<\/p>\n<p>For each document in object storage, Select AI:<\/p>\n<ol>\n<li>Breaks it into chunks (configured via <code>chunk_size<\/code> and <code>chunk_overlap<\/code> parameters)<\/li>\n<li>Converts each chunk into a numerical vector using a transformer (also known as an embedding model)<\/li>\n<li>Stores these vectors with their source information for retrieval via semantic similarity search<\/li>\n<li>Creates a vector index for optimized retrieval performance<\/li>\n<\/ol>\n<p>When users supply their prompt, Select AI vectorizes the prompt and searches for semantically similar content in the vector index.<\/p>\n<blockquote>\n<p><strong>Note:<\/strong> The same transformer must be used for creating the vector index and vectorizing the user prompt.<\/p>\n<\/blockquote>\n<p>This content is used to augment the user prompt before sending it to the LLM. The quality of retrieval can be tuned\nthrough parameters like chunk size, overlap, and distance metric based on your specific content.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"table","title":"View the content of our Object Storage bucket","message":["%python","","import oml","","result = oml.sync(query = \"\"\""," SELECT * FROM"," DBMS_CLOUD.LIST_OBJECTS("," credential_name => 'OCI_CRED2',"," location_uri => 'https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o')","\"\"\")","","z.show(result)"],"enabled":true,"result":{"startTime":1760326828096,"interpreter":"python.low","endTime":1760326832369,"results":[{"message":"OBJECT_NAME\tBYTES\tCHECKSUM\tCREATED\tLAST_MODIFIED\n6 Simple Tips for Better Text-to-SQL Generation.txt\t17246\t+wPVq6vnjvigElw5AyptmQ==\t2025-08-14 17:37:48.207000+00:00\t2025-08-14 17:37:48.207000+00:00\nADB-Select-AI-Accelerate-innovation-with-enterprise-data-OCI-GenerativeAIand-enhanced-security.txt\t4965\twZxP8/mV7N0mirUCItL1Jw==\t2024-08-09 15:19:41.083000+00:00\t2024-08-11 22:29:10.920000+00:00\nAnnouncing Additional AI Providers for Oracle Autonomous Database Select AI.txt\t10356\tAUN48wAPPFXodYdCno7OVw==\t2025-08-14 17:37:48.223000+00:00\t2025-08-14 17:37:48.223000+00:00\nAnnouncing Oracle Machine Learning for Python 2.1.txt\t26897\tP4voJHYNVjeIn8UEio9BBw==\t2025-08-14 17:37:48.204000+00:00\t2025-08-14 17:37:48.204000+00:00\nAnnouncing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\t15810\tg5OWlR0ewWSvURB+AgSNjg==\t2025-08-27 22:39:21.055000+00:00\t2025-08-27 22:40:16.310000+00:00\nAnnouncing-New-Oracle-Machine-Learning-Features-in-Oracle-Databas-23ai.txt\t7595\tx46HR+vDglB0H1ejECY8Qw==\t2024-08-09 15:19:40.946000+00:00\t2024-08-11 21:42:35.716000+00:00\nAnnouncing-OML-Data-Monitoring-User-Interface-on-Autonomous-Database.txt\t7380\t2mCebWetUyXsNjsU5h7sdg==\t2024-08-09 15:19:40.959000+00:00\t2024-08-11 21:43:26.635000+00:00\nAnnouncing-OML-Monitoring-on-Autonomous-Database.txt\t6229\t069xCGhbNga2ahIaI5syRg==\t2024-08-09 15:19:40.967000+00:00\t2024-08-11 21:43:56.557000+00:00\nAnnouncing-OML-Services-Batch-Scoring-on-Autonomous-Database.txt\t7240\tJiK6FgM9iQyzO+lzJLlbJQ==\t2024-08-09 15:19:40.899000+00:00\t2024-08-11 21:44:26.252000+00:00\nAnnouncing-Select-AI-with-Azure-OpenAI-Service-on-Oracle-Autonomous-Database.txt\t6150\tAvb3j2EAVs7loNb8aJCtnw==\t2024-08-09 15:19:40.908000+00:00\t2024-08-11 21:45:21.122000+00:00\nAnnouncing-custom-third-party-Python-and-R-packages-for-use-on-Autonomous-Database.txt\t4185\tG+yvHQkNeWSsO4axUQRJ0w==\t2024-08-09 15:19:41.149000+00:00\t2024-08-11 21:45:58.063000+00:00\nAnnouncing-next-generation-OML-Notebooks-on-Oracle-Autonomous-Database.txt\t3908\tpIPZK7/tVpjFZEEIMNqIeA==\t2024-08-09 15:19:41+00:00\t2024-08-11 21:46:32.203000+00:00\nAnnouncing-the-release-of-Oracle-Machine-Learning-for-Python-2.0-on-Autonomous-Database.txt\t4350\t0GAX5vO8zNYchpGY/aQdSA==\t2024-08-09 15:19:41.179000+00:00\t2024-08-11 22:17:02.432000+00:00\nApproaches-to-detect-potential-fraud.txt\t8924\tDetu0pLV5UcSl7/dp6ZzCg==\t2024-08-09 15:19:40.787000+00:00\t2024-08-11 21:47:39.055000+00:00\nBoost-your-R-to-database-connectivity-using-ROracle.txt\t5765\tp+x9loBd8veO9qRrc0/DXA==\t2024-08-09 15:19:40.767000+00:00\t2024-08-11 21:48:13.054000+00:00\nData-Driven-Decision-making-for-Debt-Collection.txt\t8619\tJna1Gyj/XMD6y5Oh8nraSQ==\t2024-08-09 15:19:40.735000+00:00\t2024-08-11 21:49:53.243000+00:00\nData-Monitoring-with-Oracle-Machine-Learning-Services.txt\t12587\tAsgOB3kGh1PC9eaLAdhx4A==\t2024-08-09 15:19:40.759000+00:00\t2024-08-11 21:48:46.218000+00:00\nDevelop-and-deploy-machine-learning-models-using-Oracle-Autonomous-Database-Machine-Learning-and-APEX.txt\t16029\tDKKdNysX7CSUWOI5FxoEpw==\t2024-08-09 15:19:40.719000+00:00\t2024-08-11 22:17:33.526000+00:00\nExploit-Data-Parallelism-for-R-Scalability-using-Oracle-Machine-Learning-for-R.txt\t5693\ty7OUOE1wwKhO3SkF/akF8Q==\t2024-08-09 15:19:40.600000+00:00\t2024-08-11 21:51:45.006000+00:00\nHow-to-perform-in-database-text-analytics-using-a-pre-built-ML-model.txt\t11773\tsRrXNA8ySE2ZTFWBSBZjZA==\t2024-08-09 15:19:40.558000+00:00\t2024-08-11 21:52:47.054000+00:00\nICYMI-Embedding-AI-ML-in-your-application-using-Oracle-Machine-Learning.txt\t2039\t4ULR8yFZ3MwD+KcRLL6uGw==\t2024-08-09 15:19:40.637000+00:00\t2024-08-11 21:49:27.458000+00:00\nICYMI-Learn-How-to-Invoke-Your-Python-Functions-from-SQL-with-OML4Py.txt\t4230\teJEQ7niAVz4LaR7KN2QxYw==\t2024-08-09 15:19:40.797000+00:00\t2024-08-11 21:53:23.367000+00:00\nIntroducing-Select-AI-Natural-Language-to-SQL-Generation-on-Autonomous-Database.txt\t11329\tohavv/ITnO25nxsDMr435Q==\t2024-08-09 15:19:40.444000+00:00\t2024-08-11 21:53:58.979000+00:00\nManage-your-models-with-Oracle-Machine-Learning-on-Autonomous-Database.txt\t23075\tJwVCchJkdPWN066BrMIaOg==\t2024-08-09 15:19:40.605000+00:00\t2024-08-11 21:56:35.632000+00:00\nModel-Monitoring-with-Oracle-Machine-Learning-Services.txt\t14649\t7NCeitsJUEkK2CvuLpsDfw==\t2024-08-09 15:19:40.451000+00:00\t2024-08-11 21:57:06.963000+00:00\nNow-Available-Pre-built-Embedding-Generation-model-for-Oracle-Database-23ai.txt\t7720\tn4KJIqZlOjtdirldiDN3Zw==\t2024-08-09 15:19:40.396000+00:00\t2024-08-11 21:58:09.344000+00:00\nOML-AutoML-UI-click-your-way-to-an-ML-model.txt\t9003\tscG+R8dj/Eo2JsfibkOqGg==\t2024-08-09 15:19:40.331000+00:00\t2024-08-11 21:58:37.365000+00:00\nOML4Py-Leveraging-ONNX-and-Hugging-Face-for-AI-Vector-Search.txt\t16210\tfLGisymS7RS8R/0AirOlig==\t2024-08-09 15:19:40.353000+00:00\t2024-08-11 22:18:19.418000+00:00\nOracleMachine-Learning-for-R-2.0-now-available-for-Oracle-Database.txt\t5522\tSpNCKwA1j9bgMvEZFEusXw==\t2024-08-09 15:19:40.572000+00:00\t2024-08-11 22:16:45.747000+00:00\nSelect AI Enhances Text-to-SQL Support.txt\t8646\tpAVa7+v+lJtfvNRXN+x9KQ==\t2025-08-14 17:37:48.215000+00:00\t2025-08-14 17:37:48.215000+00:00\nSelect AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\t8158\tdFBIbNpuYpi6HDSgNfaA4A==\t2025-08-14 17:37:48.194000+00:00\t2025-08-14 17:37:48.194000+00:00\nSimplify-your-model-monitoring-and-MLOps-with-OML-Model-Monitoring-UI.txt\t10343\tUSHUbN7vCgVEakwwwDWyhw==\t2024-08-09 15:19:40.342000+00:00\t2024-08-11 21:57:36.401000+00:00\nStoring-Named-R-and-Python-Functions-in-the-Oracle-Machine-Learning-Script-Repository.txt\t10984\tVLrAloZ0REEUQO7Dm7jh4g==\t2024-08-09 15:19:40.261000+00:00\t2024-08-11 21:59:15.775000+00:00\nSupercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\t14107\t0RKhVQWBgyYDAiKSH/k9+w==\t2025-08-14 17:37:48.218000+00:00\t2025-08-14 17:37:48.218000+00:00\nTop-10-Reasons-to-use-Machine-Learning-in-Oracle-Database.txt\t13688\tEm1zI6C0GC6cSivNiB+eZQ==\t2024-08-09 15:19:40.253000+00:00\t2024-08-11 22:01:37.367000+00:00\nUsing-Machine-Learning-for-Smart-Investment.txt\t4394\tHy0E1RzuscHMJrpIGQd0Iw==\t2024-08-09 15:19:40.225000+00:00\t2024-08-11 22:02:09.193000+00:00\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Create a vector index on Oracle Machine Learning and Select AI blogs in Object Storage","message":["%python","","import select_ai","","profile = select_ai.Profile(profile_name = \"OCI_GENAI_RAG_PY_DEMO\")","","vector_index_attributes = select_ai.OracleVectorIndexAttributes("," location = \"https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/\","," object_storage_credential_name = \"OCI_CRED2\","," vector_distance_metric = select_ai.VectorDistanceMetric.COSINE,"," chunk_overlap = 50,"," chunk_size = 450",")","","vector_index = select_ai.VectorIndex("," index_name = \"MY_VECTOR_INDEX2\","," attributes = vector_index_attributes,"," description = \"Vector index for Oracle Machine Learning blogs\","," profile = profile",")","","try:"," vector_index.delete(include_data = True, force = True)","except:"," pass","","vector_index.create()","print(\"Vector index created: \" + vector_index.index_name)"],"enabled":true,"result":{"startTime":1760326832779,"interpreter":"python.low","endTime":1760326835059,"results":[{"message":"Vector index created: MY_VECTOR_INDEX2\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Understanding chunk size and chunk overlap","","When creating your vector index, two important parameters affect retrieval quality:","","**Chunk Size:** Controls the size of document segments (450 in our example).","- Smaller chunks help find specific information but may lose context","- Larger chunks preserve more context but might include irrelevant information","","**Chunk Overlap:** Determines shared text between chunks (50 in our example).","- Helps maintain contextual connections between adjacent chunks","- Prevents important information from being split across chunk boundaries","","For most documentation like blogs, the settings used here (450 chunk size, 50 overlap) provide a reasonable balance. ","You can adjust these values based on your specific content and query needs."],"enabled":true,"result":{"startTime":1760326835449,"interpreter":"md.low","endTime":1760326835769,"results":[{"message":"<h3 id=\"understanding-chunk-size-and-chunk-overlap\">Understanding chunk size and chunk overlap<\/h3>\n<p>When creating your vector index, two important parameters affect retrieval quality:<\/p>\n<p><strong>Chunk Size:<\/strong> Controls the size of document segments (450 in our example).<\/p>\n<ul>\n<li>Smaller chunks help find specific information but may lose context<\/li>\n<li>Larger chunks preserve more context but might include irrelevant information<\/li>\n<\/ul>\n<p><strong>Chunk Overlap:<\/strong> Determines shared text between chunks (50 in our example).<\/p>\n<ul>\n<li>Helps maintain contextual connections between adjacent chunks<\/li>\n<li>Prevents important information from being split across chunk boundaries<\/li>\n<\/ul>\n<p>For most documentation like blogs, the settings used here (450 chunk size, 50 overlap) provide a reasonable balance.\nYou can adjust these values based on your specific content and query needs.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Pause for 10 seconds for pipeline job to start","message":["%python","","import time","time.sleep(10)"],"enabled":true,"result":{"startTime":1760326836210,"interpreter":"python.low","endTime":1760326846586,"results":[],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Check on running pipeline","message":["%python","","result = oml.sync(query = \"\"\""," SELECT job_name, job_style, session_id, elapsed_time, log_id"," FROM USER_SCHEDULER_RUNNING_JOBS","\"\"\")","","if result.shape[0] == 0:"," print(\"Pipeline has completed - no running jobs found.\")","else:"," z.show(result)"],"enabled":true,"result":{"startTime":1760326846961,"interpreter":"python.low","endTime":1760326847552,"results":[{"message":"JOB_NAME\tJOB_STYLE\tSESSION_ID\tELAPSED_TIME\tLOG_ID\nPIPELINE$29\tREGULAR\t14085\t0 days 00:00:07.512167\t92128\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Pause for 5 seconds for vector index table creation","message":["%python","","import time","time.sleep(5)"],"enabled":true,"result":{"startTime":1760326847928,"interpreter":"python.low","endTime":1760326853307,"results":[],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Create pipeline status view","message":["%python","","cursor = oml.cursor()","","index_name = 'MY_VECTOR_INDEX2' ","","cursor.execute(\"\"\""," SELECT pipeline_name, status_table"," FROM user_cloud_pipelines"," WHERE pipeline_name = :1","\"\"\", [index_name + '$VECPIPELINE'])","","result = cursor.fetchone()","if result:"," pipeline_name = result[0]"," table_name = result[1]"," "," print(\"Pipeline Name: \" + pipeline_name)"," print(\"Status Table: \" + table_name)"," "," cursor.execute(f\"CREATE OR REPLACE VIEW MY_VECTOR_INDEX_STATUS_VIEW AS SELECT name, status, error_message FROM {table_name}\")"," print(\"View created\")","","cursor.execute('commit')"],"enabled":true,"result":{"startTime":1760326853689,"interpreter":"python.low","endTime":1760326854047,"results":[{"message":"Pipeline Name: MY_VECTOR_INDEX2$VECPIPELINE\nStatus Table: PIPELINE$29$256_STATUS\nView created\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Track and view document processing status for vector indexing","","Tracking document processing status gives you visibility into your vector index creation. Create a dedicated table to monitor which files have been successfully ","processed, which ones have failed, and capture any associated error messages. This monitoring approach allows you to identify and resolve issues with specific ","documents, helping you to verify proper ingestion of your data into the vector index. By maintaining this processing history, you can verify that your documents have ","been process successfully before using it for RAG operations."],"enabled":true,"result":{"startTime":1760326854445,"interpreter":"md.low","endTime":1760326854793,"results":[{"message":"<h3 id=\"track-and-view-document-processing-status-for-vector-indexing\">Track and view document processing status for vector indexing<\/h3>\n<p>Tracking document processing status gives you visibility into your vector index creation. Create a dedicated table to monitor which files have been successfully\nprocessed, which ones have failed, and capture any associated error messages. This monitoring approach allows you to identify and resolve issues with specific\ndocuments, helping you to verify proper ingestion of your data into the vector index. By maintaining this processing history, you can verify that your documents have\nbeen process successfully before using it for RAG operations.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"table","title":"View the status of processed files for vector indexing","message":["%python","","result = oml.sync(query = \"SELECT * FROM MY_VECTOR_INDEX_STATUS_VIEW\")","","z.show(result)"],"enabled":true,"result":{"startTime":1760326855182,"interpreter":"python.low","endTime":1760326855603,"results":[{"message":"NAME\tSTATUS\tERROR_MESSAGE\n6 Simple Tips for Better Text-to-SQL Generation.txt\tCOMPLETED\tNone\nADB-Select-AI-Accelerate-innovation-with-enterprise-data-OCI-GenerativeAIand-enhanced-security.txt\tCOMPLETED\tNone\nAnnouncing Additional AI Providers for Oracle Autonomous Database Select AI.txt\tCOMPLETED\tNone\nAnnouncing Oracle Machine Learning for Python 2.1.txt\tCOMPLETED\tNone\nAnnouncing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\tCOMPLETED\tNone\nAnnouncing-New-Oracle-Machine-Learning-Features-in-Oracle-Databas-23ai.txt\tCOMPLETED\tNone\nAnnouncing-OML-Data-Monitoring-User-Interface-on-Autonomous-Database.txt\tCOMPLETED\tNone\nAnnouncing-OML-Monitoring-on-Autonomous-Database.txt\tCOMPLETED\tNone\nAnnouncing-OML-Services-Batch-Scoring-on-Autonomous-Database.txt\tCOMPLETED\tNone\nAnnouncing-Select-AI-with-Azure-OpenAI-Service-on-Oracle-Autonomous-Database.txt\tCOMPLETED\tNone\nAnnouncing-custom-third-party-Python-and-R-packages-for-use-on-Autonomous-Database.txt\tCOMPLETED\tNone\nAnnouncing-next-generation-OML-Notebooks-on-Oracle-Autonomous-Database.txt\tCOMPLETED\tNone\nAnnouncing-the-release-of-Oracle-Machine-Learning-for-Python-2.0-on-Autonomous-Database.txt\tCOMPLETED\tNone\nApproaches-to-detect-potential-fraud.txt\tCOMPLETED\tNone\nBoost-your-R-to-database-connectivity-using-ROracle.txt\tCOMPLETED\tNone\nData-Driven-Decision-making-for-Debt-Collection.txt\tCOMPLETED\tNone\nData-Monitoring-with-Oracle-Machine-Learning-Services.txt\tCOMPLETED\tNone\nDevelop-and-deploy-machine-learning-models-using-Oracle-Autonomous-Database-Machine-Learning-and-APEX.txt\tCOMPLETED\tNone\nExploit-Data-Parallelism-for-R-Scalability-using-Oracle-Machine-Learning-for-R.txt\tCOMPLETED\tNone\nHow-to-perform-in-database-text-analytics-using-a-pre-built-ML-model.txt\tCOMPLETED\tNone\nICYMI-Embedding-AI-ML-in-your-application-using-Oracle-Machine-Learning.txt\tCOMPLETED\tNone\nICYMI-Learn-How-to-Invoke-Your-Python-Functions-from-SQL-with-OML4Py.txt\tCOMPLETED\tNone\nIntroducing-Select-AI-Natural-Language-to-SQL-Generation-on-Autonomous-Database.txt\tCOMPLETED\tNone\nManage-your-models-with-Oracle-Machine-Learning-on-Autonomous-Database.txt\tCOMPLETED\tNone\nModel-Monitoring-with-Oracle-Machine-Learning-Services.txt\tCOMPLETED\tNone\nNow-Available-Pre-built-Embedding-Generation-model-for-Oracle-Database-23ai.txt\tCOMPLETED\tNone\nOML-AutoML-UI-click-your-way-to-an-ML-model.txt\tCOMPLETED\tNone\nOML4Py-Leveraging-ONNX-and-Hugging-Face-for-AI-Vector-Search.txt\tCOMPLETED\tNone\nOracleMachine-Learning-for-R-2.0-now-available-for-Oracle-Database.txt\tCOMPLETED\tNone\nSelect AI Enhances Text-to-SQL Support.txt\tCOMPLETED\tNone\nSelect AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\tCOMPLETED\tNone\nSimplify-your-model-monitoring-and-MLOps-with-OML-Model-Monitoring-UI.txt\tCOMPLETED\tNone\nStoring-Named-R-and-Python-Functions-in-the-Oracle-Machine-Learning-Script-Repository.txt\tCOMPLETED\tNone\nSupercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\tCOMPLETED\tNone\nTop-10-Reasons-to-use-Machine-Learning-in-Oracle-Database.txt\tCOMPLETED\tNone\nUsing-Machine-Learning-for-Smart-Investment.txt\tCOMPLETED\tNone\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Vector index inspection","","The following queries allow you to examine the metadata and configuration of your vector index, which is helpful for verifying and troubleshooting the index ","creation process. By reviewing objects in the vector index processing steps, you can verify your vector index was created successfully. ","","This inspection may help diagnose document processing issues and make parameter adjustments."],"enabled":true,"result":{"startTime":1760326855979,"interpreter":"md.low","endTime":1760326856304,"results":[{"message":"<h3 id=\"vector-index-inspection\">Vector index inspection<\/h3>\n<p>The following queries allow you to examine the metadata and configuration of your vector index, which is helpful for verifying and troubleshooting the index\ncreation process. By reviewing objects in the vector index processing steps, you can verify your vector index was created successfully.<\/p>\n<p>This inspection may help diagnose document processing issues and make parameter adjustments.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"View attributes for MY_VECTOR_INDEX2","message":["%python","","from pprint import pprint","","vector_index = select_ai.VectorIndex(index_name = \"MY_VECTOR_INDEX2\")","attributes = vector_index.get_attributes()","pprint(attributes)"],"enabled":true,"result":{"startTime":1760326856685,"interpreter":"python.low","endTime":1760326857111,"results":[{"message":"OracleVectorIndexAttributes(chunk_size=450,\n chunk_overlap=50,\n location='https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/',\n match_limit=5,\n object_storage_credential_name='OCI_CRED2',\n profile_name='OCI_GENAI_RAG_PY_DEMO',\n refresh_rate=1440,\n similarity_threshold=0.0,\n vector_distance_metric='COSINE',\n vector_db_endpoint=None,\n vector_db_credential_name=None,\n vector_db_provider=<VectorDBProvider.ORACLE: 'oracle'>,\n vector_dimension=None,\n vector_table_name=None,\n pipeline_name='MY_VECTOR_INDEX2$VECPIPELINE')\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"table","title":"View attributes for MY_VECTOR_INDEX2 from SQL","message":["%python","","result = oml.sync(query = \"\"\""," SELECT INDEX_ID, INDEX_NAME, ATTRIBUTE_NAME, ATTRIBUTE_VALUE"," FROM user_cloud_vector_index_attributes"," WHERE index_name = 'MY_VECTOR_INDEX2'","\"\"\")","","z.show(result)"],"enabled":true,"result":{"startTime":1760326857501,"interpreter":"python.low","endTime":1760326857947,"results":[{"message":"INDEX_ID\tINDEX_NAME\tATTRIBUTE_NAME\tATTRIBUTE_VALUE\n27\tMY_VECTOR_INDEX2\tobject_storage_credential_name\tOCI_CRED2\n27\tMY_VECTOR_INDEX2\trefresh_rate\t1440\n27\tMY_VECTOR_INDEX2\tlocation\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/\n27\tMY_VECTOR_INDEX2\tchunk_size\t450\n27\tMY_VECTOR_INDEX2\tchunk_overlap\t50\n27\tMY_VECTOR_INDEX2\tmatch_limit\t5\n27\tMY_VECTOR_INDEX2\tprofile_name\tOCI_GENAI_RAG_PY_DEMO\n27\tMY_VECTOR_INDEX2\tsimilarity_threshold\t0\n27\tMY_VECTOR_INDEX2\tvector_distance_metric\tCOSINE\n27\tMY_VECTOR_INDEX2\tvector_db_provider\toracle\n27\tMY_VECTOR_INDEX2\tpipeline_name\tMY_VECTOR_INDEX2$VECPIPELINE\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"table","title":"View cloud pipeline history listing vector index job details","message":["%python","","result = oml.sync(query = \"\"\""," SELECT PIPELINE_NAME, JOB_NAME, STATUS,"," TO_CHAR(START_DATE, 'YYYY-MM-DD HH24:MI:SS') as START_DATE,"," TO_CHAR(END_DATE, 'YYYY-MM-DD HH24:MI:SS') as END_DATE"," FROM USER_CLOUD_PIPELINE_HISTORY"," ORDER BY START_DATE DESC","\"\"\")","","z.show(result)"],"enabled":true,"result":{"startTime":1760326858331,"interpreter":"python.low","endTime":1760326858720,"results":[{"message":"PIPELINE_NAME\tJOB_NAME\tSTATUS\tSTART_DATE\tEND_DATE\nMY_VECTOR_INDEX2$VECPIPELINE\tPIPELINE$29\tSUCCEEDED\t2025-10-13 03:40:40\t2025-10-13 03:40:56\nMY_VECTOR_INDEX3$VECPIPELINE\tPIPELINE$28\tSUCCEEDED\t2025-10-13 03:36:27\t2025-10-13 03:36:43\nMY_VECTOR_INDEX$VECPIPELINE\tPIPELINE$19\tSUCCEEDED\t2025-10-12 17:48:37\t2025-10-12 17:48:38\nSALES_AGENT_VECTOR_INDEX2$VECPIPELINE\tPIPELINE$17\tSUCCEEDED\t2025-10-12 15:44:41\t2025-10-12 15:44:41\nMY_VECTOR_INDEX$VECPIPELINE\tPIPELINE$19\tSUCCEEDED\t2025-10-11 17:48:37\t2025-10-11 17:48:38\nSALES_AGENT_VECTOR_INDEX2$VECPIPELINE\tPIPELINE$17\tSUCCEEDED\t2025-10-11 15:44:41\t2025-10-11 15:44:41\nMY_VECTOR_INDEX$VECPIPELINE\tPIPELINE$19\tSUCCEEDED\t2025-10-10 17:48:48\t2025-10-10 17:48:49\nMY_VECTOR_INDEX$VECPIPELINE\tPIPELINE$19\tSUCCEEDED\t2025-10-10 17:48:32\t2025-10-10 17:48:48\nSALES_AGENT_VECTOR_INDEX2$VECPIPELINE\tPIPELINE$17\tSUCCEEDED\t2025-10-10 15:44:41\t2025-10-10 15:44:41\nSALES_AGENT_VECTOR_INDEX2$VECPIPELINE\tPIPELINE$17\tSUCCEEDED\t2025-10-09 15:44:41\t2025-10-09 15:44:41\nSALES_AGENT_VECTOR_INDEX2$VECPIPELINE\tPIPELINE$17\tSUCCEEDED\t2025-10-09 15:44:36\t2025-10-09 15:44:40\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"table","title":"Get the table name for the vector index","message":["%python","","result = oml.sync(query = \"\"\""," SELECT INDEX_NAME, INDEX_TYPE, INDEX_SUBTYPE, TABLE_NAME, STATUS "," FROM USER_INDEXES "," WHERE INDEX_NAME = 'MY_VECTOR_INDEX2'","\"\"\")","","z.show(result)"],"enabled":true,"result":{"startTime":1760326859098,"interpreter":"python.low","endTime":1760326859518,"results":[{"message":"INDEX_NAME\tINDEX_TYPE\tINDEX_SUBTYPE\tTABLE_NAME\tSTATUS\nMY_VECTOR_INDEX2\tVECTOR\tNEIGHBOR_PARTITIONS_IVF\tMY_VECTOR_INDEX2$VECTAB\tVALID\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"raw","title":"View the contents of the vector index table","message":["%python","","cursor = oml.cursor()","","cursor.execute(\"\"\""," SELECT CONTENT, ATTRIBUTES, EMBEDDING "," FROM MY_VECTOR_INDEX2$VECTAB"," FETCH FIRST 4 ROWS ONLY","\"\"\")","","print(f\"{'CONTENT':<50} | {'ATTRIBUTES':<30} | {'EMBEDDING'}\")","print(\"-\" * 140)","","for row in cursor:"," content = str(row[0])[:50]"," attributes = str(row[1])[:50]"," embedding = str(row[2])[:50] + \"...\""," print(f\"{content:<50} | {attributes:<30} | {embedding}\")"],"enabled":true,"result":{"startTime":1760326859899,"interpreter":"python.low","endTime":1760326860285,"results":[{"message":"CONTENT | ATTRIBUTES | EMBEDDING\n--------------------------------------------------------------------------------------------------------------------------------------------\nExploit Data Parallelism for R Scalability using O | {'object_name': 'Exploit-Data-Parallelism-for-R-Sc | [-0.0217437744, -0.0344543457, -0.0510559082, -0.0...\nata using what\u2019s called \u201cdata parallelism.\u201d We\u2019ll | {'object_name': 'Exploit-Data-Parallelism-for-R-Sc | [-0.020614624, -0.0317382812, -0.0397338867, -0.04...\n6 Simple Tips for Better Text-to-SQL Generation us | {'object_name': '6 Simple Tips for Better Text-to- | [-0.0444335938, -0.0311431885, -0.0225982666, -0.0...\nAnnouncing Select AI with Azure OpenAI Service on | {'object_name': 'Announcing-Select-AI-with-Azure-O | [-0.022277832, -0.0423583984, -0.0126876831, -0.01...\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Create a profile proxy object for the current session","","Create a profile proxy object that contains configuration settings for connecting to the LLM service and using your vector index. ","The profile determines which AI provider and AI Models are used, authentication details, vector store configuration, and other parameters."],"enabled":true,"result":{"startTime":1760326860676,"interpreter":"md.low","endTime":1760326861010,"results":[{"message":"<h3 id=\"create-a-profile-proxy-object-for-the-current-session\">Create a profile proxy object for the current session<\/h3>\n<p>Create a profile proxy object that contains configuration settings for connecting to the LLM service and using your vector index.\nThe profile determines which AI provider and AI Models are used, authentication details, vector store configuration, and other parameters.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Create a profile proxy object for the current session","message":["%python","","profile = select_ai.Profile(profile_name = \"OCI_GENAI_RAG_PY_DEMO\")"],"enabled":true,"result":{"startTime":1760326861389,"interpreter":"python.low","endTime":1760326861755,"results":[],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Query data using Select AI RAG ","","These examples demonstrate how to get LLM responses enhanced by your documents using Select AI RAG. ","","The \"narrate\" action provides a text response based on data retrieved using your vector index.","","The \"runsql\" action lists the individul text chunks, documents file names, URLs, relevance scores, and start and end offsets."],"enabled":true,"result":{"startTime":1760326862134,"interpreter":"md.low","endTime":1760326862459,"results":[{"message":"<h3 id=\"query-data-using-select-ai-rag\">Query data using Select AI RAG<\/h3>\n<p>These examples demonstrate how to get LLM responses enhanced by your documents using Select AI RAG.<\/p>\n<p>The "narrate" action provides a text response based on data retrieved using your vector index.<\/p>\n<p>The "runsql" action lists the individul text chunks, documents file names, URLs, relevance scores, and start and end offsets.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"What type of monitoring is enabled in Oracle Machine Learning","message":["%python","","response = profile.narrate(prompt = \"What type of monitoring is enabled in Oracle Machine Learning\")","","formatted = response.replace('\\\\n', '\\n')","print(formatted)"],"enabled":true,"result":{"startTime":1760326862844,"interpreter":"python.low","endTime":1760326867822,"results":[{"message":"Oracle Machine Learning (OML) provides several types of monitoring, including data monitoring and model monitoring. Data monitoring is a feature that allows users to track changes in their data over time, detecting issues such as data drift. Model monitoring, on the other hand, provides information on the quality of machine learning models, alerting users to potential performance degradation. Both data and model monitoring are available on Oracle Autonomous Database, with user interfaces available for ease of use.\n\nSources:\n - Announcing-OML-Monitoring-on-Autonomous-Database.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing-OML-Monitoring-on-Autonomous-Database.txt, offsets [1:450])\n - Announcing-OML-Data-Monitoring-User-Interface-on-Autonomous-Database.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing-OML-Data-Monitoring-User-Interface-on-Autonomous-Database.txt, offsets [1:450])\n - Simplify-your-model-monitoring-and-MLOps-with-OML-Model-Monitoring-UI.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Simplify-your-model-monitoring-and-MLOps-with-OML-Model-Monitoring-UI.txt, offsets [1:450])\n - Data-Monitoring-with-Oracle-Machine-Learning-Services.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Data-Monitoring-with-Oracle-Machine-Learning-Services.txt, offsets [1601:2050])\n - Model-Monitoring-with-Oracle-Machine-Learning-Services.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Model-Monitoring-with-Oracle-Machine-Learning-Services.txt, offsets [1:450])\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"table","title":"Use 'runsql' for the same prompt","message":["%python","","result = profile.run_sql(prompt = \"What type of monitoring is enabled in Oracle Machine Learning\")","z.show(result)"],"enabled":true,"result":{"startTime":1760326868198,"interpreter":"python.low","endTime":1760326868696,"results":[{"message":"data\tsource\turl\tscore\tstart_offset\tend_offset\nAnnouncing OML Monitoring on Autonomous Database February 26, 2023 | 4 minute read Mark Hornick Senior Director, Data Science and Machine Learning We are pleased to announce the availability of Oracle Machine Learning (OML) Monitoring as part of OML Services on Oracle Autonomous Database. With OML Monitoring, you can be alerted to issues in both data and native in-database model quality. In data-driven enterprises, you need to know if there\tAnnouncing-OML-Monitoring-on-Autonomous-Database.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing-OML-Monitoring-on-Autonomous-Database.txt\t0.74\t1\t450\nAnnouncing OML Data Monitoring User Interface on Autonomous Database August 7, 2023 | 6 minute read Mark Hornick Senior Director, Data Science and Machine Learning We are pleased to announce the availability of Oracle Machine Learning Data Monitoring User Interface on Oracle Autonomous Database. OML Data Monitoring UI is a no-code user interface that provides insight into how your enterprise data evolves over time. Data monitoring is a powe\tAnnouncing-OML-Data-Monitoring-User-Interface-on-Autonomous-Database.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing-OML-Data-Monitoring-User-Interface-on-Autonomous-Database.txt\t0.71\t1\t450\nSimplify your model monitoring and MLOps with OML Model Monitoring UI February 13, 2024 | 8 minute read Mark Hornick Senior Director, Data Science and Machine Learning Announcing Oracle Machine Learning Model Monitoring UI\u2014an easy-to-use no-code user interface on Oracle Autonomous Database that helps you maintain the accuracy of your models and the effectiveness of your applications. OML Model Monitoring UI makes getting started simple so y\tSimplify-your-model-monitoring-and-MLOps-with-OML-Model-Monitoring-UI.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Simplify-your-model-monitoring-and-MLOps-with-OML-Model-Monitoring-UI.txt\t0.7\t1\t450\n Graph How does OML Services record data drift? Luckily for Oracle Machine Learning users, data monitoring is a new feature available through Oracle Machine Learning Services. So how exactly does this new feature calculate data drift? It does so by comparing a baseline dataset to new data. The data monitoring algorithm creates a machine learning model to try and identify differences between the baseline and new data. The amount of drift that \tData-Monitoring-with-Oracle-Machine-Learning-Services.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Data-Monitoring-with-Oracle-Machine-Learning-Services.txt\t0.69\t1601\t2050\nd is the definition of an attractive borrower, so concept drift has occurred in this case. How does Oracle Machine Learning Services record model drift? Fortunately, users of Oracle Machine Learning (OML) can now access model monitoring via the OML Services REST interface, specifically for classification and regression models. So how does this new feature track a model for potential degradation? It does so by comparing the quality of pr\tModel-Monitoring-with-Oracle-Machine-Learning-Services.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Model-Monitoring-with-Oracle-Machine-Learning-Services.txt\t0.68\t3201\t3650\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","#### Use GENERATE for dynamic action selection","","The `generate()` method handles different Select AI actions specified as an argument. Additional parameters like conversation IDs can be passed for context-aware ","conversations. ","","The examples demonstrate using generate with different actions: 'showsql' to get SQL statements, 'runsql' to run queries, ","'explainsql' to obtain query explanations, and 'narrate' to provide a natural language interpretation of the query result."],"enabled":true,"result":{"startTime":1760326869068,"interpreter":"md.low","endTime":1760326869398,"results":[{"message":"<h4 id=\"use-generate-for-dynamic-action-selection\">Use GENERATE for dynamic action selection<\/h4>\n<p>The <code>generate()<\/code> method handles different Select AI actions specified as an argument. Additional parameters like conversation IDs can be passed for context-aware\nconversations.<\/p>\n<p>The examples demonstrate using generate with different actions: 'showsql' to get SQL statements, 'runsql' to run queries,\n'explainsql' to obtain query explanations, and 'narrate' to provide a natural language interpretation of the query result.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":" Use 'narrate' to create a learning path for Select AI","message":["%python","","learning_prompt = \"\"\"Create a 5 step learning path for a customer who wants to "," leverage Select AI in their Autonomous Database environment. "," The learning path should:"," Start with fundamental concepts and prerequisites for Select AI"," Focus on natural language to SQL, chat, RAG, and synthetic data generation"," Recommend specific blog posts, documentation, or training for each topic\"\"\"","","response = profile.narrate(prompt = learning_prompt)","print(response)"],"enabled":true,"result":{"startTime":1760326869778,"interpreter":"python.low","endTime":1760326875957,"results":[{"message":"To create a 5-step learning path for leveraging Select AI in an Autonomous Database environment, follow these steps:\n\n1. **Introduction to Select AI and Prerequisites**: Start by understanding the fundamental concepts of Select AI and its prerequisites. The blog post \"Introducing Select AI - Natural Language to SQL Generation on Autonomous Database\" provides an excellent introduction to the capabilities and benefits of using Select AI. This step lays the groundwork for further learning.\n\n2. **Natural Language to SQL Generation**: Dive deeper into how Select AI enables natural language to SQL generation. The documentation \"Use Select AI for Natural Language Interaction with your Database\" is a valuable resource for understanding the technical aspects and implementation details. Additionally, the video \"Getting Started with Oracle Select AI\" offers a practical guide to getting started.\n\n3. **Chat and Retrieval Augmented Generation (RAG)**: Explore the chat and RAG features of Select AI. The blog post \"Select AI Enhances Text-to-SQL Support\" discusses the enhancements and capabilities in these areas. Furthermore, \"Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers\" provides insights into the advanced features of RAG.\n\n4. **Synthetic Data Generation and Other Use Cases**: Learn about synthetic data generation and other use cases supported by Select AI. The LiveLab \"Chat with Your Data in Autonomous Database Using Generative AI\" offers hands-on experience with using Select AI for various applications. Additionally, \"Supercharge SQL: Unleashing AI Queries with Oracle Autonomous Database Select AI\" discusses building AI-enabled applications, including those involving synthetic data generation.\n\n5. **Practical Implementation and Development**: Finally, focus on practical implementation and development using Select AI. The LiveLab \"Develop apps using GenAI, Autonomous\" provides a hands-on environment to develop applications leveraging Select AI. The \"DBMS_CLOUD_AI package\" documentation is also essential for understanding the technical details required for implementation.\n\nSources:\n - Introducing-Select-AI-Natural-Language-to-SQL-Generation-on-Autonomous-Database.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Introducing-Select-AI-Natural-Language-to-SQL-Generation-on-Autonomous-Database.txt, offsets [1:450])\n - Select AI Enhances Text-to-SQL Support.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Enhances Text-to-SQL Support.txt, offsets [1:450])\n - Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt, offsets [7601:8050])\n - Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt, offsets [401:850])\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"table","title":"Use 'runsql' for the same prompt","message":["%python","","learning_prompt = \"\"\"Create a 5 step learning path for a customer who wants to "," leverage Select AI in their Autonomous Database environment. "," The learning path should:"," Start with fundamental concepts and prerequisites for Select AI"," Focus on natural language to SQL, chat, RAG, and synthetic data generation"," Recommend specific blog posts, documentation, or training for each topic\"\"\"","","result = profile.run_sql(prompt = learning_prompt)","z.show(result)"],"enabled":true,"result":{"startTime":1760326876337,"interpreter":"python.low","endTime":1760326876839,"results":[{"message":"data\tsource\turl\tscore\tstart_offset\tend_offset\n Documentation: Use Select AI for Natural Language Interaction with your Database Documentation: DBMS_CLOUD_AI package Video: Getting Started with Oracle Select AI Blog: Now Available! Pre-built Embedding Generation model for Oracle Database 23ai Blog: Enhance your AI/ML applications with flexible Bring Your Own Model options LiveLab: Chat with Your Data in Autonomous Database Using Generative AI LiveLab: Develop apps using GenAI, Autonomo\tSelect AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\t0.65\t7601\t8050\nIntroducing Select AI - Natural Language to SQL Generation on Autonomous Database September 19, 2023 | 9 minute read Mark Hornick Senior Director, Data Science and Machine Learning Introducing Autonomous Database Select AI - enabling you to query your data using natural language. Combining generative AI large language models (LLMs) with Oracle SQL empowers you to describe what you want - declarative intent - and let the database generate th\tIntroducing-Select-AI-Natural-Language-to-SQL-Generation-on-Autonomous-Database.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Introducing-Select-AI-Natural-Language-to-SQL-Generation-on-Autonomous-Database.txt\t0.64\t1\t450\nSelect AI Enhances Text-to-SQL Support May 20, 2025 | 5 minute read Mark Hornick Senior Director, Machine Learning and AI Product Management Oracle Autonomous Database Select AI simplifies and automates the use of generative AI enabling generating, running, and explaining SQL from a natural language prompt and chatting with your LLM. Select AI also automates vector index creation, simplifies the retrieval-augmented generation (RAG) workflow\tSelect AI Enhances Text-to-SQL Support.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Enhances Text-to-SQL Support.txt\t0.62\t1\t450\ns Select AI Enhances Text-to-SQL Support 6 Simple Tips for Better Text-to-SQL Generation using Oracle Autonomous Database Select AI Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers Documentation Use Select AI for Natural Language Interaction with your Database DBMS_CLOUD_AI package LiveLabs Chat with Your Data in Autonomous Database Using Generative AI Develop apps using GenAI, Autonomous \tSupercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\t0.61\t13601\t14050\n build AI-enabled applications supporting many use cases involving natural language-to-SQL query generation, retrieval augmented generation (RAG), synthetic data generation, sentiment analysis, text summarization, or content generation, among others. Select AI automates the orchestration of various specialized tools \u2013 whether from Oracle or third parties. One of the lesser-known use cases, however, is using Select AI right within your SQL que\tSupercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\t0.61\t401\t850\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","### Using an in-database transformer","","So far, we've been using the cloud-based transformer (embedding model) through OCI GenAI Services. ","Oracle Autonomous Database also offers the ability to use in-database transformers for generating vector embeddings in the database.","","In the following section, we'll explore how to use an in-database transformer.","","The `profile.set_attribute()` method's `embedding_model` parameter allows you to specify your desired text embedding model. Oracle provides several pre-built ONNX transformer models that have been augmented through a specialized pipeline:","","**Text Embedding Models:**","- `ALL_MINILM_L12_V2` - Optimized for English language content with faster processing and compact 384-dimensional embeddings","- `MULTILINGUAL_E5_SMALL` - Supports over 100 languages with 384-dimensional embeddings, ideal for multilingual applications","","**Multimodal CLIP Models:**","- `CLIP_VIT_BASE_PATCH32_IMG` - CLIP model for image embeddings (512 dimensions)","- `CLIP_VIT_BASE_PATCH32_TXT` - CLIP model for text embeddings (512 dimensions)","","Each transformer offers different capabilities and vector dimensions. You can switch the active embedding model by updating the profile with `profile.set_attribute()`, as demonstrated below. In this example, we use the `MULTILINGUAL_E5_SMALL` model to leverage its multilingual capabilities. The same embedding model must be used consistently when creating the vector index and vectorizing the user prompt.","","> Note: Refer to the Select AI Prerequisites and Setup notebook to load these transformer models to the database.","","For additional information on these models, refer to these blogs:","","<a href=\"https://blogs.oracle.com/machinelearning/post/use-our-prebuilt-onnx-model-now-available-for-embedding-generation-in-oracle-database-23ai\" target=\"_blank\">Prebuilt ONNX Models for Embedding Generation<\/a>","<br>","<a href=\"https://blogs.oracle.com/machinelearning/post/enhance-your-semantic-similarity-search-with-multilingual-support\" target=\"_blank\">Multilingual Support for Semantic Similarity Search<\/a>"],"enabled":true,"result":{"startTime":1760326877234,"interpreter":"md.low","endTime":1760326877568,"results":[{"message":"<h3 id=\"using-an-in-database-transformer\">Using an in-database transformer<\/h3>\n<p>So far, we've been using the cloud-based transformer (embedding model) through OCI GenAI Services.\nOracle Autonomous Database also offers the ability to use in-database transformers for generating vector embeddings in the database.<\/p>\n<p>In the following section, we'll explore how to use an in-database transformer.<\/p>\n<p>The <code>profile.set_attribute()<\/code> method's <code>embedding_model<\/code> parameter allows you to specify your desired text embedding model. Oracle provides several pre-built ONNX transformer models that have been augmented through a specialized pipeline:<\/p>\n<p><strong>Text Embedding Models:<\/strong><\/p>\n<ul>\n<li><code>ALL_MINILM_L12_V2<\/code> - Optimized for English language content with faster processing and compact 384-dimensional embeddings<\/li>\n<li><code>MULTILINGUAL_E5_SMALL<\/code> - Supports over 100 languages with 384-dimensional embeddings, ideal for multilingual applications<\/li>\n<\/ul>\n<p><strong>Multimodal CLIP Models:<\/strong><\/p>\n<ul>\n<li><code>CLIP_VIT_BASE_PATCH32_IMG<\/code> - CLIP model for image embeddings (512 dimensions)<\/li>\n<li><code>CLIP_VIT_BASE_PATCH32_TXT<\/code> - CLIP model for text embeddings (512 dimensions)<\/li>\n<\/ul>\n<p>Each transformer offers different capabilities and vector dimensions. You can switch the active embedding model by updating the profile with <code>profile.set_attribute()<\/code>, as demonstrated below. In this example, we use the <code>MULTILINGUAL_E5_SMALL<\/code> model to leverage its multilingual capabilities. The same embedding model must be used consistently when creating the vector index and vectorizing the user prompt.<\/p>\n<blockquote>\n<p>Note: Refer to the Select AI Prerequisites and Setup notebook to load these transformer models to the database.<\/p>\n<\/blockquote>\n<p>For additional information on these models, refer to these blogs:<\/p>\n<p><a href=\"https://blogs.oracle.com/machinelearning/post/use-our-prebuilt-onnx-model-now-available-for-embedding-generation-in-oracle-database-23ai\" target=\"_blank\">Prebuilt ONNX Models for Embedding Generation<\/a>\n<br>\n<a href=\"https://blogs.oracle.com/machinelearning/post/enhance-your-semantic-similarity-search-with-multilingual-support\" target=\"_blank\">Multilingual Support for Semantic Similarity Search<\/a><\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Create a vector index using the in-database transformer","","Having configured our AI profile `IN_DB_TRANSFORMER_RAG_DEMO` to use the `MULTILINGUAL_E5_SMALL` embedding model, we'll create a new vector index (`MY_VECTOR_INDEX2`). ","A new index is required because each embedding model creates unique vector representations. ","","This new vector index will use the same source data and chunking parameters as before, but will generate embeddings using the in-database transformer model."],"enabled":true,"result":{"startTime":1760326877952,"interpreter":"md.low","endTime":1760326878327,"results":[{"message":"<h3 id=\"create-a-vector-index-using-the-in-database-transformer\">Create a vector index using the in-database transformer<\/h3>\n<p>Having configured our AI profile <code>IN_DB_TRANSFORMER_RAG_DEMO<\/code> to use the <code>MULTILINGUAL_E5_SMALL<\/code> embedding model, we'll create a new vector index (<code>MY_VECTOR_INDEX2<\/code>).\nA new index is required because each embedding model creates unique vector representations.<\/p>\n<p>This new vector index will use the same source data and chunking parameters as before, but will generate embeddings using the in-database transformer model.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Create the vector index on the same blogs using the in-database transformer","message":["%python","","vector_index_attributes2 = select_ai.OracleVectorIndexAttributes("," location = \"https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/\","," object_storage_credential_name = \"OCI_CRED2\","," vector_distance_metric = select_ai.VectorDistanceMetric.COSINE,"," chunk_overlap = 50,"," chunk_size = 450)","","vector_index2 = select_ai.VectorIndex("," index_name = \"MY_VECTOR_INDEX3\","," attributes = vector_index_attributes2,"," description = \"Vector index for Oracle Machine Learning and Select AI blogs\","," profile = profile)","","try:"," vector_index2.delete(include_data = True, force = True)","except:"," pass","","vector_index2.create()","print(\"Vector index created: \" + vector_index2.index_name)"],"enabled":true,"result":{"startTime":1760326878714,"interpreter":"python.low","endTime":1760326880986,"results":[{"message":"Vector index created: MY_VECTOR_INDEX3\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Pause for 5 seconds for pipeline job to start","message":["%python","","time.sleep(5)"],"enabled":true,"result":{"startTime":1760326881362,"interpreter":"python.low","endTime":1760326886730,"results":[],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Check on running pipeline","message":["%python","","result = oml.sync(query = \"\"\""," SELECT job_name, job_style, session_id, elapsed_time, log_id"," FROM USER_SCHEDULER_RUNNING_JOBS","\"\"\")","","if result.shape[0] == 0:"," print(\"Pipeline has completed - no running jobs found.\")","else:"," z.show(result)"],"enabled":true,"result":{"startTime":1760326887098,"interpreter":"python.low","endTime":1760326887740,"results":[{"message":"JOB_NAME\tJOB_STYLE\tSESSION_ID\tELAPSED_TIME\tLOG_ID\nPIPELINE$30\tREGULAR\t40134\t0 days 00:00:01.871444\t92164\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Pause for 5 seconds for vector index table creation","message":["%python","","time.sleep(5)"],"enabled":true,"result":{"startTime":1760326888115,"interpreter":"python.low","endTime":1760326893490,"results":[],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Create a view MY_VECTOR_INDEX_STATUS_VIEW2 with the status results","message":["%python","","index_name = 'MY_VECTOR_INDEX3'","","# Use oml.sync for the query","result = oml.sync(query = f\"\"\""," SELECT pipeline_name, status_table"," FROM user_cloud_pipelines"," WHERE pipeline_name = '{index_name}$VECPIPELINE'","\"\"\")","","if result.shape[0] > 0:"," # Get first row from DataFrame"," row = result.pull().iloc[0]"," pipeline_name = row['PIPELINE_NAME']"," table_name = row['STATUS_TABLE']"," "," print(\"Pipeline Name: \" + pipeline_name)"," print(\"Status Table: \" + table_name)"," "," # Still need cursor for DDL"," cursor = oml.cursor()"," cursor.execute(f\"CREATE OR REPLACE VIEW MY_VECTOR_INDEX_STATUS_VIEW2 AS SELECT name, status, error_message FROM {table_name}\")"," cursor.execute('commit')"," print(\"View created\")"],"enabled":true,"result":{"startTime":1760326893864,"interpreter":"python.low","endTime":1760326894243,"results":[{"message":"Pipeline Name: MY_VECTOR_INDEX3$VECPIPELINE\nStatus Table: PIPELINE$30$257_STATUS\nView created\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"table","title":"View the status of processed files for vector indexing","message":["%python","","result = oml.sync(query = \"SELECT * FROM MY_VECTOR_INDEX_STATUS_VIEW2\")","","z.show(result)"],"enabled":true,"result":{"startTime":1760326894631,"interpreter":"python.low","endTime":1760326895048,"results":[{"message":"NAME\tSTATUS\tERROR_MESSAGE\n6 Simple Tips for Better Text-to-SQL Generation.txt\tCOMPLETED\tNone\nADB-Select-AI-Accelerate-innovation-with-enterprise-data-OCI-GenerativeAIand-enhanced-security.txt\tCOMPLETED\tNone\nAnnouncing Additional AI Providers for Oracle Autonomous Database Select AI.txt\tCOMPLETED\tNone\nAnnouncing Oracle Machine Learning for Python 2.1.txt\tCOMPLETED\tNone\nAnnouncing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\tCOMPLETED\tNone\nAnnouncing-New-Oracle-Machine-Learning-Features-in-Oracle-Databas-23ai.txt\t2\tNone\nAnnouncing-OML-Data-Monitoring-User-Interface-on-Autonomous-Database.txt\tPENDING\tNone\nAnnouncing-OML-Monitoring-on-Autonomous-Database.txt\tPENDING\tNone\nAnnouncing-OML-Services-Batch-Scoring-on-Autonomous-Database.txt\tPENDING\tNone\nAnnouncing-Select-AI-with-Azure-OpenAI-Service-on-Oracle-Autonomous-Database.txt\tCOMPLETED\tNone\nAnnouncing-custom-third-party-Python-and-R-packages-for-use-on-Autonomous-Database.txt\tCOMPLETED\tNone\nAnnouncing-next-generation-OML-Notebooks-on-Oracle-Autonomous-Database.txt\tCOMPLETED\tNone\nAnnouncing-the-release-of-Oracle-Machine-Learning-for-Python-2.0-on-Autonomous-Database.txt\tCOMPLETED\tNone\nApproaches-to-detect-potential-fraud.txt\tCOMPLETED\tNone\nBoost-your-R-to-database-connectivity-using-ROracle.txt\t2\tNone\nData-Driven-Decision-making-for-Debt-Collection.txt\tPENDING\tNone\nData-Monitoring-with-Oracle-Machine-Learning-Services.txt\tPENDING\tNone\nDevelop-and-deploy-machine-learning-models-using-Oracle-Autonomous-Database-Machine-Learning-and-APEX.txt\tPENDING\tNone\nExploit-Data-Parallelism-for-R-Scalability-using-Oracle-Machine-Learning-for-R.txt\tCOMPLETED\tNone\nHow-to-perform-in-database-text-analytics-using-a-pre-built-ML-model.txt\tCOMPLETED\tNone\nICYMI-Embedding-AI-ML-in-your-application-using-Oracle-Machine-Learning.txt\tCOMPLETED\tNone\nICYMI-Learn-How-to-Invoke-Your-Python-Functions-from-SQL-with-OML4Py.txt\tCOMPLETED\tNone\nIntroducing-Select-AI-Natural-Language-to-SQL-Generation-on-Autonomous-Database.txt\tCOMPLETED\tNone\nManage-your-models-with-Oracle-Machine-Learning-on-Autonomous-Database.txt\t2\tNone\nModel-Monitoring-with-Oracle-Machine-Learning-Services.txt\tPENDING\tNone\nNow-Available-Pre-built-Embedding-Generation-model-for-Oracle-Database-23ai.txt\tPENDING\tNone\nOML-AutoML-UI-click-your-way-to-an-ML-model.txt\tPENDING\tNone\nOML4Py-Leveraging-ONNX-and-Hugging-Face-for-AI-Vector-Search.txt\tCOMPLETED\tNone\nOracleMachine-Learning-for-R-2.0-now-available-for-Oracle-Database.txt\tCOMPLETED\tNone\nSelect AI Enhances Text-to-SQL Support.txt\tCOMPLETED\tNone\nSelect AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\tCOMPLETED\tNone\nSimplify-your-model-monitoring-and-MLOps-with-OML-Model-Monitoring-UI.txt\tCOMPLETED\tNone\nStoring-Named-R-and-Python-Functions-in-the-Oracle-Machine-Learning-Script-Repository.txt\t2\tNone\nSupercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\tPENDING\tNone\nTop-10-Reasons-to-use-Machine-Learning-in-Oracle-Database.txt\tPENDING\tNone\nUsing-Machine-Learning-for-Smart-Investment.txt\tPENDING\tNone\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Create a profile proxy object for the current session","message":["%python","","profile2 = select_ai.Profile(profile_name = \"IN_DB_TRANSFORMER_RAG_DEMO\")"],"enabled":true,"result":{"startTime":1760326895434,"interpreter":"python.low","endTime":1760326895801,"results":[],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Verify the profile is using the in-database transformer","message":["%python","","attributes = profile2.get_attributes()","print(\"Profile:\", profile2.profile_name)","print(\"Transformer:\", attributes.provider.embedding_model)","print(\"Vector Index:\", attributes.vector_index_name)"],"enabled":true,"result":{"startTime":1760326896169,"interpreter":"python.low","endTime":1760326896529,"results":[{"message":"Profile: IN_DB_TRANSFORMER_RAG_DEMO\nTransformer: database:MULTILINGUAL_E5_SMALL\nVector Index: MY_VECTOR_INDEX3\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"What are the benefits of using Select AI","message":["%python","","response = profile2.narrate(prompt = \"what are the benefits of using Select AI\")","","formatted = response.replace('\\\\n', '\\n')","print(formatted)"],"enabled":true,"result":{"startTime":1760326896917,"interpreter":"python.low","endTime":1760326911898,"results":[{"message":"The benefits of using Select AI include democratizing data access, removing barriers to using enterprise data, and providing more relevant results. Select AI allows users to access and query corporate data stores using natural language, rather than relying on SQL experts. This helps to produce more accurate and relevant responses when provided with sufficient context from enterprise data. Additionally, Select AI with Retrieval Augmented Generation (RAG) makes it easy to use LLMs with semantic similarity search to generate responses based on private data using natural language prompts, while helping to reduce the risk of hallucination.\n\nSources:\n - Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt, offsets [12401:12850])\n - Announcing-Select-AI-with-Azure-OpenAI-Service-on-Oracle-Autonomous-Database.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing-Select-AI-with-Azure-OpenAI-Service-on-Oracle-Autonomous-Database.txt, offsets [401:850])\n - Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt, offsets [6001:6450])\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"table","title":"Use runsql for the same prompt","message":["%python","","result = profile2.run_sql(prompt = \"what are the benefits of using Select AI\")","z.show(result)"],"enabled":true,"result":{"startTime":1760326912303,"interpreter":"python.low","endTime":1760326912849,"results":[{"message":"data\tsource\turl\tscore\tstart_offset\tend_offset\name. Key benefits Select AI RAG offers the following benefits: Democratize data access: Remove barriers to using enterprise data. Instead of relying on SQL experts to access and query corporate data stores, simply provide questions in natural language and leverage powerful vector search. More relevant results: LLMs can produce more accurate and relevant responses when provided with sufficient context from enterprise data. This helps to re\tAnnouncing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\t0.71\t12401\t12850\ng Oracle CloudWorld \u201923, Select AI makes it easy to query your data using natural language. Check out the blog Autonomous Database speaks \"human\" to see how it's done. Select AI with Azure OpenAI Service We're excited to announce that you can now use Select AI with Azure OpenAI Service. Not only do you get access to the latest OpenAI models hosted on Azure, but this new integration is a great step toward improving data governance. Through ou\tAnnouncing-Select-AI-with-Azure-OpenAI-Service-on-Oracle-Autonomous-Database.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing-Select-AI-with-Azure-OpenAI-Service-on-Oracle-Autonomous-Database.txt\t0.67\t401\t850\n Select AI is natively integrated into the Oracle Database engine, giving unparalleled access to database metadata, object definitions, and user privileges, allowing for more accurate, secure, and context-aware SQL generation. Security that is built-In, not bolted on: Unlike external solutions, Select AI fully leverages Oracle Database\u2019s security model and natively supports auditing, privilege enforcement, rate limiting, and row-level security\tSupercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\t0.66\t12001\t12450\nin Oracle Cloud Storage. Why use Select AI RAG? Select AI RAG makes it easy to use LLMs with semantic similarity search to generate responses based on your private data using natural language prompts. With Select AI RAG, you can get more relevant responses based on up-to-date information, while helping to reduce the risk of hallucination. By leveraging Select AI with RAG to augment your prompt with your enterprise data, you can bridge the\tSelect AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\t0.63\t6001\t6450\nAnnouncing Select AI with Azure OpenAI Service on Oracle Autonomous Database November 10, 2023 | 6 minute read Mark Hornick Senior Director, Data Science and Machine Learning With the constantly evolving AI landscape, how are you keeping pace with advances in AI? Addressing that problem was one of the key requirements when we designed Select AI for Autonomous Database. As introduced during Oracle CloudWorld \u201923, Select AI makes it easy t\tAnnouncing-Select-AI-with-Azure-OpenAI-Service-on-Oracle-Autonomous-Database.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing-Select-AI-with-Azure-OpenAI-Service-on-Oracle-Autonomous-Database.txt\t0.63\t1\t450\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Use 'narrate' for the same prompt in Italian","message":["%python","","response = profile2.narrate(prompt = \"quali sono i vantaggi dell utilizzo Select AI\")","","formatted = response.replace('\\\\n', '\\n')","print(formatted)"],"enabled":true,"result":{"startTime":1760326913231,"interpreter":"python.low","endTime":1760326929619,"results":[{"message":"I vantaggi dell'utilizzo di Select AI includono la possibilit? di utilizzare l'intelligenza artificiale generativa da una vasta gamma di provider di AI di terze parti direttamente dal database, la gestione della sicurezza e della conformit? grazie all'integrazione nativa con il motore del database Oracle, e la possibilit? di costruire applicazioni abilitate all'AI in modo rapido e semplice. Inoltre, Select AI consente di accedere e interrogare i dati aziendali utilizzando il linguaggio naturale, rimuovendo le barriere all'uso dei dati aziendali e producendo risultati pi? pertinenti. \n\nSources:\n - Select AI Enhances Text-to-SQL Support.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Enhances Text-to-SQL Support.txt, offsets [6001:6450])\n - Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt, offsets [4001:4450])\n - Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt, offsets [12401:12850])\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"table","title":"Use 'runsql' for the same prompt in Italian","message":["%python","","response = profile2.run_sql(prompt = \"quali sono i vantaggi dell utilizzo Select AI\")","","z.show(response)"],"enabled":true,"result":{"startTime":1760326930002,"interpreter":"python.low","endTime":1760326930558,"results":[{"message":"data\tsource\turl\tscore\tstart_offset\tend_offset\nmetadata. Select AI automatically builds and maintains a vector index in the background using the metadata for all the applicable objects in your schema. Using semantic similarity search, Select AI is designed to choose the most relevant objects based on the user prompt. You can enable this using the following profile attributes, where the object list can specify one or more schemas as well as specific tables. \"object_list_mode\": \"automate\tSelect AI Enhances Text-to-SQL Support.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Enhances Text-to-SQL Support.txt\t0.49\t6001\t6450\nappropriate sizes and applies the specified transformer model to produce vector embeddings. Documents can come from data sources such as Object Storage. Vector store creation An important feature of Select AI RAG is the integrated automatic update of new data from Object Storage into the vector store. As new data arrives in Object Storage, it is automatically added to the corresponding vector store and the vector index is updated. \tAnnouncing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\t0.44\t4001\t4450\nenforcement, rate limiting, and row-level security. Select AI helps you to adhere to your organization\u2019s governance and compliance standards. LLM-agnostic and enterprise-ready: Choose from a wide range of AI providers, including public LLMs like OpenAI GPT-4o, Cohere Command-A, Gemini 2.5 Pro, Claude 3.5 Sonnet, and many others. Select AI securely connects to LLMs using cloud-native service principal tokens (AWS ARN, Google Cloud IAM, Azure SPs)\tSupercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\t0.44\t12401\t12850\n Select AI is natively integrated into the Oracle Database engine, giving unparalleled access to database metadata, object definitions, and user privileges, allowing for more accurate, secure, and context-aware SQL generation. Security that is built-In, not bolted on: Unlike external solutions, Select AI fully leverages Oracle Database\u2019s security model and natively supports auditing, privilege enforcement, rate limiting, and row-level security\tSupercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\t0.44\t12001\t12450\nSupercharge SQL: Unleashing AI Queries with Oracle Autonomous Database Select AI June 20, 2025 | 10 minute read Mark Hornick Senior Director, Machine Learning and AI Product Management Oracle Autonomous Database Select AI is a powerful tool that allows you to use generative AI from a wide range of third-party AI providers\u2013 right from your database. Select AI quickly and easily enables you to build AI-enabled applications supporting many use\tSupercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\thttps://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Supercharge SQL Unleashing AI Queries with Oracle Autonomous Database Select AI.txt\t0.44\t1\t450\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","#### Use GENERATE for dynamic action selection","","The `generate()` method handles different Select AI actions specified as an argument. Additional parameters like conversation IDs can be passed for context-aware ","conversations. ","","The examples demonstrate using generate with different actions: 'chat' for direct LLM model interaction, 'runsql' to run queries, and 'narrate' to provide a natural ","language interpretation of the query result."],"enabled":true,"result":{"startTime":1760326930938,"interpreter":"md.low","endTime":1760326931276,"results":[{"message":"<h4 id=\"use-generate-for-dynamic-action-selection\">Use GENERATE for dynamic action selection<\/h4>\n<p>The <code>generate()<\/code> method handles different Select AI actions specified as an argument. Additional parameters like conversation IDs can be passed for context-aware\nconversations.<\/p>\n<p>The examples demonstrate using generate with different actions: 'chat' for direct LLM model interaction, 'runsql' to run queries, and 'narrate' to provide a natural\nlanguage interpretation of the query result.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Use GENERATE with Select AI RAG 'chat'","message":["%python","","response = profile2.generate("," prompt = \"What are the benefits of Select AI for retrieval augmented generation (RAG)?\","," action = select_ai.Action.CHAT",")","print(response)"],"enabled":true,"result":{"startTime":1760326931658,"interpreter":"python.low","endTime":1760326945038,"results":[{"message":"Select AI is a retrieval-augmented generation (RAG) model that combines the strengths of retrieval and generation to produce high-quality text. The benefits of Select AI for RAG include:\n\n1. **Improved accuracy**: By retrieving relevant information from a large database or knowledge graph, Select AI can generate more accurate and informative text, reducing the likelihood of errors or inaccuracies.\n2. **Increased context understanding**: Select AI's retrieval component allows it to better understand the context of the input prompt, enabling it to generate text that is more relevant and coherent.\n3. **Enhanced knowledge coverage**: The model's ability to retrieve information from a large database or knowledge graph enables it to cover a wider range of topics and domains, making it a more versatile and knowledgeable generator.\n4. **Reducing hallucinations**: Select AI's retrieval component helps to reduce hallucinations (i.e., generating text that is not based on actual facts or evidence) by providing a factual basis for the generated text.\n5. **Improved fluency and coherence**: The model's generation component can produce fluent and coherent text, while the retrieval component ensures that the generated text is grounded in reality and consistent with the input prompt.\n6. **Flexibility and adaptability**: Select AI can be fine-tuned for specific tasks or domains, allowing it to adapt to different applications and use cases.\n7. **Efficient use of knowledge**: The model's retrieval component enables it to efficiently use the knowledge stored in the database or knowledge graph, reducing the need for redundant or unnecessary generation.\n8. **Better handling of ambiguity and uncertainty**: Select AI's retrieval component can help to resolve ambiguities and uncertainties in the input prompt, enabling the model to generate more accurate and informative text.\n9. **Improved evaluation and feedback**: The model's retrieval component can provide a basis for evaluating and feedback on the generated text, enabling more effective assessment and improvement of the model's performance.\n10. **Potential for multimodal generation**: Select AI's architecture can be extended to support multimodal generation, enabling the model to generate text, images, or other types of media in response to input prompts.\n\nOverall, the benefits of Select AI for RAG make it a powerful tool for a wide range of natural language processing applications, including text generation, question answering, and dialogue systems.\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Use GENERATE with Select AI RAG 'narrate'","message":["%python","","response = profile2.generate("," prompt = \"What are the benefits of Select AI for retrieval augmented generation (RAG)?\","," action = select_ai.Action.NARRATE",")","print(response)"],"enabled":true,"result":{"startTime":1760326945411,"interpreter":"python.low","endTime":1760326955896,"results":[{"message":"The benefits of Select AI for retrieval augmented generation (RAG) include democratizing data access, removing barriers to using enterprise data, and producing more relevant results. Select AI RAG makes it easy to use LLMs with semantic similarity search to generate responses based on private data using natural language prompts, while helping to reduce the risk of hallucination. Additionally, Select AI RAG offers the ability to get more relevant responses based on up-to-date information.\n\nSources:\n - Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt, offsets [1:450])\n - Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt, offsets [6001:6450])\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"raw","title":"Use GENERATE with Select AI RAG 'runsql'","message":["%python","","response = profile2.generate("," prompt = \"What are the benefits of Select AI for retrieval augmented generation (RAG)?\","," action = select_ai.Action.RUNSQL",")","print(response)"],"enabled":true,"result":{"startTime":1760326956291,"interpreter":"python.low","endTime":1760326956884,"results":[{"message":"[\n {\n \"data\" : \"Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database September 10, 2024 | 10 minute read Mark Hornick Senior Director, Machine Learning and AI Product Management We\u2019re excited to introduce the availability of Select AI with support for Retrieval Augmented Generation (RAG) \u2013 making it easy to use LLMs to gain insight or generate innovative content based on your private data using natural language prompts. Wit\",\n \"source\" : \"Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\",\n \"url\" : \"https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\",\n \"score\" : 0.82,\n \"start_offset\" : 1,\n \"end_offset\" : 450\n },\n {\n \"data\" : \"ame. Key benefits Select AI RAG offers the following benefits: Democratize data access: Remove barriers to using enterprise data. Instead of relying on SQL experts to access and query corporate data stores, simply provide questions in natural language and leverage powerful vector search. More relevant results: LLMs can produce more accurate and relevant responses when provided with sufficient context from enterprise data. This helps to re\",\n \"source\" : \"Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\",\n \"url\" : \"https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt\",\n \"score\" : 0.76,\n \"start_offset\" : 12401,\n \"end_offset\" : 12850\n },\n {\n \"data\" : \"in Oracle Cloud Storage. Why use Select AI RAG? Select AI RAG makes it easy to use LLMs with semantic similarity search to generate responses based on your private data using natural language prompts. With Select AI RAG, you can get more relevant responses based on up-to-date information, while helping to reduce the risk of hallucination. By leveraging Select AI with RAG to augment your prompt with your enterprise data, you can bridge the\",\n \"source\" : \"Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\",\n \"url\" : \"https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\",\n \"score\" : 0.76,\n \"start_offset\" : 6001,\n \"end_offset\" : 6450\n },\n {\n \"data\" : \" the retrieval-augmented generation (RAG) workflow, and enables generating synthetic data. Select AI enables you to take your application and AppDev to the next level with generative AI, conveniently through SQL. We\u2019re announcing general availability for several Select AI enhancements on Autonomous Database for natural language to SQL query generation, also known as NL2SQL or text-to-SQL. These new capabilities can help improve query and resul\",\n \"source\" : \"Select AI Enhances Text-to-SQL Support.txt\",\n \"url\" : \"https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Enhances Text-to-SQL Support.txt\",\n \"score\" : 0.75,\n \"start_offset\" : 401,\n \"end_offset\" : 850\n },\n {\n \"data\" : \"Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers May 6, 2025 | 5 minute read Mark Hornick Senior Director, Machine Learning and AI Product Management Last year, we announced Select AI Retrieval Augmented Generation (RAG) for Oracle Autonomous Database, which uses Oracle Database 23ai AI Vector Search and transformers hosted by your choice of supported AI providers. Cloud-based transformers (also kno\",\n \"source\" : \"Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\",\n \"url\" : \"https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt\",\n \"score\" : 0.72,\n \"start_offset\" : 1,\n \"end_offset\" : 450\n }\n]\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"raw","title":"Use GENERATE with Select AI RAG 'narrate'","message":["%python","","response = profile2.generate("," prompt = \"How do I create a vector index in Select AI?\","," action = select_ai.Action.NARRATE",")","print(response)"],"enabled":true,"result":{"startTime":1760326957265,"interpreter":"python.low","endTime":1760326967249,"results":[{"message":"To create a vector index in Select AI, you can use the `DBMS_CLOUD_AI.CREATE_VECTOR_INDEX` procedure. This procedure takes an index name and a set of attributes, including the vector database provider, location in Object Storage, Object Storage credential name, AI profile name, vector size, distance metric, and chunk overlap and size. \n\nHere is an example of how to create a vector index:\n```sql\nBEGIN\n DBMS_CLOUD_AI.CREATE_VECTOR_INDEX(\n index_name => 'MY_VECTOR_INDEX',\n attributes => '{\"vector_db_provider\": \"oracle\", \n \"location\": \"https:.../my_namespace/my_bucket/my_data_folder\", \n \"object_storage_credential_name\": \"OCI_CRED\", \n \"profile_name\": \"OPENAI_TEXT_TRANSFORMER\", \n \"vector_dimension\": 1536, \n \"vector_distance_metric\": \"cosine\"}'\n );\nEND;\n```\n\nSources:\n - Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Announcing Select AI with Retrieval Augmented Generation (RAG) on Autonomous Database.txt, offsets [6001:6450])\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"raw","title":"Use GENERATE with Select AI RAG 'narrate'","message":["%python","","response = profile2.generate("," prompt = \"What do I need to specify in my AI profile to enable RAG?\","," action = select_ai.Action.NARRATE",")","print(response) "],"enabled":true,"result":{"startTime":1760326967638,"interpreter":"python.low","endTime":1760326974331,"results":[{"message":"To enable RAG, you need to specify the \"vector_index_name\" in your AI profile, which is the name of the index you might have created. Additionally, you can specify the \"embedding_model\" attribute to use an in-database transformer. You would also specify the \"provider\" attribute set to the AI provider hosting your model.\n\nSources:\n - Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt (https://objectstorage.ap-tokyo-1.oraclecloud.com/p/z2owElG2mSpDpE7o_W64WhaTAkcgyEE5UgFbna5zoilICjl06iHMMnCXdc1P6SVo/n/adwc4pm/b/select_ai_rag_demo_1/o/Select AI Retrieval Augmented Generation now supports in-database ONNX-format transformers.txt, offsets [1201:1650])\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### End of Script"],"enabled":true,"result":{"startTime":1760326974715,"interpreter":"md.low","endTime":1760326975042,"results":[{"message":"<h3 id=\"end-of-script\">End of Script<\/h3>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"}],"version":"7","snapshot":false,"tags":null}]