---
title: "How to be AI-fancy"
description: "Neon added three LLM-backed features to its SQL editor: natural-language SQL generation, automatic naming of history queries, and one-click error fixing."
url: "https://swe.quest/articles/how-to-be-ai-fancy-1617ad0989d06ba6"
canonical: "https://neon.com/blog/how-to-be-ai-fancy"
source: "Neon"
published: "2024-11-04"
difficulty: "medium"
kind: "Case study"
reading_minutes: 6
tags: ["llms","product-engineering","postgres","typescript"]
---

# How to be AI-fancy

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-11-04, 6 min read, Case study. Original: [https://neon.com/blog/how-to-be-ai-fancy](https://neon.com/blog/how-to-be-ai-fancy)

## Summary

Neon added three LLM-backed features to its SQL editor: natural-language SQL generation, automatic naming of history queries, and one-click error fixing. Generation and fixing send the database schema as context to the LLM. Neon chose inline, context-specific actions over a chat assistant because a useful assistant needs multi-stage context gathering and gives less control over the UX. The implementation lessons are a strategy-pattern interface so providers can be swapped (Claude 3.5 Sonnet on AWS Bedrock was chosen, partly to keep schema data inside AWS without extra user consent), a comparison of cloud-integrated and direct AI providers, and plain HTTP response streaming to the browser via the Fetch API reader instead of WebSockets.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Product engineering](https://swe.quest/tags/product-engineering.md) (Engineering organization)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- LLM API basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- Node.js HTTP servers ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- Fetch API

## Keywords

Neon, Claude 3.5 Sonnet, AWS Bedrock, OpenAI, Fetch API, Postgres

## Related posts

- [Web-based AI SQL Playground and connecting to Postgres from the browser](https://swe.quest/articles/web-based-ai-sql-playground-and-connecting-to-postgres-from-the-browser-fa7f4eccd9643a37.md): Neon · 2023-05-19 · Medium · 5 min read · PostgreSQL, LLMs, Serverless, JavaScript
  Neon's Postgres AI Playground connects to a Postgres database directly from the browser and uses OpenAI's gpt-3.5-turbo to turn natural-language prompts into SQL.
- [Building an AI-powered ChatBot using Vercel, OpenAI, and Postgres](https://swe.quest/articles/building-an-ai-powered-chatbot-using-vercel-openai-and-postgres-4fd423473384581f.md): Neon · 2023-03-09 · Medium · 13 min read · RAG & retrieval, PostgreSQL, Vector search, LLMs, Serverless
  A ChatGPT-style documentation assistant (Ask Neon) is built by storing OpenAI text-embedding-ada-002 vectors in Postgres with pgvector, retrieving context by cosine distance, and feeding it to text-davinci-003 from a Vercel Edge Function.
- [database.build v2: Bring-your-own-LLM](https://swe.quest/articles/database-build-v2-bring-your-own-llm-b2a3b83eee7ef5a0.md): Supabase · 2024-12-06 · Medium · 11 min read · PostgreSQL, LLMs, Browsers, WebAssembly
  database.build, Supabase's in-browser Postgres sandbox built on PGlite, now lets users bring any OpenAI-compatible LLM, with no login and no rate limits.
- [Mubit + Neon AI Gateway: an agent that cuts its own frontier-model tokens by 73%](https://swe.quest/articles/mubit-neon-ai-gateway-an-agent-that-cuts-its-own-frontier-model-tokens-by-73-358da1147275d399.md): Neon · 2026-11-12 · Medium · 10 min read · AI agents, LLMs, Cost optimization, Inference & serving, PostgreSQL
  Mubit, a proxy placed in front of Neon AI Gateway, records an agent's model calls, groups recurring calls into tasks, and fine-tunes a small open-weight model once a task has at least 25 good replies.
- [AI Functions in ClickHouse: Upgrade your SQL to the AI age](https://swe.quest/articles/ai-functions-in-clickhouse-upgrade-your-sql-to-the-ai-age-11cec6552950f306.md): ClickHouse · 2026-09-11 · Medium · 12 min read · LLMs, SQL, RAG & retrieval, Analytics & OLAP, Cost optimization
  ClickHouse's beta AI Functions call LLM and embedding providers directly from SQL.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
