PostgreSQL Extension pgjev Released, Supporting Natural Language Filtering Without Embeddings
Key point
The PostgreSQL extension pgjev has been released, enabling natural language row filtering in SQL WHERE clauses without embeddings or vector columns.
Details
Developer Zachi released the pgjev PostgreSQL extension. This tool allows filtering data rows using natural language conditions in SQL WHERE clauses without generating embeddings or requiring vector columns.
Differences from Existing Methods
Existing Full Text Search only supports keyword matching, pgvector is limited to returning similarity rankings, and calling LLMs within apps is difficult to combine with SQL operations. pgjev uses TypeSafe's Jev(System One) model to return Calibrated Probability instead of text generation. This ensures compatibility with standard SQL operations such as AND, ORDER BY, and GROUP BY, and requires no index or vector column preparation.
Performance and Cost Structure
pgjev adopts a full-scan structure and does not use indexes. As of v0.2.0, a query on 2,000 rows takes approximately 3.5 seconds, a significant improvement over the 8.5 seconds in v0.1.0. Request latency was reduced through batch size optimization (adjusted from 40 rows to 20 rows), streaming reads, and TLS connection reuse. Costs are billed based on input tokens, amounting to approximately $0.012 for a 2,000-row query. Cache re-runs are very fast, taking about 50ms.
Adoption Conditions and Limitations
A self-hosted PostgreSQL environment requires superuser privileges and the plpython3u extension. Usage may be restricted on managed databases such as Supabase, Neon, and RDS due to plpython3u being blocked. Additionally, since entire data rows are sent to the TypeSafe API, it is unsuitable for sensitive data that cannot be transmitted externally. It is inappropriate for large datasets of hundreds of thousands of rows or more; it is recommended to apply it after reducing the target rows using index conditions.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.