Skip to content
Skills Library
Data & analytics · Analysis

retrieval

/retrieval

Answer questions from live data through a running skardi-server using the skardi CLI. Discover at runtime what sources and named pipelines the server has (and table schemas where the deployment exposes them), run the question through any semantic search surface first (search-hybrid and friends), then write read-only SQL against exact qualified table names for the precise answer, check the truncated flag before trusting counts, and report with the query attached. Use whenever the user wants to query, explore, or answer questions from data a skardi-server already serves — Postgres, MySQL, SQLite

Licence
Apache-2.0
Last repository change
23.10.2026

Assessment and security

87/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability17 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
5
Deprecation

No signals detected. Repository changed on 23.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Answer questions from live data through a running skardi-server using the skardi CLI. Discover at runtime what sources and named pipelines the server has (and table schemas where the deployment exposes them), run the question through any semantic search surface first (search-hybrid and friends), then write read-only SQL against exact qualified table names for the precise answer, check the truncated flag before trusting counts, and report with the query attached. Use whenever the user wants to query, explore, or answer questions from data a skardi-server already serves — Postgres, MySQL, SQLite

Original author description

Answer questions from live data through a running skardi-server using the skardi CLI. Discover at runtime what sources and named pipelines the server has (and table schemas where the deployment exposes them), run the question through any semantic search surface first (search-hybrid and friends), then write read-only SQL against exact qualified table names for the precise answer, check the truncated flag before trusting counts, and report with the query attached. Use whenever the user wants to query, explore, or answer questions from data a skardi-server already serves — Postgres, MySQL, SQLite

How it works

  1. What this skill is not
  2. Prerequisites
  3. Rule zero: ask the server, not your memory
  4. The retrieval flow
  5. Reporting the answer
Original SKILL.md headings · 290 lines, 4,433 words
SKILL.md preview
---
name: retrieval
description: 'Answer questions from live data through a running skardi-server using the skardi CLI. Discover at runtime what sources and named pipelines the server has (and table schemas where the deployment exposes them), run the question through any semantic search surface first (search-hybrid and friends), then write read-only SQL against exact qualified table names for the precise answer, check the truncated flag before trusting counts, and report with the query attached. Use whenever the user wants to query, explore, or answer questions from data a skardi-server already serves — Postgres, MySQL, SQLite, MongoDB, files, or SaaS sources such as GitHub and Slack registered in its ctx — or asks what data is available. Trigger on: query our database, ask our data a question, what tables do we have, run SQL through skardi, use the skardi CLI, how many orders/users/events, answer from the warehouse, which PRs are open or still unreviewed, who reviewed or commented on an issue, how many issues we closed last month, release, commit and workflow-run history, Slack conversations and files. Reach for this rather than gh or another vendor CLI whenever the question covers more than one record, needs history or aggregation, or joins a SaaS source with another source; a single known-record lookup through the vendor CLI is still fine. Requires a reachable skardi-server; this skill does not build search indexes (auto-context does that), does not write data (the job path does that), and does not set up or start servers.'
metadata:
  skardi-min-version: "0.5.0"
---

# retrieval — answer questions from live data through skardi

Your job: take a concrete question, find the data behind a running skardi-server that answers it, and come back with the answer plus the query that produced it. The loop is always the same: **check whether it was asked before → discover → search meaning first → SQL for precision → check what came back → report**. The first step applies whenever `skardi-query-log` is in your skill list; step 0 below.

The `skardi` CLI is a thin HTTP client — every command below is one request to the server, which holds the query engine, the source registrations, and the safety policy. You never need database drivers, connection strings, or credentials for the backing stores; if the server is reachable, you can work.

## What this skill is not

- **Not index building.** If the user wants documents made searchable, a RAG surface, or embeddings — that is the `auto-context` skill. This skill *consumes* whatever search surface already exists.
- **Not writing.** Retrieval means `SELECT`. Writes (INSERT / UPDATE / DELETE, scheduled materialization) belong to Skardi's job path with its own review; do not do them from here even when a source would allow it.
- **Not server operations.** No server running, no sources registered, missing token — report what is missing and stop. Do not install, start, or reconfigure a server as a side effect of answering a question.

## Prerequisites

1. **The `skardi` CLI on PATH.** One small binary, no runtime deps. Check with `skardi --version`. Install from the [GitHub releases page](https://github.com/SkardiLabs/skardi/releases) — download the tarball for your platform, untar, put `skardi` on PATH.
2. **A reachable skardi-server.** Connection resolves in this order: `--server <URL>` flag → `$SKARDI_SERVER_URL` → `~/.skardi/config.yaml` → default `http://127.0.0.1:8080`. If auth is enabled on the server, pass `--token` or set `$SKARDI_API_TOKEN`.
3. **Exit code contract:** `2` means the server was unreachable. That is an environment problem, not a query problem — see the stuck protocol.

This skill runs on **v0.5.0 or later** of both CLI and server. **The `--purpose` / `--session-id` audit pair and the `--task` that rides with it need v0.6.0 or later** — the exception below. Deployment behavior — which sources exist, what is read-only, row caps — is discovered live and is never assumed from this text.

> **One exception: `--purpose`, `--session-id` and `--task` need Skardi v0.6.0.**
> The pair ([skardi#232](https://github.com/SkardiLabs/skardi/pull/232)) and
> `--task` ([skardi#255](https://github.com/SkardiLabs/skardi/pull/255)) are
> both in v0.6.0: its `skardi query --help` lists all three flags, and its
> server records them in the audit ledger as `ai_context`. v0.5.0 has none of
> them — the CLI has no such flags (`git grep session-id v0.5.0 --
> crates/cli/` is empty) and the server has no `ai_context` at all
> (`git grep ai_context v0.5.0 -- crates/server/` is empty), so on a v0.5.0
> server there is no ledger for them to land in. On v0.5.0, run the queries
> below without `--purpose`, `--session-id` and `--task`; everything else in this skill holds there.
>
> **Probe the capability rather than trusting the version.** A build of `main`
> taken between releases prints the previous release's number, so
> `skardi --version` alone can mislead. `skardi query --help` lists `--purpose`
> exactly when the build carries the pair, and lists `--task` exactly when it
> has that too; probe each separately. Each command template below shows, on
> commented lines, its form for a build without `--task` and its v0.5.0 form.
> Where `--task` is missing, drop it and send the pair alone; nothing else changes.

Before the first query, run this block. It does the capability check, mints
the one session id every query in this task will reuse (only when the audit pair
is available), and, when `skardi-query-log` is installed next to this skill and
the server is one you host yourself, asks its index whether this question has
been answered before:

```bash
if skardi query --help | grep -q -- '--purpose'; then
  SKARDI_SESSION=$(uuidgen 2>/dev/null || echo "sess-$(date +%s)-$$")
fi
skardi query --help | grep -q -- '--task' && echo "this build takes --task"
ASK="<this skill's directory>/../skardi-query-log/scripts/ask.py"
# ask.py sends no API token, so it only serves a self-hosted server without auth.
# Skip it on Skardi Cloud (current context mode is cloud) and whenever a token is
# in play: in the environment, or saved with the current context in config.yaml.
CUR=$(skardi config get-contexts 2>/dev/null | awk '$1=="*"{print $2, $3}')
SAVED_TOKEN=$(skardi config view 2>/dev/null | awk -v cur="${CUR%% *}" '
  /^[^ -]/ { top = $1 }
  /^ *- name:/ { n = $0; sub(/^ *- name: */, "", n); gsub(/"/, "", n); mine = (n == cur); next }
  /^ *token:/ && ((top == "contexts:" && mine) || top == "spec:") { print "yes"; exit }')
if [ -f "$ASK" ] && [ -z "$SKARDI_API_TOKEN" ] && [ -z "$SAVED_TOKEN" ] \
   && [ "${CUR#* }" != cloud ]; then
  USE_QUERY_LOG=1
  python3 "$ASK" "<the user's question, in plain words>"
fi
```

When the build takes `--task`, also settle the task line now, before the first
query: one line naming the larger piece of work this run of queries serves
(step 3 says what makes a good one). Write it down once and pass the exact
same string with `--task` on every query of the task, peeks included. Every
task gets one, even a single question: then the task line is that question.

Read what the last line printed before running anything else. If it lists a
question that is the same as this one, go straight to step 0 and reuse its SQL;
no `skardi schema` is needed. If it printed nothing (`skardi-query-log` is not
installed, or this is Skardi Cloud or a server that takes a token) or no
candidate matches, go on to discovery.

## Rule zero: ask the server, not your memory

Which tables exist, which pipelines are registered, what a column means, what is writable — these are **deployment facts**. They differ per server and change under you. Re-discover them in every session rather than carrying them over from a previous conversation or from this file. The one thing that comes before discovery is step 0: a question already filed in the `skardi-query-log` index comes with SQL that ran against this server, and running it again is the check.

| Question | Command |
|---|---|
| Is the server up? | `skardi health` |
| Is source X reachable for pipeline Y? | `skardi health <pipeline>` |
| What data is there? | `skardi schema` |
| Which pipelines are registered? | `skardi pipeline list` |
| What does pipeline X take? | `skardi pipeline show X` |

**Read what came back; do not check it against an expected shape.** These
commands answer differently across deployments, and a route that exists on one
is absent on another — a hosted gateway may answer `404` with an empty body to
`pipeline list`, `pipeline show` and `health <pipeline>` while `health` and
`schema` work fine. That is not a broken server; it is a deployment without
that surface. Treat an empty or 404 answer as "this deployment does not offer
it" and take the documented fallback (step 2 goes straight to SQL), rather than
retrying or assuming the command is misused.

Two consequences worth stating, because instructions further down lean on them:

- **`skardi schema` may or may not carry operator-written descriptions.** They
  come from a semantics overlay the server was started with, and plenty of
  deployments have none. Where they are absent, column meaning has to come from
  a `LIMIT 5` peek (step 3) and from asking, not from this file.
- **`skardi health <pipeline>`, where it exists, has a known false negative:** a
  source registered at catalog level can report `unhealthy — No table named
  '<source>'` while queries against it work. Confirm with a real query before
  believing a source is down.


## The retrieval flow

### 0. Has this been asked before?

**This step applies only when the opening block under Prerequisites set `USE_QUERY_LOG`: `skardi-query-log` is installed and the server is self-hosted with no token.** Then the block already ran `ask.py`; act on what it printed before anything else in this flow. On Skardi Cloud, or any server that takes a token, skip this step and send every query, the final one included, with `skardi query` as steps 1 to 3 show: `ask.py` cannot authenticate there.
Its `ask.py` keeps an index of questions already answered and the SQL that
worked for each, plus pitfalls filed from earlier failures. Checking it takes
one command; skipping it means rediscovering the schema and rewriting a
statement a previous session already got right.

```bash
python3 <that skill's directory>/scripts/ask.py "<the user's question, in plain words>"
```

It needs a small config file the first time; `skardi-query-log`'s SKILL.md says
what goes in it. Write it before running the command rather than skipping this
step.

- **One of the listed questions is the same question**: reuse its SQL, changing
  only the parameters (a date, a limit), and run it through
  `ask.py "<question>" --sql "<SQL>" --session-id "$SKARDI_SESSION" --task "<task line>"`.
  Then go to step 4.
- **It says the skardi CLI is pointed at another server**: the index belongs to
  that other server. Continue with step 1 and send every query with `skardi query`.
- **None matches**: continue with step 1. When you have the query that answers
  the question, run that final query through the same `ask.py … --sql` command
  instead of `skardi query`, so the next session finds it. Peeks and schema
  discovery stay on `skardi query`.
- `--session-id` and `--task` keep the final query in the same session and task
  as the peeks, exactly as `skardi query` would send them. Drop `--task` on a
  build without it.
- **A filed pitfall mentions a table you are about to use**: read it before
  writing SQL.

Whether a listed question is the same question is your judgement; the script
only lists candidates. When `skardi-query-log` is not in your skill list, start at step 1.

### 1. Locate the data

Run `skardi schema` and read the answer it gives you. Each source arrives with a
name, a type, and a list of tables; each table arrives with a name and a column
list. **Both the name shape and whether columns are enumerated vary by how the
source was registered, so take them from the response rather than from a
category in this file.**

- **Use table names exactly as `schema` printed them.** Some are bare
  (`orders`), some are two- or three-part (`shop.main.orders`,
  `saas.github_repo.issues`). Copy the string; do not reassemble it from parts
  and do not add or strip qualification.
- **If a table came back with its columns, that is your schema** — no further
  verification is needed or available.
- **If a table came back with an empty column list**, the deployment does not
  enumerate it. `SHOW TABLES` and `information_schema` are not available, and
  `DESCRIBE` is refused on some deployments (`HTTP 400 unsupported-statement`),
  so do not build a verification step on either. Peek instead:

  ```bash
  skardi query --purpose "peek at orders to learn its columns" --session-id "$SKARDI_SESSION" \
    --task "Q3 retention review" \
    -e "SELECT * FROM shop.main.orders LIMIT 5" --table
  # build without --task (probe: skardi query --help): drop that one flag:
  # skardi query --purpose "peek at orders to learn its columns" --session-id "$SKARDI_SESSION" \
  #   -e "SELECT * FROM shop.main.orders LIMIT 5" --table
  # v0.5.0 build (no --purpose/--session-id/--task): drop all three:
  # skardi query -e "SELECT * FROM shop.main.orders LIMIT 5" --table
  ```

  (`$SKARDI_SESSION` is the task's session id and the `--task` value is the
  task line; step 3 explains all three. Settle both before the first query,
  peeks included.)

  A successful peek both proves the name and shows the columns. If the peek
  fails, stop and ask for the table list rather than iterating guesses.

Extract two things before writing any real query:

- **Exact table names, exactly as printed.** A wrong or under-qualified name fails without saying so: deployments answer either `query_execution_error (HTTP 500)` or `HTTP 400 planning-failed`, and neither names the table. Treat any unexplained planning or execution failure as "check my table name first".
- **Column meanings.** If descriptions are present, trust them over column-name guesses; where the deployment has no semantics overlay they will be absent, and a `LIMIT 5` peek plus asking is the only honest substitute — `amount_cents` meaning "divide by 100" is the kind of fact that silently corrupts an answer when skipped.

If the question names data you cannot find, say so — do not query a lookalike table and present it as the answer.

### 2. Search meaning first, SQL second — in that order, not either/or

Check `skardi pipeline list` for a search surface: the `auto-context` standard names (`search-hybrid`, `search-vector`, `search-fulltext`), or a pipeline the operator has declared to be one. Name-shape is how you *find* candidates; whether you may *call* one is decided by the declaration rule below.

- **If one exists (and clears the declaration rule below), run the user's question through it first**, even when you expect to write SQL afterwards. It searches indexed content — documentation, policies, definitions, past decisions — and what comes back tells you what the terms in the question *mean* before you count anything. A question like "how many refunds under the new policy" needs the policy text (semantic surface) before the refund count (SQL) can be right:

  ```bash
  skardi run search-fulltext -p 'query=refund policy' -p limit=5
  # → "Refund policy changed on 2026-07-15: refunds are now allowed within 30 days …"
  ```

  (`search-hybrid` takes more parameters — `query`, `text_query`, `vector_weight`, `text_weight`, `limit`. Check the signature with `pipeline show`: matching the standard shape makes a pipeline worth *proposing*; the declaration rule below still decides whether you may call it.)

- **If the search result alone answers the question** (a "what does X say / find the doc about Y" question), stop there and cite the sources it returned.
- **Search hits inform your SQL; they never override the data.** An indexed document can be stale or off-topic — use what it says to shape filters and interpret terms, but the registered tables are the system of record for numbers. If a document and the data disagree, report both, don't average them.
- **If no search surface exists, go straight to SQL.** Do not build one — that is `auto-context`'s job, offer it as a follow-up instead.

**Which pipelines may you run at all? Default: none — a declaration is required.** Pipeline SQL is validated when the server loads it, so a pipeline that would write to a `read_only` source cannot even register (the server refuses to start with it). But a write to a source the operator marked `read_write` is a perfectly legal pipeline — every `auto-context` deployment ships `ingest` / `ingest-chunked`, which insert rows — and `pipeline show` does not reveal the SQL, so **nothing you can inspect at runtime proves a pipeline is read-only**. Names and parameter shapes are labels, not proof: an INSERT pipeline *named* `search-fulltext` with `query`/`limit` parameters would pass every look-based test. Not writing is a hard promise of this skill, so looks never authorize a call. A pipeline is callable only when **both** hold:

1. **Someone accountable has declared this specific pipeline read-only.** Two forms count: the operator wrote it into the source's semantics description, which you read in `skardi schema` (e.g. an index table described as "served by the **read-only** search-fulltext pipeline"), or the user/operator confirms it in this session. **Many deployments carry no descriptions at all** — where `schema` returns none, the first form is simply unavailable and asking in this session is the only route; the absence authorizes nothing on its own. A description that merely *mentions* a pipeline's name declares nothing — what authorizes is the operator saying it does not write. Matching an `auto-context` standard signature — `search-fulltext(query, limit)`, `search-vector(query, limit)`, `search-hybrid(query, text_query, vector_weight, text_weight, limit)` — is a strong reason to *propose* one ("this looks like auto-context's standard search pipeline — confirm it's the unmodified read-only one and I'll use it"), but the declaration is what authorizes, not the match. Ask once per pipeline and keep the answer for the session.
2. **The declaration also covers the result bound.** Parameter shapes prove nothing here either: a parameter *named* `limit` is not evidence the SQL applies it as a `LIMIT`, and a parameter named `id` is not evidence of a unique key — `pipeline show` cannot show you the SQL. The bound must be part of the accountable statement: "honors `limit` — returns at most that many rows", "unique-key lookup, at most one row", or "the unmodified auto-context standard pipeline" (whose shipped templates bound results by construction). With the bound declared, still pass `limit` explicitly and small (start at 5–20, raise deliberately) wherever the parameter exists, because `skardi run` output is not row-capped. A pipeline whose declaration is silent on the bound is not callable — get those rows through ad-hoc SQL with a `LIMIT` instead.

Everything else — however retrieval-flavored its name — you do not call from this skill. Answer with an ad-hoc `SELECT` (validated read-only on every request) or ask what the pipeline is. Never run a pipeline to find out what it does.

**This rule is a workaround for a gap the engine still has (v0.7.0 included), and is meant to go away.** Asking a human to vouch for a pipeline is what you do when the machine cannot answer — and here it nearly can: the server already determines each pipeline's statement kind when it validates the SQL at load time (that is how a pipeline writing to a `read_only` source gets rejected at startup). It simply does not expose that verdict, so `pipeline show` returns parameters and nothing about what the statement does. Once the server reports statement kind — ideally alongside a result-bound signal — this whole declaration dance collapses into one runtime question the agent asks the engine, and the two conditions above should be deleted rather than maintained. That belongs to the runtime capability contract the engine still owes its callers; until it exists, declarations are the only honest way to keep the read-only promise.

Invocation: `skardi run <name> -p key=value` — values parse as JSON first (numbers, booleans), then fall back to plain strings.

### 3. Ad-hoc SQL: read-only, one statement at a time

On a build with the audit pair, the Prerequisites check has already minted one
session id for this task. Reuse it for every query, including the peek:

```bash
skardi query --purpose "order counts by lifecycle state" --session-id "$SKARDI_SESSION" \
  --task "Q3 retention review" \
  -e "SELECT status, COUNT(*) AS n FROM shop.main.orders GROUP BY status" --table
# build without --task (probe: skardi query --help): drop that one flag:
# skardi query --purpose "order counts by lifecycle state" --session-id "$SKARDI_SESSION" \
#   -e "SELECT status, COUNT(*) AS n FROM shop.main.orders GROUP BY status" --table
# v0.5.0 build (no --purpose/--session-id/--task): drop all three:
# skardi query -e "SELECT status, COUNT(*) AS n FROM shop.main.orders GROUP BY status" --table
```

- **Every `skardi query` carries `--purpose` and `--session-id`.** They are sent as the `ai_context: { purpose, session_id }` object on the request, which is what the server's audit ledger records, the daily brief's intent breakdown groups by, and session-level learning aggregates on — a query without them lands as "(no declared intent)" with no session. The pair is all-or-nothing (the server rejects one without the other; the CLI enforces it too, since [skardi#232](https://github.com/SkardiLabs/skardi/pull/232), in v0.6.0 and later). `--purpose` is one plain-language line on why this query runs, ≤2000 characters; `--session-id` is any non-empty string ≤200 characters — one id per task, minted once (`uuidgen`) and reused across the task's queries so they group as one session. Purpose belongs in the flag, not in a SQL comment: a comment rides inside the SQL text where nothing aggregates it. (If SQL text does start with a comment, use the block form — a leading `-- comment` makes the CLI misparse `-e "--..."` as a flag.)
- **Every `skardi query` also carries `--task` when the build takes it** (the Prerequisites probe says whether it does). `--purpose` says why *this* query runs; `--task` names the larger piece of work the whole run of queries serves, like "September cross-repo delivery review" or "why checkout errors rose last week". It is sent as `ai_context.task`, which the daily brief reads to say what a day of queries was *for*: purposes alone summarize as a list of lookups, because the larger goal is written in no single row. Pick it once at the start of the task and repeat it **verbatim** on every query that serves the task, peeks included; a reworded task reads as a different piece of work. It only travels with the pair: the CLI refuses `--task` without `--purpose`. When the work really is one question, the task line is that question; send it anyway, so a build that takes `--task` records one on every query.
- **SELECT only.** The server already rejects DDL and COPY outright, and rejects writes to any source not explicitly configured `read_write` — but do not lean on that: retrieval work is read work, even on writable sources.
- **One statement per request.** The server rejects multi-statement SQL (`Expected exactly one SQL statement`). Run follow-ups as separate calls.
- **Peek before the real query.** `SELECT * FROM <table> LIMIT 5` shows you actual value shapes — date formats, status spellings, NULL patterns — that schema output cannot. One peek prevents most wrong-filter answers.
- **Aggregate in SQL, not in your head.** `COUNT`, `SUM`, `GROUP BY` on the server beat pulling rows and counting them yourself — pulled rows are capped (next section) and the cap corrupts client-side aggregation silently.
- **The dialect is DataFusion SQL** (PostgreSQL-flavored), regardless of what the backing store is. Write standard SQL; do not use backend-specific syntax (SQLite pragmas, MySQL backticks, Postgres extensions).
- **Never go around the server.** Even if you can see a connection string or the SQLite file path, do not query the backing store directly with `sqlite3` / `psql` / a driver. The server *is* the governed path — read-only enforcement, row caps, and the audit trail all live there, and an answer produced behind its back has none of them.

### 4. Read the response before repeating it

Ad-hoc query results are capped at **1000 rows by default** (`--max-rows` to change). When the cap bites, the CLI prints the rows it got to stdout and this note to **stderr**:

```
note: results truncated; pass a higher --max-rows to see the rest
```

- **Check stderr, not just the rows.** A truncated row set looks complete if you only read stdout. Any count, sum, or "all X" claim built on it is wrong — push the aggregation into SQL (preferred) or re-run with an explicit `--max-rows` high enough to be provably complete.
- **Pipeline results are not capped by this mechanism.** `skardi run` returns whatever the pipeline's SQL returns — control size through the pipeline's own parameters (`limit` and friends).
- **Cross-check a number that matters.** Before reporting a business-relevant figure, confirm it with one differently-shaped query — e.g. verify a `GROUP BY` total against a plain `COUNT(*)`. Two queries that agree are evidence; one query is a draft.
- **Empty result ≠ "there is none".** First re-check the filter values against a `LIMIT 5` peek (status spelled `paid` vs `PAID`), then say "none found under these filters" — with the filters named.

### 5. When stuck, stop cleanly

| Symptom | Meaning | Do |
|---|---|---|
| exit code 2 | server unreachable | Report it with the URL you tried. Do not retry in a loop; do not start a server yourself. |
| HTTP 400, refusal code, no detail | the statement hit policy. Codes seen in the wild: `sql_validation_error`, `unsupported-statement` (a write, `DESCRIBE`, `SHOW`), `planning-failed` (a name that did not resolve, multiple statements). **The message names nothing** — the code is all you get, and the same code covers several causes | Read the code, not a message. For `unsupported-statement`, rewrite as a single read-only `SELECT`; if the task genuinely needs a write, say it belongs to the job path and hand it back. For `planning-failed`, re-check the table name against what `schema` printed, then that the SQL is one statement. |
| HTTP 500, no detail | a wrong or under-qualified table name; also non-DataFusion syntax | Re-check the name against step 1 by peeking at it, fix qualification, retry once. The precise cause is only in the server logs, which the operator has and you may not. |
| HTTP 403 | authorization did not resolve — not the same as being denied. Message is generic by design (the resource stays in the operator's log so a listing cannot be used to enumerate hidden sources) | Retry; a transient one clears. If it persists while other callers succeed, report it and ask the operator for the log line — you cannot tell from the response which of several causes it was. |
| pipeline parameter errors | wrong names or types | Re-read `skardi pipeline show <name>`, match names exactly. |
| the same question failed 3 times | you are guessing | Stop. Show the user what you tried, what came back, and your best hypothesis of what is missing (a source not registered? a semantics overlay that would explain columns? a search surface that does not exist?). |

An honest "here is what I tried and where it stopped" beats a fourth guess.

## Reporting the answer

Lead with the answer, then attach the evidence so the result can be re-run and audited:

```
410 orders are paid, totalling ¥507,467.60.

— from shop.main.orders via skardi query
  build with --task: --purpose "paid order count and revenue" --session-id 3fa4… --task "Q3 retention review"
  build with the pair only: --purpose "paid order count and revenue" --session-id 3fa4…
  v0.5.0 build: /* purpose: paid order count and revenue */ (readability only; no ledger intent)
  SELECT COUNT(*) AS n, SUM(amount_cents)/100.0 AS total_yuan
  FROM shop.main.orders WHERE status = 'paid'
  1 row, not truncated; cross-checked against GROUP BY status over all 1500 orders
```

State which source and table the answer came from, the exact query or pipeline + parameters, and the truncation status. If the semantic surface contributed context, cite what it returned too. If anything about the answer is approximate — sampled peek, capped rows, ambiguous column meaning — say so in the same breath as the number, not as a footnote.
Files in this package (2)
  • SKILL.md 28 KB
  • evals/evals.json 7 KB

Versions

The database has no other skills named retrieval.

Database snapshot: 13.11.2026 · package version dab97c42f050 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100skardi-query-log
    Before you send Skardi another ad-hoc SQL statement, check whether you have already asked this question — if you have, reuse the SQL that worked instead of rewriting it. **Come here after a failure too**: the errors record what the system cannot answer and where people have…
  • 82graph-rag
    Answer a question about a knowledge graph or property graph served by a skardi-server — including graphs stored in Postgres via Apache AGE. Two shapes, one skill: when the question already names the entity (what implements UpgradeStep, who calls verify_token, what does this…
  • 100query-supabase
    Answers questions about the data in this project's Supabase Postgres database by running read-only SQL through scripts/db/supabase-query.sh, instead of handing the user a query to paste into the SQL editor. Lists tables and columns first, writes schema-qualified SQL, and shows…
  • 100sql
    Write, run, and explain SQL queries, and do quick local analysis of CSV/SQLite data with the sqlite3 CLI. Use when users want a SQL query written or fixed, want to query a .db/.sqlite file, or want to analyze a CSV with SQL (joins, group by, window functions). Triggers on…
  • 86database-query
    当用户要连接外部数据库(SQLite / MySQL / PostgreSQL)编写 SQL、查询数据、导出结果或分析库表结构时使用。
  • 100squix
    Run SQL queries across databases (Postgres, MySQL, SQLite, etc.) via the squix CLI. Use for running named queries, exploring schema, or parameterized queries. Always use -f for non-interactive output.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.