pg-jev
PostgreSQL extension with jev(), jev_prob, jev_choice and jev_score to filter, rank and classify rows by plain-language conditions.
Overview
pg-jev is a PostgreSQL extension that lets you filter, rank and classify rows with plain-language conditions judged by TypeSafe's Jev, with no index, embeddings or vector column. jev(table, 'condition') is an ordinary boolean function that composes with SQL; jev_prob returns the probability for ranking; jev_choice picks one of an array of labels; and jev_score rates rows on ordered levels.
Under the hood, the first call starts a read-ahead that streams the table, packs 20 rows per request into one shared state with one Noul question per row, and keeps several requests in flight over persistent HTTPS connections, so LIMIT stops early and cheaper predicates evaluated first skip rows. The README says batching amortises request overhead, from about 435 tokens for a single row to about 175 per row in batches of 20. Answers are cached per row content and question for the session, so re-sorting or changing thresholds is free. It is on PGXN with CI and a website; the list notes a custom licence.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Does this row satisfy the condition (e.g. the customer is angry)? | yes · no |
| Choice | Which team should handle this? | billing · technical · security · sales |
| Score | How luxurious is this product? | budget · mid-range · premium · luxury |
How it works
- CREATE EXTENSION jev.
- Use jev(), jev_prob, jev_choice or jev_score in queries.
- Rows are batched 20 per request with parallel in-flight calls.
- Answers are cached per row and question.
Strengths
- Natural-language predicates in plain SQL.
- Batching and caching cut cost.
- Composes with joins, LIMIT and cheaper predicates.
Caveats
- Each new row/condition pair is an API call.
- Row data is sent to TypeSafe.
Getting started
CREATE EXTENSION jev CASCADE; then SELECT * FROM people WHERE jev(people, 'the name is European');At a glance
- Type
- Plugin
- Status
- beta
- Language
- C
- Runtime
- PostgreSQL extension
- Has code
- yes
- Has tests
- yes
- License
- Custom license
Use cases and integrations
How curated lists describe it
PostgreSQL: extension that filters, ranks and classifies rows by plain-language conditions, so `WHERE jev(people, 'the name is European')`, `jev_prob` and `jev_choice` each put one Jev judgment per row with calibrated probabilities.
yibie/awesome-jevPostgreSQL extension: `jev()`, `jev_prob`, `jev_choice`, and `jev_score` filter, rank, and classify rows with plain-language conditions judged by Jev, with no embeddings or vector column
AnotiaWang/awesome-decision-modelsAdds natural-language filtering, classification, and ranking of rows to PostgreSQL queries.
logicrw/awesome-jev-projectsAsk your Postgres tables questions in plain language.
wh000wh000/awesome-jev-livePostgreSQL extension for semantic questions over table rows.
cobanov/awesome-jevAsk your Postgres tables questions in plain language. A PostgreSQL extension powered by TypeSafe's Jev.
hellogumbo/awesome-jevPostgreSQL extension to filter, rank, and classify rows with plain-language conditions.
MrJev/awesome-jev
Frequently asked questions
Does it need embeddings?
No, each row is judged directly by Jev.
How does it control cost?
It batches 20 rows per request, stops at LIMIT, and caches answers per session.
Can I rank by probability?
Yes, ORDER BY jev_prob(...).
Related projects
dbt package and Terraform module adding jev_noul, jev_choice, jev_score and jev_ask SQL functions to Snowflake.
LibrarybetaSQLdbt package whose macros run Jev Choice, Noul and Score over SQL values in DuckDB and ClickHouse models.
ProjectbetaSQL (Jinja)DuckDB extension that asks Jev about every row in SQL and returns answers as ENUM, DOUBLE or STRUCT columns.
PluginbetaC++CLI that scans tabular, structured and text files or databases and asks Jev which fields look anomalous, building a review queue.
CLIbetaPythonDuckDB extension that labels rows in CSV, Parquet or DuckDB tables with Jev, reported at about ten seconds per thousand rows.
DiscussionprototypeNative MySQL plugin adding an AILIKE operator that asks Jev whether a value satisfies a natural-language condition.
PluginbetaC++