Skip to content

Commit

Permalink
Moving WMS 11777 so the team can create the screenshots and videos fo…
Browse files Browse the repository at this point in the history
…r it (#697)

* initial_create

* Updates and sandbox

* Updated Copy Blocks

* Update to copy blocks

* Adding additional workshops

* Manifest update

* fixing manifest

* Updates to md

* Updated markdowns

* Update markdown

* Updated descriptions

* Updates for ECPU change

* Updating md files

* Fixing step numbers

* Updated wget commands

* Uploading Images

* Updated images and instructions

* QA Updates

* Lint Fixes

* QA Updates

* Additional QA Updates

* Updates for dnf installs of tools

* dnf update

* Minor fixes

* New Screenshots

* Fixes to install

* Video upload

* Update for downloads.

* Removing Sharding 23c

* New Java version and download link

* Fixing wget

* java version change

* Updates to java

* Update download

* Updating java and adding the tenancy option

* OCW 23 pull request Adding logic for sql new features integration

* Fix for sysdba

* Update to current 23c Free Install

* Removing OCW23 from main workshop

* Fixing a few commands.

* Updating download servers

* Fixing ip address changes

* Update install.md

* Creating ai-vector-image directory

* Update query.md

* Main Upload

* Updated

* Updates

* Fixed underscores

* Image update

* Updating images

* New Images

* Update for optional

* Update introduction.md

* Update introduction.md

* Markdown Updates

* Update introduction.md

* Updates

* Updates

* Fixing Index

* New Marketing workshop

* Update manifest.json

* Update demo.md

* Update introduction.md

* Updates

* Update demo.md

* Updates

* Update introduction.md

* Create rag1.png

---------

Co-authored-by: Anoosha Pilli <63126232+anooshapilli@users.noreply.github.com>
  • Loading branch information
davidastart and anooshapilli authored Oct 18, 2024
1 parent fafff37 commit 2761198
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 0 deletions.
56 changes: 56 additions & 0 deletions ai-vector-rag/demo/demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Lab 1: Running a RAG Application

## Introduction
Estimated Time: 10 Minutes

### Objectives

In this lab, you will run a RAG application interactively using a user-friendly interface. You’ll be able to choose and load several PDF documents and ask your own questions using a prompt. This setup will allow you to easily interact with the RAG system and observe how it processes and generates responses in real time.

### Prerequisites
This lab assumes you have:
- All previous labs successfully completed

## Task 1: Open the Notebook Environment
This task will have you login to the Jupyter environment and run specific notebooks for this lab.

1. **If you have already logged into the Jupyter environment skip to step 5, otherwise** open "**View Login Info**" section of your workshop.

2. Copy the Jupyter Notebook Password and click the Jupyter Notebook URL.

3. Paste the Jupyter Notebook Password you copied in the previous step into the Notebook.

4. You should be within the Jupyter Notebooks landing screen.

5. In the menu at the top click on **File** then click on **New** Then click on **Terminal**
6. In the terminal copy and paste the code below
````
<copy>
cd /home/oracle
/home/oracle/run.sh
</copy>
````

7. The above commands will start a streamlit application running your Chatbot. Three URLs will appear. The last URL is the one that will allow you to connect from your browser. Click on the last URL labeled **External URL:**

## Task 2: Run the application

1. Once your application is running, simply follow the steps in the user interface.

Feel free to explore the documents with your own questions and discover how the RAG application can retrieve and provide accurate responses based on the document’s content.

You may now **proceed to the next lab**

## Learn More

- [Oracle Database 23ai Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html)

- [Oracle AI Vector Search User's Guide](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/whats-new-oracle-ai-vector-search.html)

- [Oracle AI Vector Search Blog](https://blogs.oracle.com/database/post/oracle-announces-general-availability-of-ai-vector-search-in-oracle-database-23ai)


## Acknowledgements
* **Author** - Francis Regalado, Database Product Management; David Start, Database Product Management
* **Contributors** -
* **Last Updated By/Date** - Francis Regalado, Database Product Manager October 2024
Binary file added ai-vector-rag/introduction/images/rag1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions ai-vector-rag/introduction/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# AI Vector Search - Rag applications with Oracle AI Vector Search

### **About this Workshop**


Generative artificial intelligence (AI) excels at creating text responses based on large language models (LLMs) where the AI is trained on a massive number of data points. The good news is that the generated text is often easy to read and provides detailed responses that are broadly applicable to the questions asked of the software, often called prompts.

The bad news is that the information used to generate the response is limited to the information used to train the AI, often a generalized LLM. The LLM’s data may be weeks, months, or years out of date and in a corporate AI chatbot may not include specific information about the organization’s products or services. That can lead to incorrect responses that erode confidence in the technology among customers and employees.

That’s where retrieval-augmented generation (RAG) comes in. RAG provides a way to optimize the output of an LLM with targeted information without modifying the underlying model itself; that targeted information can be more up-to-date than the LLM as well as specific to a particular organization and industry. That means the generative AI system can provide more contextually appropriate answers to prompts as well as base those answers on extremely current data.

This lab will guide you through the process of building a Retrieval Augmented Generation (RAG) application using Oracle AI Vector Search and a Generative AI model. This application will act as a flexible template that can be adapted to a wide range of use cases. Oracle Database 23AI will function as the vector data, where you'll store important context for the model to use when generating responses. This approach allows you to create a robust system that retrieves relevant data and combines it with the power of generative AI to deliver accurate, up-to-date answers based on your specific business needs. By the end of this lab, you will have:
- Stored, chunked, and vectorized data from a PDF document.
- Used a Large Language Model (LLM) to generate a precise answer to a user’s query based on relevant context stored in Oracle Database 23AI.
- See the diagram below what you will be learning.

![rag image](images/rag1.png " ")

Estimated Time: 30 Minutes

## About Oracle AI Vector Search

Oracle AI Vector Search is a feature of Oracle Database 23ai that enables efficient searching of AI-generated vectors stored in the database. It supports fast search using various indexing strategies and can handle massive amounts of vector data. This makes it possible for Large Language Models (LLMs) to query private business data using a natural language interface, helping them provide more accurate and relevant results. Additionally, AI Vector Search allows developers to easily add semantic search capabilities to both new and existing applications.

### Objectives
The labs in this workshop will guide you through the following tasks:

- Getting familiar with the new Vector Datatype and PL/SQL packages for managing vector data and performing vector operations.
- Using PL/SQL to develop applications that work with Large Language Models (LLMs).
- Implementing Oracle AI Vector Search to store and search vectors within Oracle Database 23ai.
- Accessing popular LLMs and generating responses based on relevant data.
- Running a complete sample application that integrates all these concepts and showcases how to build a practical RAG solution.

By the end of the workshop, you’ll have hands-on experience working with Oracle’s AI-powered tools to build a scalable, efficient retrieval augmented generation (RAG) application.


## Learn More
- [What Is Retrieval-Augmented Generation](https://www.oracle.com/artificial-intelligence/generative-ai/retrieval-augmented-generation-rag/)

- [Oracle Database 23ai Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html)

- [Oracle AI Vector Search User's Guide](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/whats-new-oracle-ai-vector-search.html)

- [Oracle AI Vector Search Blog](https://blogs.oracle.com/database/post/oracle-announces-general-availability-of-ai-vector-search-in-oracle-database-23ai)

- [Oracle AI Vector Embeddings](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/store-vector-embeddings.html)

- [Oracle AI Vector Distance](https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_distance.html)


## Acknowledgements
* **Author** - Francis Regalado, Database Product Management; David Start, Database Product Management
* **Contributors** -
* **Last Updated By/Date** - Francis Regalado, Database Product Manager October 2024
58 changes: 58 additions & 0 deletions ai-vector-rag/rag/rag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Lab 2: Build your own RAG app!

## Introduction
A typical RAG (Retrieval Augmented Generation) application follows 7 key steps and requires a vector store. In this lab, you will learn how to build a RAG application using Oracle AI Vector Search. By the end of the lab, you will have stored, chunked, and vectorized data from a PDF document. You will then use a Large Language Model (LLM) to generate an answer to a user’s query based on the relevant context stored in Oracle Database 23ai. We’ll be working with documents (PDF) as the source data, but the same process can be applied to other data types like audio and video.

Here are the steps we will cover:

1. Load your document.
2. Convert the document to text.
3. Break the text into smaller chunks.
4. Use an embedding model to turn those chunks into vectors and store them in Oracle Database 23AI.
5. Ask a question in the prompt, and use the same embedding model to vectorize the question.
6. Perform a similarity search in Oracle Database 23ai using the question.
7. The search results and question are passed to the LLM to generate a final response.

Each step will be explained in detail, guiding you through the process of interacting with models, embedding vectors, and using advanced search techniques. In the main workshop, additional information and documentation will be provided for further exploration and deeper understanding of the concepts covered.

Throughout this section we will be leveraging a Jupyter Notebook to explore vectors. If you are unfamiliar with notebooks here are a few tips to get started:
- Instructions and code will be mixed together, each having their own blocks. You can use the run button on the code to see it execute. If you accidently hit run on any instructions it will just move to the next block so don't worry.
- When running a code block it will switch from either a [ ] or a [1] (a number inside) to a [*]. When you see the one with a * that means its running. Wait till it switches to a number before moving on.
- If you see any warnings, don't worry, they are probably just letting you know that things are changing, depreciating and you should look at updating to the latest standards. You don't need to do anything.

### Prerequisites
This lab assumes you have:
- All previous labs successfully completed

## Task 1: Open Notebook
This task will have you login to the Jupyter environment and run specific notebooks for this lab.

1. **If you have already logged into the Jupyter environment skip to step 5, otherwise** open "**View Login Info**" section of your workshop.

2. Copy the Jupyter Notebook Password and click the Jupyter Notebook URL.

3. Paste the Jupyter Notebook Password you copied in the previous step into the Notebook.

4. You should be within the Jupyter Notebooks landing screen. Open the folder name (*******) on the left hand side of the screen located in the file explorer.

5. In the left File Explorer panel open the (**workshop**) and open(**workshop.ipynb**) notebook.

6. Follow the steps in the notebook. A few things to remember:
- there are markdown blocks and code blocks mixed together
- The run button can be used on both code and markdown blocks (markdown just advances you to the next block)
- When you run a code block there are [ ] next to the code block. If it changes to a [*] that means it running. If it has a number like [1] then its done running.
- Passwords and additional information you may need will be found in the "View Login Info" where the Jupyter Notebook link was

## Learn More

- [Oracle Database 23ai Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html)

- [Oracle AI Vector Search User's Guide](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/whats-new-oracle-ai-vector-search.html)

- [Oracle AI Vector Search Blog](https://blogs.oracle.com/database/post/oracle-announces-general-availability-of-ai-vector-search-in-oracle-database-23ai)


## Acknowledgements
* **Author** - Francis Regalado, Database Product Management; David Start, Database Product Management
* **Contributors** -
* **Last Updated By/Date** - Francis Regalado, Database Product Manager October 2024
63 changes: 63 additions & 0 deletions ai-vector-rag/sandbox/workshop/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Oracle LiveLabs gives you access to Oracle's products to run a wide variety of labs and workshops; allowing you to experience our best technology, live!">
<title>Oracle LiveLabs</title>

<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/jquery-1.11.0.min.js"></script>
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/jquery-ui-1.10.4.custom.js"></script>
<script src="main.21.1.1.js"></script>
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/main.min.js"></script>

<link rel="stylesheet" href="https://oracle-livelabs.github.io/common/redwood-hol/css/style.min.css" />
<link rel="shortcut icon" href="https://oracle-livelabs.github.io/common/redwood-hol/img/favicon.ico" />
</head>

<body>
<header class="hol-Header" role="banner">
<div class="hol-Header-wrap">
<div class="hol-Header-logo"><span>Oracle LiveLabs</span></div>
<a href="https://livelabs.oracle.com" target="_blank" id="livelabs" title="Oracle LiveLabs"></a>
<div class="hol-Header-actions">
<button id="openNav" class="hol-Header-button hol-Header-button--menu rightNav" aria-label="Open Menu"
title="Open Menu">
<span class="hol-Header-toggleIcon"></span>
</button>
</div>
</div>
</header>

<div id="container">
<div id="leftNav">
<div id="toc"></div>
</div>
<div id="contentBox">
<main class="hol-Content" id="module-content"></main>
</div>
</div>

<footer class="hol-Footer">
<a class="hol-Footer-topLink" href="#top">Return to Top</a>
<div id="footer-banner"><div class="footer-row">
<div class="footer-content"><ul class="footer-links">
<li><a href="https://docs.oracle.com/pls/topic/lookup?ctx=en/legal&id=cpyr" target="_blank" aria-label="Open a new window to Oracle legal notices" data-lbl="copyright">© Oracle</a></li>
<li><a href="https://www.oracle.com/corporate/index.html" target="_blank" aria-label="Open a new window to learn more about oracle" data-lbl="about-oracle">About Oracle</a></li>
<li><a href="https://www.oracle.com/corporate/contact/" target="_blank" aria-label="Open a new window to contact oracle" data-lbl="contact-us">Contact Us</a></li>
<li class="footer-links-break"></li>
<li><a href="https://docs.oracle.com/en/browseall.html" target="_blank" aria-label="Open a new window to products a-z" data-lbl="products-a-z">Products A-Z</a></li>
<li><a href="https://www.oracle.com/legal/privacy/" target="_blank" aria-label="Open a new window to read more about Oracle terms of use and privacy" data-lbl="terms-of-use-and-privacy">Terms of Use & Privacy</a></li>
<li><a href="https://www.oracle.com/legal/privacy/privacy-policy.html#11" target="_blank" aria-label="Open a new window to read more about managing Oracle cookie preferences" data-lbl="cookie-preferences">Cookie Preferences</a></li>
<li><a href="https://www.oracle.com/legal/privacy/marketing-cloud-data-cloud-privacy-policy.html#adchoices" target="_blank" aria-label="Open a new window to ad choices" data-lbl="ad-choices">Ad Choices</a></li>
<li class="footer-links-break"></li><li class="last"><a href="https://docs.oracle.com/pls/topic/lookup?ctx=en/legal&id=cpyr" target="_blank" aria-label="Open a new window to Oracle legal notices" data-lbl="copyright">© Oracle</a></li>
</ul>
</div>
</div>
</div>
</footer>
</body>

</html>
34 changes: 34 additions & 0 deletions ai-vector-rag/sandbox/workshop/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"workshoptitle": "AI Vector Search - Complete RAG application with Oracle AI Vector Search",
"help": "livelabs-help-db_us@oracle.com",
"tutorials": [
{
"title": "Introduction",
"description": "This is an introduction to RAG",
"type": "livelabs",
"filename": "../../introduction/introduction.md"
},
{
"title": "Get Started",
"description": "Prerequisites for LiveLabs (Oracle-owned tenancies). The title of the lab and the Contents Menu title (the title above) match for Prerequisite lab. This lab is always first.",
"filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login-23ai.md"
},
{
"title": "Lab 1: Running a RAG Application",
"description": "Run a RAG application",
"type": "livelabs",
"filename": "../../demo/demo.md"
},
{
"title": "Lab 2: Build your own RAG app!",
"description": "Exploring RAG",
"type": "livelabs",
"filename": "../../rag/rag.md"
},
{
"title": "Need Help?",
"description": "Template to link to Need Help lab at the end of workshop. Change 'CHANGE-ME' in link below to need-help-livelabs.md or need-help-freetier.md",
"filename":"https://raw.githubusercontent.com/oracle-livelabs/common/main/labs/need-help/need-help-freetier.md"
}
]
}

0 comments on commit 2761198

Please sign in to comment.