AI Applications with Oracle Database 26ai and APEX 26.1
Vector search, RAG, and AI agents, built where your data already is: in SQL, PL/SQL, and Oracle APEX. Every one of the 237 examples was run, and the book prints the output it really returned.
- VECTOR type
- Embeddings
- Semantic search
- Hybrid search
- RAG
- Natural language to SQL
- APEX_AI
- AI agents

AI features, built in the database you know
Most AI tutorials assume Python, a separate vector database, and data copied out of Oracle. Oracle AI Database 26ai and Oracle APEX 26.1 bring vectors, embeddings, and language models to where your data already is. This book shows how, in SQL, PL/SQL, and APEX, with every example run.
Python notebooks, and answers you can't check
- Examples in Python and JavaScript frameworks, far from the tables, security, and transactions of an Oracle application.
- A separate vector store to keep in sync with the data it describes.
- Demos that work once, with no word on wrong answers, cost, timeouts, or what to do when the model is busy.
- New 26ai and APEX 26.1 features, barely described outside the documentation.
Every AI feature, built in SQL, PL/SQL, and APEX
- Vectors, embeddings, and vector indexes in the same tables as your data, searched with SQL.
- 237 examples run in Oracle AI Database 26ai Free with APEX 26.1, each with the output it returned.
- One sample application, Atlas Support, from the first vector to three finished AI projects.
- Security, quality, cost, and speed, with the errors you will meet and how to fix them.
Syntax, example, and the output it produced
Every code block in the book carries a label: SYNTAX for how to write a statement, EXAMPLE for code that runs against Atlas Support, and OUTPUT for what it returned when it ran in Oracle AI Database 26ai.
Learn the syntax
Each feature starts with its syntax. Here, a similarity search: sort by the distance from a query vector, and keep the first rows.
Read the example
A query of Chapter 8 against the knowledge base of Atlas Support: the database embeds the question with its own ONNX model, and finds the nearest articles.
See what it returned
The output, as it ran. The right article comes first, though it shares almost no words with the question: that is search by meaning.
The code, and what it did
Every example ran in Oracle AI Database 26ai Free with Oracle APEX 26.1, and every screenshot was taken from the running application. Here are six of them, as they appear in the book.




Chapter 12: RAG in PL/SQL. The function retrieves the nearest articles and manuals, numbers them, and asks the model to answer only from them, with citations.
Real pages from the book
Chapters that open with what you will learn, code labeled SYNTAX, EXAMPLE, and OUTPUT, figures that explain the ideas, and screenshots of every APEX page at work. Click any page to read it.
Pages shown from the full-color edition. The Kindle and Apple Books editions show code and screenshots in color; the paperback is printed in black and white.
From the first vector to AI in production
The ideas behind AI applications, vector search in the database, generative AI from SQL and PL/SQL, AI in Oracle APEX, three complete projects, and what it takes to run them safely.
Five parts, 29 chapters
Read Part I to build the free AI lab and learn the ideas, then read on or go to the chapter you need. Six appendices hold the vector packages, APEX_AI, prompt patterns, troubleshooting, and a glossary.
Foundations
What the book covers, the free AI lab every example runs in, and the ideas behind AI applications.
- 1How to Use This Book
- 2The AI Lab
- 3AI for Oracle Developers
Vectors and Search in the Database
The VECTOR type, embeddings, vector indexes, search by meaning, and documents in chunks.
- 4The VECTOR Type
- 5Embeddings Inside the Database
- 6Embeddings from a Provider
- 7Vector Indexes
- 8Semantic and Hybrid Search
- 9Loading Documents
Generative AI in SQL and PL/SQL
Language models called from the database, RAG, natural language to SQL, and machine learning.
- 10Calling an LLM from the Database
- 11Practical Generation
- 12RAG in SQL and PL/SQL
- 13Natural Language to SQL
- 14Classic Machine Learning in the Database
- 15Vectors with JSON, Graphs, and Relational Data
AI in APEX
The AI of Oracle APEX 26.1, from AI services to agents that act, in the Atlas Support application.
- 16Generative AI in APEX
- 17The APEX_AI Package
- 18AI Assistants in Pages
- 19AI Agents
- 20AI in Forms and Workflows
- 21Search Pages in APEX
- 22APEX's Built-in AI for Developers
Projects and Production
Three complete projects, and what an AI application needs before real users rely on it.
- 23Project: the Atlas Knowledge Assistant
- 24Project: the AI Help Desk
- 25Project: Ask Your Data
- 26Running AI Locally
- 27Security and Privacy
- 28Quality, Cost, and Speed
- 29Deploying AI Applications
The Reference
What to look up while you work.
- AVector Packages and Functions
- BAPEX_AI and APEX's AI Components
- CSwitching Providers
- DPrompt Patterns
- ETroubleshooting AI Features
- FGlossary
AI where your data already is
Oracle AI Database 26ai stores vectors beside your rows, computes embeddings inside the database, and calls language models from SQL. Oracle APEX 26.1 adds AI services, agents, and AI pages on top. The book covers each of them, with the chapter where it is built.
Run in 26ai
Every example ran in Oracle AI Database 26ai Free, release 23.26, with Oracle APEX 26.1.
Real output
No answer was written by hand: the book prints what each query and each model returned.
One application
All examples belong to Atlas Support, the help desk of a software company, with its tickets and knowledge base.
A free lab
Oracle AI Database 26ai Free and APEX cost nothing, Chapter 2 shows how to get a free Gemini key, and Chapter 26 runs a model locally.
Vectors. Embeddings. RAG. AI agents. Each one built in SQL, PL/SQL, and APEX, and shown with the output it really returned.
- Paperback, 409 pages
- Kindle and Apple Books
- Free code on GitHub
Who is this book for?
Oracle developers who know SQL and PL/SQL and want to add AI features to their applications: PL/SQL developers, APEX developers, and architects who must decide what AI can do for their systems. No background in machine learning or Python is needed; Chapter 3 explains the ideas from the beginning.
Which versions does it cover?
Oracle AI Database 26ai and Oracle APEX 26.1. Every example ran in Oracle AI Database 26ai Free, release 23.26, with APEX 26.1, and the book marks what needs a newer release or another edition, such as Select AI of Autonomous Database, which Chapter 13 builds in PL/SQL instead.
Were the examples really run?
Yes. All 237 examples ran in the lab of Chapter 2, and the book prints the output each one returned, including the answers of the language models. Model answers differ from run to run, so yours will say the same things in other words.
Which AI models does it use?
An ONNX embedding model (all-MiniLM-L12-v2) runs inside the database. Google Gemini answers questions and writes text, through DBMS_VECTOR_CHAIN and the AI services of APEX. Chapter 26 runs a model locally with Ollama, and Appendix C shows how to switch to OpenAI, Cohere, Mistral, Anthropic, and other providers.
Do I need to pay for anything?
No. Oracle AI Database 26ai Free and Oracle APEX are free, and a Gemini key on the free tier is enough for every example of the book; Chapter 2 shows the setup. A key on a paid project raises the limits and keeps your prompts out of Google's training, and Chapter 28 shows what the calls cost.
What is Atlas Support?
The book's sample application: the help desk of a software company, with products, customers, agents, 400 tickets, a knowledge base of articles, and a library of PDF and Word manuals. Every example uses it, and Part V builds three AI projects on it in Oracle APEX.
Does it cover security and cost?
Yes. Chapter 27 covers credentials, network access, redaction of personal data, prompt injection, and row-level security for what an assistant retrieves. Chapter 28 measures answer quality, tokens, cost, and speed, and Chapter 29 deploys the application.
Where is the code?
On GitHub, free: github.com/devvinish/oracle-ai-book-code has all 237 examples with their output, the scripts that install the Atlas Support schema and its documents, and the finished APEX application.
Is the paperback in color?
The paperback is printed in black and white on white paper, 7.5 by 9.25 inches, 409 pages, with a glossy cover. The Kindle and Apple Books editions show the code, figures, and screenshots in color.
Paperback, Kindle, or Apple Books
Every edition has the same 29 chapters, six appendices, and index. Pick the paperback for your desk, and the Kindle or Apple Books edition for code and screenshots in color on any screen.
- Get the bookFrom Amazon or Apple Books, in the edition you prefer.
- Build the AI labOracle AI Database 26ai Free, APEX 26.1, and a Gemini key, as Chapter 2 describes.
- Run the examplesInstall Atlas Support from GitHub, and run every example as you read.
Paperback
$39.99on Amazon.com
- 409 pages, 7.5 × 9.25 in
- Black and white on white paper
- Glossy cover
- ISBN 9798178836798
Kindle edition
$12.99on Amazon.com
- Code and screenshots in color
- Reflowable on any Kindle
- Linked contents and index
- Kindle apps for phone, tablet and PC
Apple Books
Code and screenshots in color, on iPhone, iPad, and Mac.
$12.99on Apple Books
Buy on Apple BooksThe code of the book, free: every example with its output, the Atlas Support schema and documents, and the finished APEX application.
examples/the 237 examples and their output, one folder per chaptersetup/atlas/the Atlas Support schema, its data, and its documentsapex/the finished Atlas Support application