
Postgres vs SQLite for AI Agent Workloads
A question I get more than I'd expect: if I'm building something where an AI agent needs a database, should I reach for Postgres or SQLite? It sounds like a beginner question and it isn't, because the...
How to supercharge your workflow with AI

There's a genre of startup advice that says pick your north star metric and optimize everything toward it. It's not bad advice, but for a solo founder it can turn into a dashboard you stare at instead...

The hardest part of building QueryBear hasn't been writing it. It's been not writing things. Every week brings a reasonable-sounding feature request, and most of them I've turned down, and turning the...

If you're the person on your team who can write SQL, you know this Slack message. "Hey, quick one — how many users signed up from the partner referral last week?" It's never quick. It's a context swit...

I gave a coding agent standing access to a real (non-production, but real-data-shaped) database for a month, through the same read-only, logged, capped setup I'd recommend to anyone. Then I read every...

Every founder building anything adjacent to AI gets this question, and I get a database-flavored version of it constantly. "Aren't you scared Anthropic or OpenAI will just build safe database access i...

Before I let any MCP server touch a database that matters, I run the same mental checklist. It's not long, and most of it is the kind of thing you know but skip because the happy path works without it...

When you build a tool that lets people ask their database questions in plain English, you get a front-row seat to what people actually want to know. Not the polished analytics questions from a BI demo...

QueryBear competes, in a sense, with free. There are open-source MCP servers for Postgres. You can wire up a read-only role and a proxy yourself in an afternoon. I've written posts on this very blog s...

Read-only is the first thing people set up when they give an agent database access, and it's necessary. It's also not sufficient, because "can only read" and "can read everything" are very different s...

The semantic layer is having a moment. The pitch is that you define your metrics once (revenue, active users, churn) in a central place, and then every tool and every query pulls from those shared def...

Programmatic SEO has a bad reputation, mostly deserved, because most of it is garbage. Generate ten thousand near-identical pages, one per city or one per keyword permutation, and hope Google rewards...

When an AI agent writes a bad query against your database, the instinct is to blame the model. Sometimes that's fair. More often, the model did a reasonable job with terrible information, because your...

Almost every company builds one. The internal admin panel. The little tool where support can look up a user, ops can check an order, someone can toggle a feature flag. It starts as a single page and e...

Churn is one of those metrics where the SQL is easy and the definition is a minefield. Two people can both write a correct query and get different numbers, because they quietly disagreed on what churn...

Every few weeks someone posts a confident take that AI is coming for data analysts, usually with a screenshot of a model writing a decent query as evidence. And every few weeks an analyst replies that...

The first time an AI agent does something surprising to your database, the question you'll ask is "what exactly did it run?" If you can't answer that quickly, you've got a real problem, and it's worth...

PlanetScale is MySQL-compatible (built on Vitess), and a couple of its design choices change how you connect an AI agent to it. If you've connected an agent to plain MySQL before, most of this will fe...

Here's a prediction I'm fairly confident in: within two years, shipping an MCP server will be as standard for a SaaS product as shipping a REST API is today. Not a differentiator. Table stakes. The co...

A funnel is just a sequence of steps and the count of people who made it to each one. Signup, then activate, then first purchase. Analytics products make this a drag-and-drop feature and charge accord...

This is post 139. The previous 138 went up over about six months, which is roughly one every working day. I want to be honest about what that produced, because the "publish a ton and win SEO" advice i...

I keep getting a version of this question: "we already have a REST API in front of our database, why would we add MCP?" It's a fair question, and the answer isn't "MCP is newer so use MCP." They're fo...

There's a reflex right now where every "let the AI use our data" project starts with the same move: chunk it, embed it, stuff it in a vector database, retrieve the top-k by similarity. RAG. It's the d...

Active users is the metric everyone quotes and few people define carefully. Daily, weekly, monthly active users are simple in concept and full of small traps in practice. Here are the queries I use, p...

Talk to a data analyst at almost any growing company and you'll find a smart person doing work that's beneath them, on a schedule someone else controls, for stakeholders who think the work is trivial....

Neon is serverless Postgres, and the "serverless" part changes a couple of things when you're connecting an AI agent to it. Most of the advice for plain Postgres still holds. But there are two Neon-sp...

MCP had a great year. Every tool ships one now, every database has a community server, and the protocol genuinely deserves the attention. It solved a real problem: AI clients and external services fin...

We use Turso (libSQL over HTTP) for our feature flag data. It's fast, it's edge-distributed, and it stores a record per user per flag, which means the table is wide and the cardinality is high. I want...

Retention is the metric people most want and least want to write the SQL for. The chart is simple to picture: group users by the month they signed up, then track how many came back in each later month...

I spent a chunk of 2023 being a text-to-SQL skeptic, and I was right to be. The demos were beautiful and the reality was a model confidently joining two tables on columns that didn't share a meaning,...

Supabase is Postgres with a nice jacket on. That's a compliment. It means everything you'd do to safely connect an AI agent to plain Postgres applies here, plus a couple of Supabase-specific things wo...

My app uses Turso for its SQLite backend. Last week I was chasing a performance complaint and wanted to know which queries were pulling back the most rows. The SQLite query stats story is thinner than...

I see the same setup over and over. Someone wants their coding agent to be able to check the database, so they drop the production connection string into the agent's environment and move on. `bash exp...

Our support manager, Dana, was trying to figure out whether the onboarding redesign was actually working. Her question was simple: "How many users have completed onboarding this month?" But getting an...

I was debugging a mobile sync issue and someone asked if any devices had gone quiet, as in, no sync in over 48 hours. We use Turso for our edge SQLite database. I had Windsurf open, the code right in...

I was debugging a flaky integration test when I noticed the errors were clustering around one endpoint. The test logs said "unexpected response," which told me nothing. What I actually needed was a co...

A customer emailed asking why their team wasn't using a particular feature anymore. I was drafting a reply and wanted to check the actual usage numbers before I said anything. Our app data lives in a...

A customer emailed asking whether their data had actually synced or whether something was silently failing on their device. I knew we had a conflict table. I knew it had timestamps. I did not know the...

It was a Tuesday and someone on the ops team needed a quick number: how many distinct products did we actually sell in March, not counting refunds or test orders? A fifteen-minute Slack thread ensued...

Friday afternoon. Payroll review was coming up and someone on the ops team pinged asking which employees had logged overtime above 10 hours that week. I wasn't going to write that query by hand and I...

Our finance lead, Marcus, had a question that had been nagging him for weeks: how long does it actually take a new user to make their first purchase? He'd been getting a different answer every time he...

The ops manager messaged me at 9 AM on a Monday: "Do we have a quick way to see which products are running low?" She didn't need a dashboard. She needed an answer, right now. I was already in Windsurf...

I was pairing with a teammate on a cart abandonment feature when she asked, "How many carts have been sitting for more than a day right now?" Neither of us knew off the top of our heads. She tabbed ou...

I was prepping a one-on-one with our head of sales last week and I wanted to walk in with the top customers by lifetime value, not a guess at it. I had maybe ten minutes before the call. Pulling it up...

It was 2am and our daily order volume chart had gone flat. Not zero, just... suspiciously flat. I needed to know whether orders had actually stopped or whether the reporting query was broken. I didn't...

I inherited a Postgres schema with 94 tables last year. No ERD, minimal comments, just 94 tables and a pile of legacy migrations. I needed to understand it fast. I tried a few AI tools, and most of th...

I was elbow-deep in a performance investigation when I wanted to know which queries were hitting the database hardest. Opening a psql session, running pg_stat_statements, copying the results, formatti...

Our head of marketing, Jenna, slacked me on a Tuesday with a single question: "How many active subscribers do we have right now? Churn feels weird this week." She wasn't asking me to write a dashboard...

I was in the middle of a refactor when a colleague pinged me asking which users had started a trial but never converted. I didn't want to tab out, spin up a DB client, and write the query from scratch...

I was three hours into a payment refactor when I realized I had no idea how many orders were actually failing. The code was in front of me. The database was... somewhere else. I had a terminal open, a...

I was halfway through writing a board update last quarter when our head of growth pinged me asking for our revenue from new customers that month. Not the total. Just new customers. I knew the data was...

I was elbow-deep in a refactor when a Slack ping landed: "hey can you pull a list of users who signed up last week but never came back?" Not a big ask. But switching contexts, opening a psql terminal,...

I spent a weekend in April reading source code for every Postgres MCP server I could find — open source, commercial, side projects, archived references. There are more than you'd think, and they're mo...

A teammate pinged me last week asking why two rows in the events table had a started_at stored as "2024-03-15" (a string) while the rest had Unix timestamps. They'd been hunting this for an hour. I ju...

You're debugging a customer complaint and someone on the team asks "how many orders did this user place in the last 90 days?" You know the answer is in MySQL. You also know you'll need to write the JO...

Someone on my team asked how many users had churned in the last 30 days. Simple question. But to answer it, I needed to open a psql session, remember the exact column names in our subscriptions table,...

There's a class of prompt injection attack that nobody's writing about, probably because it's been overshadowed by the "agent reads a file with malicious instructions" version. But it's the one I thin...

You've probably read three "What is MCP?" posts already. They all start with "MCP is a protocol for connecting AI models to external tools and data" and proceed to be the same post. I want to write th...

There's a workflow I get asked about all the time and it goes roughly: "I want Claude Code to be able to answer questions about my production database, but I don't want to give it my prod URL." This i...

If you're going to let an AI agent touch a real Postgres, the smallest thing you can build that actually keeps you safe is an allowlist. Not a database role — a parsed-SQL-against-a-list check, before...

There's a comforting belief in the AI database tooling world that goes "we set the connection to read-only, so we're safe." Half the AI database MCP servers I've read source for use this as their enti...

If you're shipping an AI feature in 2026 and you haven't figured out database access, you're behind. If you've figured it out by handing the agent a prod Postgres URL, you're behind in a different and...

In late 2025 Anthropic moved 14 of its reference MCP servers to a archived directory in modelcontextprotocol/servers. The Postgres one was the headline because it's the one teams were actually using....

Last month, @modelcontextprotocol/server-postgres was downloaded 312,391 times. The month before that, 301,440. November 2025 it was 100,059. Installs have tripled in five months and they're still cli...

Imagine the world 12 months from now. AI agents are everywhere and they are genuinely powerful. They write code, ship features, debug production issues, and quietly do half of the boring work nobody w...

I've been connecting my coding agents to everything: Datadog logs, Linear, Slack. It still feels like I hit the same wall every time I actually need to debug something serious. The model can read the...

Your AI agents are about to become your most productive employees. But right now, they're working blind. I've spent the last year building infrastructure that connects AI agents to databases. And the...

Your AI agents need data. But giving them raw database access is terrifying. Today we're launching a new direction for QueryBear: a secure gateway between your AI agents and your database. Connect you...

I've been connecting my coding agents to everything: Datadog logs, Linear, Slack. It still feels like I hit the same wall every time I actually need to debug something serious. The model can read the...

I've been thinking lately about a line people don't love to cross: giving more people access to the database. There's still a stigma, like it's a holdover from when "database access" meant shared admi...

The phrase "data-driven" gets used as if it means "we look at numbers." It almost never means that. What it means at most companies is "two engineers look at numbers and tell the other ninety-eight pe...

There is a spectrum from "AI writes everything and runs it" to "humans write everything by hand." Almost every team I see picks one of the two endpoints. Both are wrong for SQL. The right point is in...

If you have ever been on a small data team at a growing company, you know the feeling. The Slack queue is full. Every Tuesday someone asks for a quick refund report. Every other Friday it's a churn co...

I sell a tool that writes SQL for you. I'm going to argue you should still learn SQL. Both things can be true. The reason is simple: if you can't read what the AI wrote, you can't catch when it's wron...

I get the "is AI going to replace Metabase" question almost every week. The honest answer is "for a lot of teams, yes — but not in the way most people are pitching it." I want to walk through the actu...

When QueryBear's AI writes SQL against your database, it has to know your schema — every table, every column, every type, every foreign key. Without that context, it's guessing. The naive way to do th...

Every internal tool I've ever shipped has eventually broken, and I've watched the same thing happen at every company I've worked at. It's not bad engineering. It's a structural problem. I want to lay...

The headline feature when I started building QueryBear was natural-language SQL. The thing I now use ten times a day is the boring one I almost didn't ship: saved queries. They're also the feature tha...

I have sat in too many "we need to be more data-driven" all-hands. They are almost always preceded by a quarter where the team made a decision on gut and it didn't go well. They are almost never follo...

I'm an engineer by trade. And when I look a couple years ahead, the landscape looks completely different than it does today. Right now, AI is a tool that augments engineers. An idea comes from somewhe...