Skip to content

jev

Natural-language row filtering, ranking and classification through a Jev-compatible API

jev · Natural-language row filtering, ranking and classification through a Jev-compatible API

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
1900jevjev0.2.1RAGPostgreSQLPython
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
----d--NoNoNoYesnono
Relationships
Schemaspublic
Requiresplpython3u
typesafe.ai needs an API key; configured endpoints receive row contents.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.2.119 18 17 16 15jevplpython3u
RPMPIGSTY0.2.119 18 17 16 15jev_$vpostgresql$v-plpython3
DEBPIGSTY0.2.119 18 17 16 15postgresql-$v-jevpostgresql-plpython3-$v
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
el8.aarch64N/APIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
el9.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
el9.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
el10.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
el10.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
d12.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
d12.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
d13.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
d13.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
u22.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
u22.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
u24.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
u24.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
u26.x86_64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1
u26.aarch64PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1PIGSTY 0.2.1

Source

pig build pkg jev;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install jev;		# install by package name

pig install jev -v 19;   # install for PG 19
pig install jev -v 18;   # install for PG 18
pig install jev -v 17;   # install for PG 17
pig install jev -v 16;   # install for PG 16
pig install jev -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION jev CASCADE; -- requires plpython3u

Usage

Sources:

jev filters, ranks and classifies rows using natural-language conditions evaluated by a configured Jev-compatible API. It requires plpython3u, superuser installation; TypeSafe-hosted endpoints also require an API key. The upstream documented PostgreSQL range is 14–17; no preload is needed.

Query rows

CREATE EXTENSION jev CASCADE;
SET jev.api_key = 'your-key';
CREATE TABLE jev_demo (id integer, body text);
INSERT INTO jev_demo VALUES (1, 'The customer requests a refund');
SELECT id, jev_prob(jev_demo, 'the customer requests a refund')
FROM jev_demo;
SELECT jev_stats();

jev() returns a boolean predicate; jev_prob() returns a probability. jev_choice() classifies among options, and jev_score() evaluates ordered levels. Cache and connection pools are session-local; jev_cache_clear() clears session state.

Service and data boundaries

Row contents are transmitted to the configured API. Set jev.api_url for the intended service and use jev.max_rows_per_statement and jev.max_chars_per_statement to cap work. API latency and charges depend on the service and data volume. The API key must be handled as a credential.

PL/Python runs with server operating-system privileges. Hosts that withhold superuser access or PL/Python cannot run this extension. Local package tests use the upstream mock API; they do not validate the remote model’s judgment quality.

0.2.1 Endpoints

In 0.2.1, jev.api_key is required only for *.typesafe.ai hosts. For a locally operated or other compatible endpoint, unset keys omit the Authorization header; a configured key is still sent. Set jev.api_url to the intended trusted service. Install the matching files and run ALTER EXTENSION jev UPDATE for 0.2.0 databases. Model accuracy and data-handling policy still depend on the chosen service.

Table reader