maayanlevy/mysql-ailike

Natural-language row filtering for MySQL, powered by TypeSafe Jev.

C++

1

13 commits

updated Sep 20, 2026

See the code

See what people are saying (1)

README

AILIKE for MySQL, powered by JEV

A native MySQL plugin for filtering rows and comparing text columns with natural-language conditions, powered by TypeSafe Jev.

Install and check compatibility · Try the Docker demo

Preview release. Requires a TypeSafe API key. Note: evaluated values and prompts are sent to TypeSafe.

Match by meaning

Find columns based on NL meaning:

SELECT film_id, title, description
FROM sakila.film
WHERE film_id BETWEEN 1 AND 8
  AND description AILIKE 'The story takes place somewhere in Asia';

AILIKE matches three Sakila films set in Ancient China or India.

Syntax

SyntaxQuestion
column AILIKE 'condition'Does this value satisfy the condition?
ailike(value, prompt)Does this value satisfy the condition?
ailike(left, right, prompt)Do these values satisfy the relationship?

AILIKE returns 1 for a match and 0 otherwise. Any NULL argument returns NULL. Arguments are string. use CAST(... AS CHAR) for other types.

Narrow candidates with ordinary SQL conditions: each uncached evaluation makes an API request.

Compare joined columns

The demo dataset contains three supplier products and three catalog products. With AILIKE installed, open mysql -u root -p from the repository root and load it into a fresh database:

CREATE DATABASE ailike_join_demo;
USE ailike_join_demo;
SOURCE sql/join-demo.sql;

Pass both columns and describe the relationship:

SELECT a.id AS supplier_id, a.description AS supplier,
       b.id AS catalog_id, b.description AS catalog
FROM supplier_products AS a
JOIN catalog_products AS b
  ON a.category_id = b.category_id
 AND ailike(
   a.description,
   b.description,
   'Left and right describe the same kind of product, '
   'with matching material and key features. Wording may differ.'
 )
ORDER BY a.id, b.id;

Expected matches: (1, 1) for the steel bottle and vacuum flask, and (3, 3) for the headphones. The glass carafe and plastic bottle have no matching pair.

AILIKE joins the steel bottle with the vacuum flask and the two headphone descriptions.

More examples

Row-level semantic search

Match semantic meaning without searching for exact phrases:

SELECT film_id, title, description
FROM sakila.film
WHERE film_id BETWEEN 1 AND 8
  AND description AILIKE 'The story features somebody whose profession is preparing food';

AILIKE matches AFRICAN EGG, whose description mentions a pastry chef.

Format-independent date/period match
SELECT rental_id, rental_date
FROM sakila.rental
WHERE customer_id = 1
  AND ailike(CAST(rental_date AS CHAR),
             'In July 2005')
ORDER BY rental_id;

AILIKE matches twelve July 2005 rentals for customer 1.

AILIKE returns a model judgment. Use SQL date functions for exact comparisons.

Contributing · Report a vulnerability · AI coding agent skill · GPL-2.0-only

Contributors

maayanlevy

13 commits

maayanlevy/mysql-ailike

Natural-language row filtering for MySQL, powered by TypeSafe Jev.

C++

1

13 commits

updated Sep 20, 2026

See the code

See what people are saying (1)

README

AILIKE for MySQL, powered by JEV

A native MySQL plugin for filtering rows and comparing text columns with natural-language conditions, powered by TypeSafe Jev.

Install and check compatibility · Try the Docker demo

Preview release. Requires a TypeSafe API key. Note: evaluated values and prompts are sent to TypeSafe.

Match by meaning

Find columns based on NL meaning:

SELECT film_id, title, description
FROM sakila.film
WHERE film_id BETWEEN 1 AND 8
  AND description AILIKE 'The story takes place somewhere in Asia';

AILIKE matches three Sakila films set in Ancient China or India.

Syntax

SyntaxQuestion
column AILIKE 'condition'Does this value satisfy the condition?
ailike(value, prompt)Does this value satisfy the condition?
ailike(left, right, prompt)Do these values satisfy the relationship?

AILIKE returns 1 for a match and 0 otherwise. Any NULL argument returns NULL. Arguments are string. use CAST(... AS CHAR) for other types.

Narrow candidates with ordinary SQL conditions: each uncached evaluation makes an API request.

Compare joined columns

The demo dataset contains three supplier products and three catalog products. With AILIKE installed, open mysql -u root -p from the repository root and load it into a fresh database:

CREATE DATABASE ailike_join_demo;
USE ailike_join_demo;
SOURCE sql/join-demo.sql;

Pass both columns and describe the relationship:

SELECT a.id AS supplier_id, a.description AS supplier,
       b.id AS catalog_id, b.description AS catalog
FROM supplier_products AS a
JOIN catalog_products AS b
  ON a.category_id = b.category_id
 AND ailike(
   a.description,
   b.description,
   'Left and right describe the same kind of product, '
   'with matching material and key features. Wording may differ.'
 )
ORDER BY a.id, b.id;

Expected matches: (1, 1) for the steel bottle and vacuum flask, and (3, 3) for the headphones. The glass carafe and plastic bottle have no matching pair.

AILIKE joins the steel bottle with the vacuum flask and the two headphone descriptions.

More examples

Row-level semantic search

Match semantic meaning without searching for exact phrases:

SELECT film_id, title, description
FROM sakila.film
WHERE film_id BETWEEN 1 AND 8
  AND description AILIKE 'The story features somebody whose profession is preparing food';

AILIKE matches AFRICAN EGG, whose description mentions a pastry chef.

Format-independent date/period match
SELECT rental_id, rental_date
FROM sakila.rental
WHERE customer_id = 1
  AND ailike(CAST(rental_date AS CHAR),
             'In July 2005')
ORDER BY rental_id;

AILIKE matches twelve July 2005 rentals for customer 1.

AILIKE returns a model judgment. Use SQL date functions for exact comparisons.

Contributing · Report a vulnerability · AI coding agent skill · GPL-2.0-only

Contributors

maayanlevy

13 commits

Languages

C++

69.6%

Python

24.0%

Dockerfile

2.9%

CMake

2.7%