<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-agentic-workflows-that-query-millions-of-rows-a-real-world-guide-with-agentkit-nrmagxu5c" -->

---
title: Building Agentic Workflows That Query Millions of Rows:...
description: A case study describes building a multi-agent system with Inngest AgentKit that lets users query 3.5 million powerlifting records using natural language. The...
canonical: https://daily.dev/posts/building-agentic-workflows-that-query-millions-of-rows-a-real-world-guide-with-agentkit-nrmagxu5c
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building Agentic Workflows That Query Millions of Rows: A Real-World Guide with AgentKit | daily.dev
og:description: A case study describes building a multi-agent system with Inngest AgentKit that lets users query 3.5 million powerlifting records using natural language. The...
og:url: https://daily.dev/posts/building-agentic-workflows-that-query-millions-of-rows-a-real-world-guide-with-agentkit-nrmagxu5c
og:image: https://api.daily.dev/og/posts/nrmaGXU5c.png
og:image:alt: Building Agentic Workflows That Query Millions of Rows: A Real-World Guide with AgentKit
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building Agentic Workflows That Query Millions of Rows: A Real-World Guide with AgentKit

**[Inngest Blog](https://daily.dev/sources/inngest)** · 8 min read · 0 upvotes · 0 comments

## Summary

A case study describes building a multi-agent system with Inngest AgentKit that lets users query 3.5 million powerlifting records using natural language. The architecture uses three specialized agents (routing with Claude Haiku, query generation with Claude Opus, summarization with Gemini 2.5 Pro) backed by a ClickHouse database. Instead of embeddings or retrieval, the system converts natural language into structured tool calls against a strongly-typed schema, giving deterministic, inspectable data access. The post includes full agent and tool code, example query conversions, and a React hook (useAgent) for streaming agent output to a frontend.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.inngest.com/blog/building-agentic-workflows-that-can-query>

## Questions this post answers

### How can I let an LLM query a large SQL-like database without using embeddings or retrieval?

Convert natural language directly into structured tool calls rather than relying on embeddings or retrieval-based search. In one implementation, a dedicated agent is prompted with the full database schema and few-shot examples, then exclusively calls a typed function such as get_meet_results(filters, orderBy, sortDirection, limit) that maps to a parameterized ClickHouse query, giving deterministic and inspectable data access across 3.5 million rows.

_daily.dev surfaces practical patterns like this for developers architecting LLM-to-database query systems._

### How do I split responsibilities across multiple LLM agents in a single workflow?

One effective pattern uses three specialized agents with distinct models: a routing agent (Claude Haiku) decides whether a query needs database access, a query agent (Claude Opus) converts natural language into structured queries, and a summary agent (Gemini 2.5 Pro) interprets raw results for the user. Each agent is built and tested in isolation, then composed into a single orchestrated network using a framework like Inngest AgentKit.

_developers designing agent pipelines can track architecture patterns like this via daily.dev._

### How do I stream real-time AI agent output to a React frontend without managing websockets myself?

The useAgent React hook from @inngest/use-agent exposes messages, sendMessage, and status directly, handling the underlying connection so no manual websocket management, state stores, or connection handling code is required. Messages arrive as parts that can be rendered by type, such as text, letting a chat-style UI stream agent responses in real time.

_daily.dev helps developers building streaming AI chat interfaces stay on top of tools like this._

## Similar posts on daily.dev

- [Designing a Multi-Agent System for Engineering Support at Scale: A Case Study From Grab](https://daily.dev/posts/designing-a-multi-agent-system-for-engineering-support-at-scale-a-case-study-from-grab-2dxw8zpbf) · InfoQ · 0 upvotes · 0 comments
- [Karpathy's Agentic Engineering Finally Has Proper Tooling](https://daily.dev/posts/karpathy-s-agentic-engineering-finally-has-proper-tooling-wm38wjfvk) · Daily Dose of Data Science \| Avi Chawla \| Substack · 0 upvotes · 0 comments
- [How Grab is Using AI Agents to Boost Team Productivity](https://daily.dev/posts/how-grab-is-using-ai-agents-to-boost-team-productivity-fkppsh0tc) · ByteByteGo · 2 upvotes · 0 comments
- [From firefighting to building: How AI agents restored our team’s core productivity](https://daily.dev/posts/from-firefighting-to-building-how-ai-agents-restored-our-team-s-core-productivity-zfyvdslnl) · Grab Tech Blog · 2 upvotes · 0 comments
- [Build agentic full-stack apps with Genkit](https://daily.dev/posts/build-agentic-full-stack-apps-with-genkit-ckpxki271) · Google Developers · 4 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#claude](https://daily.dev/tags/claude), [#clickhouse](https://daily.dev/tags/clickhouse), [#llm](https://daily.dev/tags/llm)

[View this post on daily.dev](https://daily.dev/posts/building-agentic-workflows-that-query-millions-of-rows-a-real-world-guide-with-agentkit-nrmagxu5c)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building Agentic Workflows That Query Millions of Rows: A Real-World Guide with AgentKit","url":"https://daily.dev/posts/building-agentic-workflows-that-query-millions-of-rows-a-real-world-guide-with-agentkit-nrmagxu5c","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-agentic-workflows-that-query-millions-of-rows-a-real-world-guide-with-agentkit-nrmagxu5c"},"datePublished":"2026-09-13T19:57:08.099Z","dateModified":"2026-10-15T02:22:29.522Z","description":"A case study describes building a multi-agent system with Inngest AgentKit that lets users query 3.5 million powerlifting records using natural language. The...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8aa1050085907eb93da6d2648a46a34e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8aa1050085907eb93da6d2648a46a34e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Inngest Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Inngest Blog","logo":"https://media.daily.dev/image/upload/s--ieZKUa5y--/c_limit,w_256/f_auto,q_auto/v1789329423/logos/inngest?_a=BAMAMicg0","url":"https://daily.dev/sources/inngest"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/building-agentic-workflows-that-query-millions-of-rows-a-real-world-guide-with-agentkit-nrmagxu5c","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,claude,clickhouse,llm","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Inngest Blog","item":"https://daily.dev/sources/inngest"},{"@type":"ListItem","position":3,"name":"Building Agentic Workflows That Query Millions of Rows: A Real-World Guide with AgentKit"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/building-agentic-workflows-that-query-millions-of-rows-a-real-world-guide-with-agentkit-nrmagxu5c#faq","mainEntity":[{"@type":"Question","name":"How can I let an LLM query a large SQL-like database without using embeddings or retrieval?","acceptedAnswer":{"@type":"Answer","text":"Convert natural language directly into structured tool calls rather than relying on embeddings or retrieval-based search. In one implementation, a dedicated agent is prompted with the full database schema and few-shot examples, then exclusively calls a typed function such as get_meet_results(filters, orderBy, sortDirection, limit) that maps to a parameterized ClickHouse query, giving deterministic and inspectable data access across 3.5 million rows. daily.dev surfaces practical patterns like this for developers architecting LLM-to-database query systems."}},{"@type":"Question","name":"How do I split responsibilities across multiple LLM agents in a single workflow?","acceptedAnswer":{"@type":"Answer","text":"One effective pattern uses three specialized agents with distinct models: a routing agent (Claude Haiku) decides whether a query needs database access, a query agent (Claude Opus) converts natural language into structured queries, and a summary agent (Gemini 2.5 Pro) interprets raw results for the user. Each agent is built and tested in isolation, then composed into a single orchestrated network using a framework like Inngest AgentKit. developers designing agent pipelines can track architecture patterns like this via daily.dev."}},{"@type":"Question","name":"How do I stream real-time AI agent output to a React frontend without managing websockets myself?","acceptedAnswer":{"@type":"Answer","text":"The useAgent React hook from @inngest/use-agent exposes messages, sendMessage, and status directly, handling the underlying connection so no manual websocket management, state stores, or connection handling code is required. Messages arrive as parts that can be rendered by type, such as text, letting a chat-style UI stream agent responses in real time. daily.dev helps developers building streaming AI chat interfaces stay on top of tools like this."}}]}
```

