[HN Gopher] Building agents using streaming SQL queries
       ___________________________________________________________________
        
       Building agents using streaming SQL queries
        
       Author : rmoff
       Score  : 85 points
       Date   : 2025-06-18 15:38 UTC (7 hours ago)
        
 (HTM) web link (www.morling.dev)
 (TXT) w3m dump (www.morling.dev)
        
       | simonw wrote:
       | This combines a bunch of different things, but the key idea
       | appears to be having a Flink (stream processing server) SQL query
       | set up that effectively means that new documents added to the
       | data store trigger a query that then uses an LLM (via a custom
       | SQL function) to e.g. calculate a summary of a paper, then feeds
       | that on to something that sends an alert to Slack or similar.
       | 
       | So this is about running LLM prompts as part of an existing
       | streaming data processing setup.
       | 
       | I guess you could call a trigger-based SQL query an "agent",
       | since that term is wide open to being defined however you want to
       | use it!
        
         | gunnarmorling wrote:
         | Author here, thanks for reading and commenting! Indeed my
         | conclusion is that "agent" means different things to different
         | people. The idea for this post was to explore what's there
         | already and what may be missing for using SQL in this context.
         | When following Anthropic's taxonomy, as of today, SQL let's you
         | get quite far for building workflows. For agents in their
         | terminology, some more work is needed to integrate things like
         | MCP, but I don't see any fundamental reasons for why this
         | couldn't be done.
        
       | nilirl wrote:
       | This felt forced.
       | 
       | If you read through the whole thing, they don't manage to build
       | an AI Agent, they make LLM API calls using Flink's SQL.
       | 
       | They admit making it agentic, with choice over tool selection and
       | with agent-like memory, requires workarounds.
       | 
       | Annoying workarounds, imo.
       | 
       | The post mentions work is in progress to build agents that use
       | Flink without using Flink SQL.
       | 
       | Thereby invalidating it's own title.
        
         | esafak wrote:
         | Perhaps a charitable take is that this is a musing on how to
         | use immutability for building agents? Maybe a functional
         | approach would be less constrictive than SQL.
        
           | tra3 wrote:
           | Indeed. I'm very curious about the original source of
           | inspiration for the post, "That microservice should have been
           | a SQL query". It's not as catchy without AI though.
        
           | nilirl wrote:
           | How did it make an argument for immutability?
        
       | philipodonnell wrote:
       | I've built lots of pre-LLM data processing pipelines like this
       | and the more I read people putting "agents" into this kind of
       | context the less they resemble agents like the Anthropics of the
       | world defines and the more they just resemble functions. I wonder
       | if eventually there won't be a distinction and it'll just be a
       | way to make processing and branching nodes in a pipeline less
       | deterministic when you need more flexibility than pure code-rules
       | can give you.
        
       ___________________________________________________________________
       (page generated 2025-06-18 23:00 UTC)