Blog/AI SQL workforce

Keep reviewed team SQL from disappearing into chat threads

A reviewed query library holds the read-only SELECT a teammate saved and reviewed in Studio, compiled once into a skill file your team keeps under version control. Without it, the query your senior analyst already perfected lives in a chat thread and gets rewritten from scratch next week.

By Jonathan Dag, Founder & CEO··Updated September 2, 2026
A CHION.md file for an organization listing analysts and their saved and reviewed query skills such as Cohort Analysis and Top Customers.
The workforce is the shared library of compiled SQL skills; each team routes into the slice it owns.

What an AI SQL workforce is

An AI SQL workforce is a team of skills whose capabilities are compiled from queries the organisation already trusts. Each agent is a router into a library of reviewed, reusable SQL skills, rather than a raw language model pointed at a database. The workforce grows as the skill library grows; it does not grow because a vendor shipped a new model.

The category exists because the single-agent framing, see what makes one SQL agent production-ready, answers the question "can I trust this one agent" but not "how do twenty teams share what they have already validated." The workforce framing answers the second.

Why the saved and reviewed query outlasts the model

The core wager of SQL agent skills is that the saved and reviewed skill, not the model, is the durable asset. Models change every six months; the SELECT a senior analyst wrote and finance signed off on does not. A workforce composed of compiled skills survives model upgrades, vendor switches, and team turnover. A workforce that is "the model plus prompts" survives none of them.

A workforce that is "the model plus prompts" survives none of them.

Most skills, including hand-written Claude Code skills, teach the model how to write SQL. A Chion skill carries the saved and reviewed query itself. The model picks which skill to run; it does not get to rewrite the SELECT underneath.

SQL agent skills vs vendor-locked database skills

  • Runs on your own Postgres, read-only, not a vendor-hosted database you have to migrate into.
  • Portable as a plain SKILL.md file compiled for Claude Code or Codex.
  • Per-line traceable to the analyst who wrote and reviewed the SELECT, not an opaque, vendor-shipped black box.

The problem: tribal knowledge SQL

Walk into any data team and ask how MRR is calculated. You will get three answers. One from the analyst, one from the finance lead, one from a dashboard nobody has opened since the last fiscal year close. They will be subtly different, and reconciling them will take a meeting.

This is not a tooling failure. It is a compilation failure. The org has already paid, many times over, to figure out the right query. The SQL exists. It is correct. It is also untracked, unreviewed, and irretrievable to anyone who was not in the original conversation. Tribal knowledge SQL is the most expensive asset a data org owns and the one it treats with the least care.

In a senior analyst's head

The one person who knows that "active customer" excludes the seven internal test accounts and the legacy import from 2021. They have not written it down. They have not been asked to.

Pinned in a Slack thread

A 400-line query from 2023, pasted into #data-questions, with a follow-up that says "small tweak for this quarter." Three people have used it since. Nobody has reviewed it.

In a notebook nobody opens

A Jupyter notebook on a shared drive titled final_v3_USE_THIS.ipynb. The query inside is correct. The filename is the only documentation.

In a dashboard you cannot read

The SQL is technically accessible, buried four clicks deep in the BI tool. Nobody on the business side has the permission. Nobody on the data side remembers writing it.

The standard response is "let's write better documentation" or "let's consolidate dashboards." Both have been tried, in every org, for fifteen years. The reason they fail is the same: documentation and dashboards are not the runtime. The runtime is whatever the agent, or the analyst, actually executes when the question shows up.

The thesis: the skill is the asset, not the model

The position this page takes, plainly:

01

A raw model is a commodity.

GPT, Claude, Gemini, the next one: interchangeable. Whichever wins the next benchmark cycle wins it by single digit margins. The model is not the asset.

02

The saved and reviewed query is the asset.

The SELECT a senior analyst already wrote, tested, and trusts. The one finance signed off on. The one that matches the board pack. The query the org has already paid for, often many times.

03

A skill is the compiled, reusable form of that query.

Frontmatter the agent can route to, the SELECT itself, the definitions it depends on. A repeat question anchors on the query your team saved and reviewed: it becomes the base CTE, and a new outer SELECT is generated against it and code-validated before it runs.

The implication is direct. Investing in raw model access is a bet on a moving target. Investing in compiled SQL skills is a bet on the queries the org has already validated. The first depreciates with every model release. The second compounds with every question the org has already answered.

How a trusted SELECT becomes a portable skill

A SQL skills compiler takes a query a human already trusts and emits a compiled enterprise SQL skill: a single, reviewed artifact with four properties. None of them are exotic. All of them are missing from a raw SQL snippet pasted in Slack.

Triggers the agent can match on

A small set of phrases the skill should fire on: "MRR by plan," "monthly recurring revenue by plan," "subscription revenue grouped by plan." A future prompt that matches anchors on the saved and reviewed SELECT in this skill, and the new outer query is generated against it and code-validated before it runs.

The saved and reviewed SELECT

The SQL itself, exactly as a human reviewed it. Not a template the model fills in. Not a prompt that asks the model to remember. The literal query, parameterized only where parameters were always meant to vary.

The definitions it relies on

The semantic-layer rows the SELECT depends on: what "active customer" means, what counts as "revenue," which time grain is implied. Compiled in so a renamed column fails the skill loudly instead of silently returning the old number.

Provenance and ownership

Who wrote it, who reviewed it, when it was last validated, which team owns it. A compiled skill is not a black box; it is a reviewed artifact with the same governance properties as application code.

The compilation step

Tribal knowledge SQL

A trusted query, somewhere

After SQL skill compilation

Compiled SQL skill

Mechanics live in how Chion compiles SQL skills. Portability is covered in why portable SQL skills matter. This page stays on the why.

The workforce: a library of compiled skills

Every validated query becomes a skill; every skill becomes routable.

Once compilation is a habit, the library accumulates. Every validated query becomes a skill. Every skill becomes routable. The collection, not any one agent, is your saved-query SQL skill library.

A SQL skills framework, in practice

The workforce is not a vendor-shipped roster of generic agents. It is the set of compiled skills your team validated, plus the runtime that routes prompts to them. Add a skill: add a worker. Retire a skill: retire a worker. The org's capability grows with the library, not with the model release schedule.

What a workforce looks like once a team has been at it for a few months:

A finance worker

Skills compiled from the queries finance already runs every close: MRR, ARR, churn, expansion, net revenue retention. The agent fires them on demand, in the same definitions finance publishes externally.

A product worker

Skills compiled from the cohort, funnel, and retention queries the product analytics team has written and re-written for three years. The PM asks a question and gets the same answer the analyst would have, without filing a ticket.

A growth worker

Skills compiled from the attribution, channel mix, and CAC payback queries the growth team owns. Reusable across campaigns, weeks, and channels without copy-paste-modify each time.

A custom worker

Whatever the org actually runs. The point of a saved-query SQL skill library is that it is composed of the queries you already trust, not the queries a vendor decided to ship.

Talk of a SQL skills marketplace usually skips the obvious step: the marketplace that matters first is the internal one. A library your org owns, compiled from queries your org wrote, governed by people on your payroll. Cross-org distribution becomes interesting once the format is portable. That thread is picked up on the portable SQL skills page. For the safety properties the workforce runs under, see what a read-only agent must prove.

Read-only by design: vault creds, RLS, row caps, one audit row per query

A workforce that runs against production data inherits every governance requirement a single SQL agent has, multiplied by the number of agents. The non-negotiables: credentials live in an encrypted vault and the model never sees the DSN; the agent connects through a read-only role with RLS enforced server-side; every result is row-capped and timeout-bounded; every query writes one audit row, fire-and-forget by design, by service role only; every compiled skill carries provenance (author, reviewer, last-validated date) the way application code carries commit history.

Read-only SELECT. Credentials in an AES-256-GCM vault. Results capped at 1,000 rows. Each executed query leaves an audit row, written fire-and-forget so a logging failure never blocks your answer.

These are not workforce-specific. They are the floor for any agent pointed at production. The detailed trust framework lives in the four production checks; the implementation specifics for Chion live in the CHION.md specification.

Workforce vs single agent

The single-agent question is "is this one agent safe and stable enough to point at production." The workforce question is "how do twenty teams share the skills they have already validated without re-implementing them in each team's silo." Both matter. A workforce that is not built on trustworthy single agents is a faster way to make the same mistakes; trustworthy single agents that never compose into a workforce mean every team rewrites every query.

The portability of the underlying skill format is what makes the workforce composable. That thread is picked up on portable SQL skills.

Getting started

The shortest path to a workforce is one skill. Pick the question the team answers most often, the one that ends up in Slack every week, and compile the SELECT that already answers it correctly. That is one reusable skill. Do it twice and the library has started. Do it for a quarter and the workforce framing becomes the obvious way to talk about what the team has built.

Chion is the compiler and the runtime. Connect a read-only Postgres, validate the queries your analysts already trust, and save them in Studio so they compile into skills the workforce can call. See how Chion compiles queries into skills, or Chion's AI SQL Analyst framework for the analyst-facing surface; the compiled-skill mechanics live in how Chion compiles SQL skills.

Quick reference

  • SQL agent skills are saved and reviewed queries compiled into reusable artifacts an agent runs: capabilities defined by skills, not raw models.
  • Tribal knowledge SQL, the trusted query that only lives in one head, is the asset most worth compiling.
  • SQL skill compilation produces an enterprise SQL skill: triggers, saved and reviewed SELECT, definitions, provenance.
  • A SQL skills framework anchors each repeat question on the saved and reviewed SELECT; the model writes the outer query against reviewed logic instead of the raw schema.
  • The internal SQL skills library is the marketplace that matters first; cross-org distribution comes later.
  • Models depreciate. Compiled SQL skills compound.

Frequently asked

What are SQL agent skills?

SQL agent skills are saved and reviewed queries compiled into reusable artifacts an AI agent can run, not raw access to a language model. Each skill is a SELECT a human already reviewed and trusts, packaged with the triggers and definitions the agent needs to route to it. A library of them is what we call an AI SQL workforce: capabilities defined by compiled skills, not by the model wired in.

Is a SQL agent skill related to SQL Server Agent?

No. SQL Server Agent is a job scheduler built into Microsoft SQL Server; a SQL agent skill is a reusable, saved and reviewed query packaged so AI tools can run it.

What does SQL skill compilation mean here?

Compiling a SQL skill means taking a query an analyst already wrote and turning it into a reusable artifact: trigger phrases the agent can match on, the saved and reviewed SELECT, the semantic-layer definitions it depends on, and the provenance that makes it reviewable. The output is a compiled skill the workforce can call on demand.

What is tribal knowledge SQL?

Tribal knowledge SQL is the institutional understanding of how to answer a question correctly that lives only in one analyst's head, one Slack thread, or one untracked notebook. It is the query everyone agrees is right but nobody can find. The core argument here is that this is the asset most worth compiling into a SQL agent skill.

How is enterprise SQL skills different from a saved query?

A saved query is a string of SQL. An enterprise SQL skill is a saved query plus the metadata an agent needs to route to it, plus the definitions it depends on, plus the provenance and ownership that make it auditable. The difference is the difference between a snippet and a deployable artifact.

Is there a SQL skills marketplace?

Not in the App-Store sense. The marketplace shape that matters is internal: a library of skills your org compiled from queries your org already trusts. The portability of the format is what makes a true cross-org marketplace possible later; the immediate value is the internal library.

How is this a SQL skills framework, not just a prompt template?

A prompt template asks the model to re-derive the SQL from the schema. A skills framework anchors generation on the saved and reviewed SELECT, so the model writes the outer query against reviewed logic instead of the raw schema.

How does a saved and reviewed query run in Claude Code or Codex?

It ships as a SKILL.md you copy into that runtime's skills folder.

What is the difference between a workforce and a single SQL agent?

A single SQL agent is one router into one set of capabilities. A full skill library spans many agents (finance, product, growth, custom), each scoped to the slice of compiled SQL agent skills that matches its domain. The single-agent trust framework (read-only, vault, audit, saved and reviewed skills) still applies; the library framing is about how those agents are organised across teams.

Can an AI agent run SQL on my own database safely (read-only)?

Yes. An AI agent that runs saved and reviewed SQL skills connects through a read-only Postgres role; credentials live in an encrypted vault the model never sees, every query is row-capped and timeout-bounded, and every query writes one audit row, fire-and-forget by design, by service role only. The agent re-runs queries a human already reviewed; it does not invent net-new SQL against production. Novel questions still go through the full pipeline and a human saves and reviews the result in Studio.

How do SQL agent skills work for teams of analysts?

Each analyst keeps writing SQL the way they always have. The difference is that once a query is reviewed, it is compiled into a skill the whole team can reuse. The analyst stops being a re-execution queue for the same eight questions and spends more time on the novel ones; the compiled SQL skills handle the repeats with the analyst-validated SQL.

Runs in Claude Code and Codex.

Compile your trusted SQL into skills your AI tools can run.

Connect read-only Postgres, validate the SQL you already use, and save it in Studio so it compiles into a SQL skill any agent can call on demand.