<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-we-built-insights-ai-with-inngest-nmfi0f3ew" -->

---
title: How we built Insights AI with Inngest | daily.dev
description: An engineering team recounts building Insights AI, a natural-language query feature for their execution-data analytics tool, after the original SQL-only...
canonical: https://daily.dev/posts/how-we-built-insights-ai-with-inngest-nmfi0f3ew
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How we built Insights AI with Inngest | daily.dev
og:description: An engineering team recounts building Insights AI, a natural-language query feature for their execution-data analytics tool, after the original SQL-only...
og:url: https://daily.dev/posts/how-we-built-insights-ai-with-inngest-nmfi0f3ew
og:image: https://api.daily.dev/og/posts/nMFi0F3ew.png
og:image:alt: How we built Insights AI with Inngest
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.

# How we built Insights AI with Inngest

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

## Summary

An engineering team recounts building Insights AI, a natural-language query feature for their execution-data analytics tool, after the original SQL-only version failed to gain adoption. They describe switching from OpenAI to Claude Haiku and Sonnet 4.5 for better query accuracy, enabling Inngest's checkpointing to cut agent latency from 15-30 seconds to 3-6 seconds, and rewriting system prompts from roughly 100 words to over 2,000 words with explicit schema definitions, examples, and output-format rules. They also shipped a 'Fix with AI' button reusing the same agent infrastructure to debug user SQL errors, and share lessons learned around testing multiple model providers early, prioritizing observability, and treating prompt engineering as substantial engineering work.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.inngest.com/blog/how-we-built-insights-ai-with-inngest>

## Questions this post answers

### Why did switching from OpenAI to Claude improve an AI agent's SQL query generation accuracy?

Claude Haiku and Sonnet 4.5 handled context windows and instruction following better than GPT-4, reducing hallucinated column names and misunderstood join relationships. Ad-hoc testing on 50 questions showed the query success rate jump from roughly 50% with the old prompts and OpenAI to about 90% after switching, without a formal A/B test being run.

_Teams choosing between OpenAI and Claude for structured generation tasks can compare real build experiences on daily.dev._

### How much faster does checkpointing make multi-step LLM agent workflows in Inngest?

Checkpointing cut query response time from 15-30 seconds down to 3-6 seconds for an agent making 8-12 sequential Claude API calls. Normally Inngest does a full request/response cycle to the platform after each step to store state, but checkpointing lets the SDK orchestrate steps locally and send progress back without waiting between steps.

_Developers optimizing agent latency can find implementation trade-offs like this one on daily.dev._

### How long should a system prompt be for a production LLM agent that writes SQL queries?

An effective query-writer system prompt grew from about 100 words to over 2,000 words, including explicit column definitions, unit clarifications (like timestamps in milliseconds not seconds), multiple worked examples for filtering and aggregation, strict output-format rules, and decision trees for handling ambiguous requests. This level of explicitness moved results from sometimes working to almost always working.

_Anyone iterating on agent prompt design can track practical patterns like this via daily.dev._

## Similar posts on daily.dev

- [SQL query generation from natural language](https://daily.dev/posts/sql-query-generation-from-natural-language-onjh4kh6o) · DevBlogs · 1 upvotes · 1 comments
- [Reducing Time-to-Insight in Company Financial Data by 90%](https://daily.dev/posts/reducing-time-to-insight-in-company-financial-data-by-90--lyxlee5ii) · SoftwareMill · 2 upvotes · 0 comments
- [AI Data Integration: How Informatica Reduced Pipeline Development Time](https://daily.dev/posts/ai-data-integration-how-informatica-reduced-pipeline-development-time-bqkggxvpw) · Salesforce Engineering · 5 upvotes · 0 comments
- [I Built an AI Data Agent Which Can Query Data and Answer Business Questions. Here’s How.](https://daily.dev/posts/i-built-an-ai-data-agent-which-can-query-data-and-answer-business-questions-here-s-how--u3xbvpl4e) · Towards Data Science · 0 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

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#claude](https://daily.dev/tags/claude), [#inngest](https://daily.dev/tags/inngest), [#prompt-engineering](https://daily.dev/tags/prompt-engineering)

[View this post on daily.dev](https://daily.dev/posts/how-we-built-insights-ai-with-inngest-nmfi0f3ew)

```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":"How we built Insights AI with Inngest","url":"https://daily.dev/posts/how-we-built-insights-ai-with-inngest-nmfi0f3ew","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-we-built-insights-ai-with-inngest-nmfi0f3ew"},"datePublished":"2026-09-13T19:57:49.001Z","dateModified":"2026-10-15T02:22:44.811Z","description":"An engineering team recounts building Insights AI, a natural-language query feature for their execution-data analytics tool, after the original SQL-only...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1314371b084b6bec9e218c27b8acf053?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1314371b084b6bec9e218c27b8acf053?_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/how-we-built-insights-ai-with-inngest-nmfi0f3ew","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,claude,inngest,prompt-engineering","timeRequired":"PT10M"}
{"@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":"How we built Insights AI with Inngest"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-we-built-insights-ai-with-inngest-nmfi0f3ew#faq","mainEntity":[{"@type":"Question","name":"Why did switching from OpenAI to Claude improve an AI agent's SQL query generation accuracy?","acceptedAnswer":{"@type":"Answer","text":"Claude Haiku and Sonnet 4.5 handled context windows and instruction following better than GPT-4, reducing hallucinated column names and misunderstood join relationships. Ad-hoc testing on 50 questions showed the query success rate jump from roughly 50% with the old prompts and OpenAI to about 90% after switching, without a formal A/B test being run. Teams choosing between OpenAI and Claude for structured generation tasks can compare real build experiences on daily.dev."}},{"@type":"Question","name":"How much faster does checkpointing make multi-step LLM agent workflows in Inngest?","acceptedAnswer":{"@type":"Answer","text":"Checkpointing cut query response time from 15-30 seconds down to 3-6 seconds for an agent making 8-12 sequential Claude API calls. Normally Inngest does a full request/response cycle to the platform after each step to store state, but checkpointing lets the SDK orchestrate steps locally and send progress back without waiting between steps. Developers optimizing agent latency can find implementation trade-offs like this one on daily.dev."}},{"@type":"Question","name":"How long should a system prompt be for a production LLM agent that writes SQL queries?","acceptedAnswer":{"@type":"Answer","text":"An effective query-writer system prompt grew from about 100 words to over 2,000 words, including explicit column definitions, unit clarifications (like timestamps in milliseconds not seconds), multiple worked examples for filtering and aggregation, strict output-format rules, and decision trees for handling ambiguous requests. This level of explicitness moved results from sometimes working to almost always working. Anyone iterating on agent prompt design can track practical patterns like this via daily.dev."}}]}
```

