Remix.run Logo
swyx 5 hours ago

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

tibbar 4 hours ago | parent [-]

I can only speak for my own mind ;) but the most advanced thing I'd seen prior in this regard was Google Sheets' =AI function, which is pretty convenient (if awkward) when you want to map values to LLM output.

What I specifically found "mind-bending" about this is that I don't have a clear concept of the limits of what an agent can do. In the limit case, it's basically like an independent employee, right?. So the concept of having a dedicated person sitting on each row of my database and transactionally performing any task I can describe is ... well, it IS a bit boggling to me.

Another way to look at it is: this is an extremely powerful construct for managing fleets of agents. I trust Postgres to execute all the stored procedures I ask it to. So with this tool I can easily spin up arbitrarily many agents. And state management is very simple, because they can directly edit their associated row!

IDK, the more I think about it the more fascinated I am. I'm sure there is some open source SAAS or something that has similar semantics and can do all this more efficiently, but now I know that this is a category of thing one could potentially build/use. Pretty nifty!

renato_shira 2 hours ago | parent | next [-]

the "agent per row" framing is what makes this click for me too. most agent frameworks think in terms of orchestration graphs or message queues, but modeling it as "each row has a little worker that can act on its own state" is a surprisingly intuitive primitive.

it also maps well to how a lot of real world problems actually work: you have N entities, each with their own context, and you want something watching each one independently. the traditional way to do that is a job queue polling the database, but if the database is the compute layer, you skip a whole class of sync/consistency problems.

probably not production ready for anything serious, but i've seen this pattern before where "weird" database experiments end up influencing real tools later. json columns were an antipattern until jsonb became a legitimate design choice. triggers were considered dangerous until supabase made realtime features out of them. the boundary keeps shifting.

swyx 4 hours ago | parent | prev | next [-]

ok nice reply. i think i was where you were in 2021 around doing stuff in sprocs. i think pple generally follow a cycle of going overexcited about throwing everything in the database and then going "actually the database is a pretty bad production compute environment" and re-separating concerns back to different levels.

use sprocs lightly for simple fast stateless things. every other attempt at stuffing a lot of compute into the database that i'm aware of has basically failed to gain adoption (the personal awesomeness/happiness of the guy who created it aside)

4 hours ago | parent | prev [-]
[deleted]