![]() |
VOOZH | about |
We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.
Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.
Follow TNS on your favorite social media networks.
Become a TNS follower on LinkedIn.
Check out the latest featured and trending stories while you wait for your first TNS newsletter.
You know your organization needs to start leveraging generative AI (GenAI). But how do you get started? With data stored in databases holding your company’s critical information, applying large language models (LLMs) to that data might seem complex. However, you can actually start using LLMs to analyze your data in Oracle Autonomous Database in just minutes using SQL-powered retrieval-augmented generation (RAG).
RAG allows you to apply the power of LLMs (e.g., creativity, deep understanding of language nuances) to information that the models know little or nothing about. That lack of knowledge might be because the information is private (e.g., in your database) or more recent than the model’s training data. By augmenting AI-generated content with authoritative information, RAG can help improve the accuracy, relevance, and reliability of GenAI output.
RAG is generally associated with vector databases, which help provide context to an LLM by allowing super-fast retrieval of similar data from storage engines (e.g., unstructured data, PDFs, documents), rather than just exact keyword matches. To gain insights using RAG:
You can now answer a natural language question like: “My customer thinks this condo is beautiful. What other condos in the Boston area look like that one and are in her price range?” That returns similar-looking homes that she can afford based on image similarity and her private financial information contained in the database.
There are other ways to provide context to an LLM that are simpler but perhaps not as powerful as what’s described above. This approach works with the data that’s accessible to your Autonomous Database deployment (e.g., internal tables, data lakes, linked tables). To use RAG with Autonomous Database:
Conceptually, this looks very similar to using RAG with vector databases. Here’s an example of applying those steps in Autonomous Database using a sample Oracle APEX app.
Autonomous Database provides a capability called Select AI that allows you to use LLMs with your data. A popular way to use Select AI is for natural language queries (see Autonomous Database speaks “Human” and Conversations Are the Next Generation in Natural Language Queries).
This is a little different than natural language queries; instead of generating a query, it combines the results of a SQL query with task instructions to produce a prompt. That prompt is passed to an LLM and processed, producing a recommendation, a summary or whatever your project asked it to do. To make this work:
Following are code examples for each of these steps. Check out this LiveLabs workshop if you want to run the steps on your own.
Select AI uses an AI profile to encapsulate connection information to an AI provider. Create a profile using the DBMS_CLOUD_AI.create_profile PLSQL procedure:
There is an emerging science around prompt engineering trying to answer the question: “What is the best way to give instructions to the LLM?” You will want to test different prompts to see what gives the best results. Here’s an example:
Pick 5 great things to do at the location
The LLM has no knowledge about the person traveling to that location. Supply a database query that augments the instructions with the traveler’s profile:
You want to provide clear instructions to the LLM to help it produce the best results. Supplying a JSON document is a great way to organize those instructions, and it’s incredibly easy to package SQL queries as JSON using Autonomous Database’s built-in JSON_OBJECT function:
This query returns a well-structured JSON document:
Select AI provides a simple function, DBMS_CLOUD_AI.GENERATE, to communicate with the LLM. It uses the profile(s) created previously, making it easy to test results from different providers:
Check out the results for Jennine:
Here are five activity recommendations for you in Paris, taking into account your preferences and situation:
I hope these suggestions help! If you have any preferences or additional information you’d like me to consider, please let me know, and I’ll be glad to provide more personalized recommendations.
Have a wonderful time in Paris!
Kindly note that while the above suggestions are primarily for your enjoyment, it’s always a good idea to do thorough research and make reservations or bookings in advance to ensure a smooth experience during your visit to Paris.
Safe travels and enjoy your stay!
I think Jennine is going to have a great time in Paris!
GenAI is mind-blowingly powerful, and with the right tools, you can easily apply it to your organization’s data. Take it for a spin! Check out the links to get hands-on experience.