HeadlinesBriefing favicon HeadlinesBriefing.com

Pgclaw Embeds AI Agents as Postgres Columns

Hacker News: Front Page •
×

Developer Caleb Win has built pgclaw, an open-source Postgres extension that treats AI agents as a native column data type. The core idea is an 'agent per row,' allowing each database row to host its own configurable LLM or stateful agent. The project is compact, implemented in roughly 400 lines of Postgres SQL and Rust.

This approach leverages Postgres's ACID compliance and existing tooling. Agents are defined in a `claw.agents` table and can be simple prompts or complex, memory-equipped systems. It integrates with over a dozen LLM providers via the rig framework and supports agents with filesystem workspaces using Claude Code for code execution tasks.

The system works via a background worker that polls a queue triggered on row inserts or updates. The agent's response, formatted as JSON, can update columns in its own row. This tightly couples agent logic and data, enabling patterns like autonomous ticket triage or row-level personal assistants directly within the database, eliminating the need for separate orchestration layers.