Oracle AI Database , Vector Datatype….

Oracle AI Vector Search Benefits. One of the main benefits of Oracle AI vector search is that we have a single system for both structured and unstructured data. This allows for a semantic search on unstructured data and allows for relational search on business data.

And because you don’t need to have a separate vector database, this helps eliminate data fragmentation. It also supports Retrieval Augmented Generation, or RAG. This allows for responses to natural language questions.

Now let’s take a look at the brand new vector data type. So the vector data type was introduced in Oracle Database 23AI. It stores vector embeddings alongside other business data. Now, in case you’re not familiar with the term vector embedding, a vector embedding is a mathematical representation of what a particular piece of data looks like. That data could be string data, or it could be audio wavelengths, or it could be something like a picture.

Now, in this example, Iám going to show you how to create a table. And you’ll notice that it has columns that you would imagine in standard relational data. We’ve got a unique identifier for the house, the house ID. We’ve got a price column, a city column, and a column to add a picture of the house. Now, the very last column is what we call a vector data type column. And that is the column called house vector.

Once we load data into the table, we can query the table in order to find out the distance or how similar other houses are to a particular house in the same city, around the same price. So you’ll notice in the query, we are selecting a photo of the house, the city, and the price from the table where the price is less than or equal to whatever the input prices from an application perhaps, and whatever the city is, from the input city, from the application.

And then the order by clause uses the vector distance function, in order to pass in the house vector column and whatever the input vector is coming from the application. The complete workflow looks like this. First, we have to generate vector embeddings. And we do that typically using vector embedding models. Next, we need to store the vector embeddings. And that’s where we store those embeddings, in a vector type column, in a table. Now, you can have more than one vector column per table.