Story

Show HN: PgCortex – AI enrichment per Postgres row, zero transaction blocking

supreeth_ravi Tuesday, February 17, 2026

Hi HN,

Been working on a way to get "agent-per-row" behavior in Postgres without actually running LLMs inside the database.

The problem: Calling LLMs from triggers/functions blocks transactions, exhausts connections, and breaks ACID. Saw some projects doing this and it felt dangerous for production.

The solution: DB-adjacent architecture. Lightweight triggers enqueue jobs to an outbox table. An external Python worker (agentd) polls, executes AI calls, and writes back safely with schema validation and CAS.

What you can build:

Auto-classify support tickets on INSERT

Content moderation that doesn't block your app

Lead scoring, fraud detection, and invoice extraction

Anything where data arrives and needs AI enrichment

Works with OpenAI, Anthropic, OpenRouter, or any Agent.

One SQL line to add AI to any table:

SELECT agent_runtime.agent_watch('tickets', 'id', 'classifier', 'v1', '{"priority":"$.priority"}');

Includes 9 example use cases in the repo. Would love feedback on the architecture.

1 0
github.com
Visit article Read on Hacker News