AI‑Powered Vector Database Implementation on Popular RDBMSs
(Patent Pending)
Overview
Relational database management systems (RDBMSs) traditionally rely on exact-match
queries, keyword searches, or manually defined indexes to retrieve records. These
approaches require users to know the precise structure, wording, or schema of stored
data and are entirely ineffective when queries are expressed in natural language or
when semantic equivalence is required. For example, a query for "force equals mass
times acceleration" cannot retrieve a record containing "Isaac Newton" using
conventional SQL alone. We have developed semantic search query capability that can run on
PostgreSQL (with pgvector)
Oracle 23ai/26ai or later
SQL Server 2025 or later
MariaDB (11.4 or 11.7 or later)
Demo with MariaDB 12.1.2
Table Schema & Indexing:
CREATE DATABASE salesdb;
USE salesdb;
CREATE TABLE IF NOT EXISTS thing (
id INT PRIMARY KEY auto_increment,
content TEXT,
content_vec VECTOR(1024) NOT NULL,
VECTOR INDEX (content_vec)
);
/* Table entries */
select id, content from thing;
MariaDB [salesdb]> select id, content from thing;
+----+--------------------------+
| id | content |
+----+--------------------------+
| 1 | Isaac Newton |
| 2 | Jane Austen |
| 3 | Wolfgang Amadeus Mozart |
| 4 | Ludwig van Beethoven |
| 5 | Albert Einstein |
| 6 | Charles Dickens |
| 7 | William Shakespeare |
| 8 | Mark Twain |
| 9 | Leo Tolstoy |
| 10 | Fyodor Dostoevsky |
| 11 | J.K. Rowling |
| 12 | George Orwell |
| 13 | Ernest Hemingway |
| 14 | F. Scott Fitzgerald |
| 15 | Homer |
| 16 | Dante Alighieri |
| 17 | Miguel de Cervantes |
| 18 | Victor Hugo |
| 19 | Mary Shelley |
| 20 | Agatha Christie |
| 21 | Arthur Conan Doyle |
| 22 | J.R.R. Tolkien |
| 23 | C.S. Lewis |
| 24 | H.G. Wells |
| 25 | Jules Verne |
| 26 | Emily Bronte |
| 27 | Charlotte Bronte |
| 28 | Virginia Woolf |
| 29 | Franz Kafka |
| 30 | Sun Tzu |
| 31 | Confucius |
| 32 | Plato |
| 33 | Aristotle |
| 34 | Niccolo Machiavelli |
| 35 | Galileo Galilei |
| 36 | Nicolaus Copernicus |
| 37 | Johannes Kepler |
| 38 | Marie Curie |
| 39 | Niels Bohr |
| 40 | Michael Faraday |
| 41 | James Clerk Maxwell |
| 42 | Alan Turing |
| 43 | Ada Lovelace |
| 44 | Grace Hopper |
| 45 | Tim Berners-Lee |
| 46 | Linus Torvalds |
| 47 | Steve Jobs |
| 48 | Pablo Picasso |
| 49 | Leonardo da Vinci |
| 50 | Vincent van Gogh |
| 51 | Michelangelo |
| 52 | Raphael |
| 53 | Salvador Dali |
| 54 | Claude Monet |
| 55 | Rembrandt |
| 56 | Johann Sebastian Bach |
| 57 | Pyotr Ilyich Tchaikovsky |
| 58 | Antonio Vivaldi |
| 59 | Chopin |
| 60 | Richard Wagner |
| 61 | Igor Stravinsky |
| 62 | Miles Davis |
| 63 | Louis Armstrong |
| 64 | The Beatles |
| 65 | Bob Dylan |
| 66 | Michael Jackson |
| 67 | Elvis Presley |
| 68 | William Wordsworth |
| 69 | T.S. Eliot |
| 70 | Robert Frost |
| 71 | Pablo Neruda |
| 72 | Gabriel Garcia Marquez |
| 73 | Haruki Murakami |
| 74 | Chinua Achebe |
| 75 | Khaled Hosseini |
| 76 | Stephen King |
| 77 | Dan Brown |
| 78 | Suzanne Collins |
| 79 | George R.R. Martin |
| 80 | Neil Gaiman |
| 81 | Margaret Atwood |
| 82 | Yuval Noah Harari |
| 83 | Malala Yousafzai |
| 84 | Nelson Mandela |
| 85 | Martin Luther King Jr. |
| 86 | Mahatma Gandhi |
| 87 | Winston Churchill |
| 88 | Sigmund Freud |
| 89 | Carl Jung |
| 90 | Jean-Paul Sartre |
| 91 | Simone de Beauvoir |
+----+--------------------------+
/* Search “author of fur elise”, database returns table entry “ludwig van beethoven”. */
call semantic_search_thing('author of fur elise','EN',1);
MariaDB [salesdb]> call semantic_search_thing('author of fur elise','EN',1);
+----------------------+----------------------+-------+
| content | qry | score |
+----------------------+----------------------+-------+
| Ludwig van Beethoven | ludwig van beethoven | 3 |
+----------------------+----------------------+-------+
call semantic_search_thing('author of turkish march','EN',1);
MariaDB [salesdb]> call semantic_search_thing('author of turkish march','EN',1);
+-------------------------+-------------------------+-------+
| content | qry | score |
+-------------------------+-------------------------+-------+
| Wolfgang Amadeus Mozart | wolfgang amadeus mozart | 3 |
+-------------------------+-------------------------+-------+
/* Search “author of to be or not to be, that is the question”, database returns table entry “William Shakespeare”. */
MariaDB [salesdb]> call semantic_search_thing('author of to be or not to be, that is the question','EN',1);
+---------------------+---------------------+-------+
| content | qry | score |
+---------------------+---------------------+-------+
| William Shakespeare | William Shakespeare | 3 |
+---------------------+---------------------+-------+
/* Search “force equals mass times acceleration”, database returns table entry “Isaac Newton” */
call semantic_search_thing('force equals mass times acceleration','EN',1);
MariaDB [salesdb]> call semantic_search_thing('force equals mass times acceleration','EN',1);
+--------------+--------------+-------+
| content | qry | score |
+--------------+--------------+-------+
| Isaac Newton | Isaac Newton | 3 |
+--------------+--------------+-------+
/* Search “energy equals mass times speed of light squared”, database returns table entry “Albert Einstein”. */
call semantic_search_thing('energy equals mass times speed of light squared','EN',1);
MariaDB [salesdb]> call semantic_search_thing('energy equals mass times speed of light squared','EN',1);
+-----------------+-----------------+-------+
| content | qry | score |
+-----------------+-----------------+-------+
| Albert Einstein | Albert Einstein | 3 |
+-----------------+-----------------+-------+
/* Search “author of David Copperfield”, database returns table entry “Charles Dickens”. */
call semantic_search_thing('author of David Copperfield','EN',1);
+-----------------+-----------------+-------+
| content | qry | score |
+-----------------+-----------------+-------+
| Charles Dickens | Charles Dickens | 3 |
+-----------------+-----------------+-------+
/* Search “author of war and peace”, database returns table entry “Leo Tolstoy”. */
call semantic_search_thing('author of war and peace','EN',1);
MariaDB [salesdb]> call semantic_search_thing('author of war and peace','EN',1);
+-------------+-------------+-------+
| content | qry | score |
+-------------+-------------+-------+
| Leo Tolstoy | Leo Tolstoy | 3 |
+-------------+-------------+-------+