Skip to main content
Best Practices for Building
Enterprise RAG Pipelines Using
Oracle Vector Search
Sandesh Rao
Vice President
Applied AI Technologies
Feb 2026
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon in
making purchasing decisions. The development, release, timing, and pricing of any features
or functionality described for Oracle’s products may change and remains at the sole
discretion of Oracle Corporation.
Safe harbor statement
2 Copyright © 2026, Oracle and/or its affiliates
Databases have always been great
at searching structured data by
data values
Copyright © 2026, Oracle and/or its affiliates
Find top 10 products by
revenue
3
DB/APP DATA
Orders
Customer
records
Products
Copyright © 2026, Oracle and/or its affiliates
DB/APP DATA
Orders
Customer
records
Products
SEMI-STRUCTURED
Medical
forms
Invoices
UNSTRUCTURED
Social data
images
Videos
Phone call
scripts
The “all data” opportunity
JSON
Copyright © 2026, Oracle and/or its affiliates
There is a growing need to
searching both structured and
unstructured data by semantic
similarity
Find top 10 products that
match a photo or a text
description
4 Copyright © 2026, Oracle and/or its affiliates
AI
Vector Search
Copyright © 2026, Oracle and/or its affiliates
5
A new breakthrough
technology to search
documents, images, and other
structured and unstructured
data based on their semantic
content, rather than their
words or pixels
Vector
33
42
16
21
50
AI Vector Search works by representing the
semantic content of a document, image, video,
or even relational data as a sequence of
numbers, called a vector
Developers create a vector for a given piece of
data by invoking their chosen deep-learning
model (known as an embedding model)
Oracle Vector Database natively stores vectors
and compares vectors to find objects with
similar semantic content
Copyright © 2026, Oracle and/or its affiliates
6 Copyright © 2026, Oracle and/or its affiliates
The main operation on vectors is the Mathematical Distance between them
8
2
1
3
Distance (Euclidean Squared)
= ((3-2)2+(1-6)2+(2-2)2+(8-3)2)
There are many mathematical distance formulas
7 Copyright © 2026, Oracle and/or its affiliates
3
2
6
2
Copyright © 2026, Oracle and/or its affiliates
7
Enterprise Similarity Search Use-Cases
Find Similar
Support Tickets
Biometric pattern
recognition
Find Similar
Products
Product
Recommendation
Detect manufacturing
anomalies
Natural language catalog
search
CATALOG
8 Copyright © 2025, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
8
Copyright © 2026, Oracle and/or its affiliates
Let’s take a look at
vector search in action:
Imagine a National Parks app
that helps users find nearby
parks featuring similar views or
activities to their search criteria
9
9
For each photo we have generated a vector and stored it
as a column using the new VECTOR datatype in Oracle AI Database
Copyright © 2026, Oracle and/or its affiliates
10
10
Vector Features
Bridge
Hiking Trail
River
Hiker
Douglas Fir
Example: the features for a park image captured in a vector could be
Copyright © 2026, Oracle and/or its affiliates
Note: Features are often chosen by ML algorithms and are not as simple as shown here
11
33
42
16
21
50
11
Vector Embedding Generation | Your Way
AI Vector Search offers 4 alternatives for vector embedding generation
Use
Pre-created
embeddings
1
Use an external
embedding
cloud-service
2 3
Use an external
embedding
library in the mid-
tier
4
Use a database
resident
embedding model
Copyright © 2026, Oracle and/or its affiliates
12
Vector Embedding Generation | Your Way
Generate vector embeddings inside the database
13 Copyright © 2026, Oracle and/or its affiliates
Generate embeddings
using the
VECTOR_EMBEDDING()
SQL function using an
imported ONNX
embedding model, so that
no data leaves
the database
Use a database
resident
embedding model
-- generate vectors from park descriptions
UPDATE parks
SET desc_vector = VECTOR_EMBEDDING(minilm_l12_v2 USING description AS data);
-- import onnx embedding model
DBMS_VECTOR.load_onnx_model(
directory => <database directory>
file_name => 'all_MiniLM_L12_v2.onnx'
model_name => 'minilm_l12_v2',
metadata => <source>
);
4
Generate vectors outside the database with
AI model providers of your choice, like
Open-AI, Cohere, or Google
First, create a credential using the new
CREATE_CREDENTIAL() API, where you
specify your key for your preferred provider
Provide that credential along with the provider to
the new UTL_TO_EMBEDDING() API
New UTL_TO_EMBEDDING()API
to generate vectors outside the database
// Initialize parameters to specify provider
var params CLOB;
DBMS_VECTOR.CREATE_CREDENTIAL(“OPENAI_CRED”, auth_params);
params := '
{
"provider": ”openai",
"credential_name": ”OPENAI_CRED",
"url": https://api.openai.example.com/embeddings”,
"model": "embed-model”
}'
// Generate vectors from house images
SELECT
DBMS_VECTOR_CHAIN.UTL_TO_EMBEDDING(house_photo,
json(params))
FROM house_for_sale;
14 Copyright © 2025, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
14
New VECTOR_EMBEDDING()function to generate vectors
Many customers want to be able to generate vectors
within the database
Oracle Database supports the Open Neural Net
Exchange (ONNX) framework to import models
The VECTOR_EMBEDDING() function can then generate
vectors for unstructured data using the imported
model
// generate vectors from photos of houses
SELECT
VECTOR_EMBEDDING(embed-model USING house_photo)
FROM House_for_sale;
// import onnx embedding model
DBMS_VECTOR.load_onnx_model(
directory => <database directory>
file_name => 'my_embed_model.onnx'
model_name => 'embed-model',
metadata => <source>
);
15 Copyright © 2025, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
15
Copyright © 2026, Oracle and/or its affiliates
16
New VECTOR_DISTANCE function enables you to
measure the distance between two vectors
33
42
16
21
50
Now that we know what vectors
are, let’s talk about how they are
used in the enterprise
Vector Search works best
when combined
with relational search to
solve business problems
One solution is to send your business data to a
vector database continuously
Searches on a combination of business and semantic data
is more effective if both types of data are stored together
Vector Database
Business Database
Business Data
However, the business data that is relevant to a question varies widely
Plus, dedicated vector databases are not good at searching or securing business data
18 Copyright © 2026, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
18
Copyright © 2026, Oracle and/or its affiliates
19
Every mission-critical feature
of Oracle Database works
transparently with AI Vectors
Allowing AI Vectors to be used
immediately in enterprise apps
of any scale or criticality
Real-Application Cluster
Parallel SQL
Transactions
Security
Analytics
Disaster Recovery
Copyright © 2026, Oracle and/or its affiliates
20
Example:
Find the top 10 matching national parks
with waterfalls in the Western U.S.
Finding the best match requires combining
image similarity with searches on business or structured data
SELECT …
FROM park_images pi, parks p
WHERE pi.park_code = p.park_code
AND p.states IN ('CA','OR','NV','WA','AZ','CO')
ORDER BY VECTOR_DISTANCE(pi.image_vector,
VECTOR_EMBEDDING(clip_vit_txt USING 'waterfall' AS data))
FETCH EXACT FIRST 10 ROWS ONLY;
Copyright © 2026, Oracle and/or its affiliates
21
New vector indexes trade-off some search
accuracy for 100x speed up
An exhaustive search
for top-K matches
will be 100% accurate
but slow as data
volumes grows
Vector Indexes | Neighbor Graph Vector Index
Graph-based index where vertices represent
vectors and edges between vertices represent
similarity
In-Memory only index - highly efficient for
both accuracy and speed
1
4
6
5
3
2
7
8
9
0
Graph Vector Index (e.g.
HNSW Index)
22 Copyright © 2026, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
22
Partition-based index with vectors
clustered into table partitions based on
similarity
Efficient scale-out index for unlimited
data size
Partition Vector Index (e.g.
IVF_FLAT index)
Vector Indexes | Neighbor Partition Vector Index
23 Copyright © 2026, Oracle and/or its affiliates
California
New York
Nevada
Copyright © 2026, Oracle and/or its affiliates
23
23.5
23ai
May
24
VECTOR Datatype
IVF Index
HNSW Index
Flexible Vector Generation (ONNX)
SQL Extensions (e.g., ACCURACY)
Exadata AI Smart Scans
Hybrid Search (Attribute Filtering)
Multi-Vector Search (table scans)
Vector Memory Pool
DBMS_VECTOR_CHAIN APIs
Client Drivers and PLSQL
OCI, Cohere, Open AI LLM Integrations
Jul
24
Elastic Vector Memory Pool
HNSW Duplication on RAC
In-Memory Centroid Vectors (IVF)
BINARY Vectors
Langchain Integration
23.6
HNSW Transactions Support
HNSW Persistence w/ Checkpointing
Exadata Vector Distance Projection
Hybrid Vector Indexes
Partition Local Indexes (IVF)
SPARSE Vectors
Pre-Built ONNX Embedding Models
Vectors from Feature Extraction Algos
Google, Ollama LLM Integrations
LlamaIndex Integration
Oct 24
Jan 25
23.7
23.8
HNSW Transactions Support
Enhanced Optimizer Costing
Custom JavaScript Distance Functions
Resumable Vector Index Scans
Expanded support for SPARSE Vectors
Apr 25
Included "Covering" Columns (IVF)
Exadata Vector Columnar Format
Shard-Local Vector Indexes
ONNX Image Models + Perf
Post-Filter for HNSW Index
Automatic Accuracy Calibration
External Tables w/ VECTOR columns
Oracle AI Vector Search Continuous Innovation
Copyright © 2026, Oracle and/or its affiliates
24
Jul
25
23.9
IVF Index Reorganization
HNSW Index Incremental Refresh
HNSW Index for Sparse Vectors
Hybrid Vector Index in DBMS_SEARCH
Copyright © 2026, Oracle and/or its affiliates
24
Hybrid Vector Index | Overview
Copyright © 2026, Oracle and/or its affiliates
25
There are two approaches for searching document data:
• Keyword Search: Deterministic and explainable, but does
not fully capture document semantics
• AI Vector Search: Powerful semantic search technique, but
neither deterministic nor explainable
Many real-world document searches require both techniques
to be combined
A Hybrid Vector Index combines keyword search with vector
search for improved accuracy
Hybrid Vector Index
Vectorizer
Tokenizer abc
Vector
Index
Text
Index
Chunks
Vectors
Tokens
Sections
Files
23.6
Adding Generative AI to
AI Vector and business data
search enables a new era of
data and
app dev productivity
26 Copyright © 2026, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
26
Oracle 26ai improves Generative AI by augmenting
LLM prompts with private database content that is
found using any combination of data and AI Vector
Search
Enables LLMs to use business data to produce better
and more contextually relevant answers to user
questions while keeping business data secure
Called: Retrieval Augmented Generation (RAG)
27 Copyright © 2026, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
28
Hi Amy, I’m your Service
Automation Virtual Assistant.
I’m here to help resolve any issues
you might have.
IT Automation
Why does my laptop keep
rebooting?
Let me check our internal knowledge
base. Please bear with me as this
may take a moment…
Here is a possible solution that may help
resolve the issue with your laptop:
The issue is with the firmware controlling the
fan. Apply OS update 42 while plugged in, in a
cool air-conditioned environment to prevent
overheating
…
Sign off
IT Automation
Let's look at an example
Imagine an app that helps
resolve Internal Support
Incidents using a RAG chatbot
There is a strong likelihood that
a similar or identical issue has
been seen before
AI Vector Search in Oracle Database Powers Complete Gen AI Pipeline
Retrieval Augmented-Generation (RAG) with your enterprise data
GenAI
User
1
AI Vector
Vectorize Question
An end-user's human language
question is encoded as a vector
Retrieval Augmented Generation (RAG)
29 Copyright © 2026, Oracle and/or its affiliates
Why does
my laptop
keep
rebooting?
33
42
16
21
5
Copyright © 2026, Oracle and/or its affiliates
29
AI Vector Search in Oracle Database Powers Complete Gen AI Pipeline
GenAI
User
2
1
Product Info
AI Vector
Vectorize Question
An end-user's human language
question is encoded as a vector
Find Related Data
AI Vector Search finds private
database data that matches the user's
vector including product info and
other support tickets for the same
laptop
Retrieval Augmented Generation (RAG)
30 Copyright © 2026, Oracle and/or its affiliates
Support Tickets
Retrieval Augmented-Generation (RAG) with your enterprise data
Copyright © 2026, Oracle and/or its affiliates
30
AI Vector Search in Oracle Database Powers Complete Gen AI Pipeline
3
GenAI
User
2
1
AI Vector
Augment Prompt
The user's question is augmented
with this
private data
Vectorize Question
An end-user's human language
question is encoded as a vector
Find Related Data
AI Vector Search finds private
database data that matches the user's
vector
Retrieval Augmented Generation (RAG)
31 Copyright © 2026, Oracle and/or its affiliates
Product Info Support Tickets
Retrieval Augmented-Generation (RAG) with your enterprise data
Copyright © 2026, Oracle and/or its affiliates
31
AI Vector Search in Oracle Database Powers Complete Gen AI Pipeline
3
4
GenAI
User
2
1
AI Vector
Ask LLM
The combination is sent to an LLM
to provide an informed answer to
the question
Vectorize Question
An end-user's human language
question is encoded as a vector
Find Related Data
AI Vector Search finds private
database data that matches the user's
vector
Retrieval Augmented Generation (RAG)
32 Copyright © 2026, Oracle and/or its affiliates
The issue is with the
firmware controllingthe
fan. Apply OSupdate 42
while plugged in, in a cool
air-conditioned
environment to prevent
overheating
Product Info Support Tickets
Augment Prompt
The user's question is augmented
with this
private data
Retrieval Augmented-Generation (RAG) with your enterprise data
Copyright © 2026, Oracle and/or its affiliates
32
The whole Retrieval Augmented Generation (RAG) pipeline
can be executed directly from SQL
WITH TOP50 AS (SELECT doc_text FROM DOCUMENTS
ORDER BY VECTOR_DISTANCE(doc_vector,
SELECT VECTOR_EMBEDDING(embedding_model
USING :question_text AS data))
FETCH FIRST 50 ROWS ONLY),
LLM_PROMPT AS (SELECT ('Answer this question using the following context,
QUESTION: ' ||:question_text || ' ,CONTEXT: '
|| LISTAGG(doc_text, CHR(10))) AS prompt_text
FROM TOP50)
SELECT DBMS_VECTOR_CHAIN.UTL_TO_GENERATE_TEXT(prompt_text, json(:LLM_params))
AS Answer
FROM LLM_PROMPT;
1) Generate the question
vector using SQL
2) Perform Vector
Search using SQL
4) Retrieve LLM response
using SQL
3) Compose and run the
LLM prompt using SQL
LLMs, Data, and SQL Engineered to Work Together
33 Copyright © 2026, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
33
Best Practices for Oracle Vector Search
• Best practices for Oracle Database vector search involve choosing the right index type and distance metric,
leveraging hybrid search, and optimizing data preparation and infrastructure
• Data Preparation & Vector Generation
• Ensure vector quality: The quality of search results depends directly on the quality of your vector
embeddings
• Use sophisticated embedding models appropriate for your data type (text, image, etc.) to generate high-
quality embeddings
- Ensure vector quality: The effectiveness of your search is only as good as the quality of your vectors
- Choose an appropriate, high-quality embedding model for your specific data type (text, images, etc.) from
sources like the Hugging Face MTEB Leaderboard
- Always select a multimodal model to allow ingestion of different data types
• Use consistent dimensions: All vectors within a single vector column must have the same number of
dimensions. Inconsistencies will cause index creation to fail
34 Copyright © 2026, Oracle and/or its affiliates
Best Practices for Oracle Vector Search
• Chunk large text data: When working with large text documents for RAG, use chunking to split them into
smaller, more relevant passages
- This enhances search relevance and avoids size limits imposed by embedding models
- Clean and normalize data: Before generating embeddings, clean data to remove noise and normalize it to
a common model
• Indexing & Querying
• Create vector indexes: Always create a vector index on vector columns to dramatically improve query
performance
• Choose the right index type:
• HNSW (Hierarchical Navigable Small World) indexes are generally recommended first for optimal
performance
• IVF (Inverted File Index) is an alternative to consider for very large vector indexes where memory allocation
is a concern
• Leverage hybrid search: Combine vector similarity search with traditional keyword search (using Oracle Text
domain indexes) for more precise and relevant results
35 Copyright © 2026, Oracle and/or its affiliates
Best Practices for Oracle Vector Search
• Select appropriate distance metrics: Choose the distance metric (e.g., Cosine, Dot, Euclidean) that best fits your
specific use case and data distribution
• Cosine Similarity: Measures the angle between vectors (range -1 to 1). Ideal for high-dimensional,
unnormalized text/sparse data where vector magnitude is irrelevant
• Dot Product : Measures magnitude and direction. If vectors are normalized (length=1), it is equivalent to
Cosine similarity but faster. Best for recommendation systems where user preference intensity matters
• Euclidean Distance Measures the straight-line distance between two points. Ideal for image retrieval,
clustering, and data where the absolute difference between values is critical
Conclusion
• If using LLMs : Use Cosine Similarity as embeddings are often normalized or orientation-focused
• If you need high-speed search: Use Dot Product on normalized embeddings
• If data is not normalized and magnitude matters: Use Euclidean Distance (if data is dense) or Dot Product
• If data is sparse/binary: Consider Cosine or Hamming distance
36 Copyright © 2026, Oracle and/or its affiliates
Best Practices for Oracle Vector Search
• Specify accuracy: Define your desired search accuracy (as a percentage) during index creation, with the option
to override it in specific search queries if needed
• Use the right SQL functions
• Leverage the new VECTOR data type, vector operators, and functions provided in Oracle Database 26ai for
seamless integration of vector operations within SQL
• Exclude vector columns from SELECT *: Vector data can be large
- Explicitly list the columns you need in your SELECT clause to reduce data transfer overhead and improve
query performance
• Performance & Scalability
• Allocate sufficient temporary tablespace: Oracle recommends allocating larger, temporary tablespaces
when creating vector indexes, especially with large vector spaces and sizes
• Tune index parameters: Experiment with index-specific parameters (like the number of connections in
HNSW or probe counts – nprobes in IVF) through iterative testing to find the optimal balance between
speed and precision for your workload
37 Copyright © 2026, Oracle and/or its affiliates
Best Practices for Oracle Vector Search
• Consider hardware acceleration: Utilize hardware like GPUs to accelerate computationally intensive tasks such
as bulk vector embedding generation and index creation
• Design for scalability: Employ horizontal scaling strategies like sharding data across nodes to distribute the load
as your data grows
• Monitor and re-evaluate: Regularly monitor query latency, error rates, and resource utilization
• Periodically re-evaluate and retrain your embedding models and rebalance clusters to maintain
performance and relevance
• Store vectors with business data: Keep the vector embeddings within the same converged Oracle Database
instance as your existing business data to avoid data movement, reduce latency, and leverage existing security
features
• Ensure indexes are fully built: Confirm that vector indexes are fully built and in a usable state before
running production queries
• Allocate sufficient memory: Adjust the VECTOR_MEMORY_SIZE system parameter in the SGA, especially for
HNSW indexes, to ensure adequate memory is available for the in-memory structures
• Warm up the index: Load the index into memory before heavy querying to ensure optimal performance
38 Copyright © 2026, Oracle and/or its affiliates
Best Practices for Oracle Vector Search
• Reduce vector dimensions (if feasible): Where appropriate, consider reducing the dimensionality of your
vectors to improve performance and memory usage, balancing speed with result accuracy
• Leverage database tools: Use tools like EXPLAIN PLAN to understand how the optimizer resolves vector queries
and identify potential bottlenecks.
• Utilize partition pruning: For very large partitioned tables with locally partitioned IVF indexes, partition
pruning can significantly enhance query performance by scanning only relevant partitions
• Model Selection: Use domain-specific embedding models (e.g., legal or medical models) rather than general-
purpose ones for better performance in niche applications
39 Copyright © 2026, Oracle and/or its affiliates
By following these guidelines, you can
build an efficient and scalable vector
search solution within your Oracle
Database environment, combining
business data and semantic search
capabilities in a single system.
40 Copyright © 2026, Oracle and/or its affiliates
Best Practices for Oracle Vector Search
Database Annotations in 26ai
Help to Explain Data and Semantics to AI
Annotations in 26ai (backported to 19c) enable metadata augmentation with data intent and semantics
X Y Z
C 1 C 2 C 3 C 4
… … … …
ALTER TABLE XYZ ANNOTATIONS (ADD Purpose ‘Employee_Detail’);
ALTER TABLE XYZ MODIFY (C1 ANNOTATIONS (Salary ‘USD’));
ALTER TABLE XYZ MODIFY (C2 ANNOTATIONS (Name ‘First & Last’));
ALTER TABLE XYZ MODIFY (C3 ANNOTATIONS (Department ‘Abbreviated’));
XYZ
C 1 C 2 C 3 C 4
… … … …
… … … …
… … … …
XYZ appears to be an Employees table, and
C1 and C2 represent the Salary and
Department of an Employee, so here are the
results of your report! …
What is the average employee
salary in each department?
41 Copyright © 2026, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
41
SQL Developer workflow for AI Enrichment for Metadata
Helping users to add annotations to explain data to AI
Metadata enrichment workflow that allows users to:
• Annotate schemas
• Annotate tables/views within schema
• Annotate columns in each table/view
Optional AI-assisted annotation suggestions
Continuous report on the number of tables enriched
42 Copyright © 2026, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
42
Metadata enrichment workflow that allows users to:
• Annotate schemas
• Annotate tables/views within schema
• Annotate columns in each table/view
Optional AI-assisted annotation suggestions
Continuous report on the number of tables enriched
SQL Developer workflow for AI Enrichment for Metadata
Helping users to add annotations to explain data to AI
43 Copyright © 2026, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
43
Oracle AI Database Private Agent Factory
A no-code platform for developers to rapidly deploy
intelligent agents by leveraging :
Pre-built Agents
• Knowledge Agent
• Deep Research Agent
• Data Analysis Agent
• Prompt2Dashboard Agent
Custom-built Agents
• Drag-and-drop UI (similar to Langflow)
• Developers can build agents with custom
workflows, tools, and data ecosystems
All Agents can use Oracle Database’s AI features
enabling rapid development of smart assistants
44 Copyright © 2026, Oracle and/or its affiliates
Copyright © 2026, Oracle and/or its affiliates
44
45 Copyright © 2026, Oracle and/or its affiliates
To learn more and try Oracle AI Vector Search yourself
Oracle AI
Vector Search Blog
blogs.oracle.com/database/category/db-vector-search
Bringing AI
to Your Data
youtu.be/9BLf1L947uc?si=3iP_T7vdj4ElbLzP
Try AI Vector Search
on Oracle LiveLabs
Livelabs.oracle.com
46 Copyright © 2026, Oracle and/or its affiliates