# Building AI agents as streaming SQL queries with Apache Flink

DevFeed: [Building AI agents as streaming SQL queries with Apache Flink](<https://devfeed.tech/articles/this-ai-agent-should-have-been-a-sql-query-18880.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/this-ai-agent-should-have-been-sql-query/>)

Published: 2025-06-18T13:30:00Z

Content type: article

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [apache-flink](<https://devfeed.tech/topics/apache-flink.md>), [event driven](<https://devfeed.tech/topics/event-driven.md>), [Scalability](<https://devfeed.tech/topics/scalability.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Developer experience](<https://devfeed.tech/topics/developer-experience.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [apache-flink](<https://devfeed.tech/tags/apache-flink.md>), [developer-experience](<https://devfeed.tech/tags/developer-experience.md>), [event-driven](<https://devfeed.tech/tags/event-driven.md>), [llms](<https://devfeed.tech/tags/llms.md>), [scalability](<https://devfeed.tech/tags/scalability.md>), [sql](<https://devfeed.tech/tags/sql.md>), [streaming](<https://devfeed.tech/tags/streaming.md>)

## AI overview

This article explores whether AI agents can be built as streaming SQL queries. It presents Apache Flink and stream-processing concepts as potential foundations for event-driven, scalable, consistent, low-latency agentic systems, while noting that many deployed agents are defined AI-assisted workflows.

## Source excerpt

Table of Contents Agents Need to Interact With LLMs Agents Should Be Event-Driven Agents Need Context Agents Require Memory When SQL Is Not Enough Parting Thoughts AI Agents have improved in leaps and bounds in recent times, moving beyond simple chatbots to sophisticated, autonomous systems. This post explores a novel approach to building agentic systems: using the power of streaming SQL queries. Discover how platforms like Apache Flink can transform the development of AI Agents, offering benefits in consistency, scalability, and developer experience.