top | item 46992136

Show HN: Pgclaw – A "Clawdbot" in every row with 400 lines of Postgres SQL

48 points| calebhwin | 17 days ago |github.com

Hi HN,

Been hacking on a simple way to run agents entirely inside of a Postgres database, "an agent per row".

Things you could build with this: * Your own agent orchestrator * A personal assistant with time travel * (more things I can't think of yet)

Not quite there yet but thought I'd share it in its current state.

33 comments

order

maxbond|17 days ago

What's the advantage in putting agents in the persistence layer rather than the application layer? This seems to me strictly less flexible, scalable, secure, easy to work with... I am having a hard time imagining why I would want to integrate with APIs or write an agentic harness in the database rather than in application code?

Maybe I'm behind the times but I don't understand.

4ndrewl|17 days ago

It's similar to when we wrote all our business logic in eg pl/sql, stored procedures etc. Seems attractive at first, but it breaks separation of concerns, becomes difficult to test etc.

tibbar|17 days ago

This is mind-bending. I can't imagine that it performs well enough to be particularly fit for production just yet but..... wow.

swyx|17 days ago

how exactly is adding a stored procedure as an agent mind bending

wwweston|17 days ago

This... does not seem like separation of concerns.

Not to mention that the data layer seems like the one where you want to keep things most deterministic.

nkmnz|17 days ago

If you really want to run an agent on each created row, you could run this in a replica and stream the replies back to your system of record.

noupdates|17 days ago

To decouple this the person would have to broadcast nearly every event and rebuild the observer layers elsewhere.

jmaw|16 days ago

What does it mean to put an agent inside of a PG DB? Is PG doing the actual computing/inference (does it tie to GPU), or is PG just storing the state of the agents neural net (is that a thing, it seems like it would be).

Maybe I'm strictly too stupid to even parse the concept, but I don't understand what I'm looking at one bit.

debugnik|17 days ago

I don't understand why claw is a data type for columns in these examples, it doesn't seem to store any actual per-row state. Is it not possible to hook extensions onto "with" clauses or something similar?

rel_ic|17 days ago

We need your help! Can you please use your creativity to build resilience to climate change in your community instead of experimenting with more ways to spend computing power?

brunoqc|17 days ago

The solution is to tax the rich. But we won't.

xnx|17 days ago

It feels like we're a week away from the Claw hype supplanting AI hype. Companies will start renaming things ClawX to get on the hype bandwagon.

maxbond|17 days ago

I think "claw" isn't appealing enough to be genericized and that "agent" will continue to be the generic term, but we'll see.

calebhwin|17 days ago

It's just an abstraction people are excited about at the moment. Langchain was an exciting abstraction at one point.

My bet is we converge on a super minimal model<>computer architecture.

ef2k|17 days ago

Nice. These are the kind of boundary pushing projects I like to see. It challenges assumptions of where application logic should live. The implications around cost, latency, and recovery are going to be interesting.

readme|17 days ago

i love postgres and pgvector... this is exactly to my tastes

calebhwin|17 days ago

Same, it's in a similar vein as pgvector - probably not as performant as turbopuffer or chroma but you get the benefits of being in a really nice ecosystem.

danr4|17 days ago

this is fucking awesome