> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcanonic.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Your first answer in minutes.

The fastest path uses **local connectors**: no server, no network. Pick either SQLite or DuckDB.

<Frame caption="canonic setup end-to-end on the vehicle rental example.">
  <img src="https://mintcdn.com/canonic/iaMOZpE926F52sVw/demo_canonic_setup.gif?s=3d424aac8bd4ed10e0852324fd6bcd34" alt="canonic setup walkthrough on the rental example" width="1200" height="800" data-path="demo_canonic_setup.gif" />
</Frame>

See the [Rental guide](/guides/rental) for the full walkthrough behind this recording.

<Note>
  Don't have a database handy? The [Guides](/guides/jaffle-shop) section ships 5 ready-to-run sample projects (dbt Jaffle Shop, e-commerce, rental, SaaS analytics, Dutch railway), a good way to try the wizard before pointing it at your own data.
</Note>

<Tabs>
  <Tab title="SQLite">
    Point at a local `.db` file:

    ```bash theme={null}
    canonic setup
    # Point at a .db file when prompted
    ```
  </Tab>

  <Tab title="DuckDB">
    Point at a local `.duckdb` file, or let it read CSV/Parquet/JSON directly:

    ```bash theme={null}
    canonic setup
    # Point at a .duckdb file, or let it read a CSV/Parquet directly
    ```
  </Tab>
</Tabs>

<Warning>
  If your source needs a password (Postgres) or your LLM provider needs an API key, set the corresponding environment variable **before** running `canonic setup`: canonic never stores secrets in `canonic.yaml` directly, only a `credentials_ref` like `env:WAREHOUSE_PASSWORD` pointing at it:

  ```bash theme={null}
  export WAREHOUSE_PASSWORD=...      # for a Postgres/Redshift connection
  export ANTHROPIC_API_KEY=...       # or OPENAI_API_KEY / CANONIC_LLM_API_KEY, if configuring an LLM
  ```

  See [Configuring an LLM](/configuring-an-llm) and [`canonic connection`](/cli-reference/connection) for the full credential reference formats (`env:`, `keyring:`, `file:`).
</Warning>

## What the wizard does

<Steps>
  <Step title="Name your project">
    Give your canonic project a name.
  </Step>

  <Step title="Connect a source">
    SQLite/DuckDB file, or Postgres if you have a server.
  </Step>

  <Step title="Configure an LLM (optional)">
    Skippable: the core works without one. See [Configuring an LLM](/configuring-an-llm).
  </Step>

  <Step title="Bootstrap">
    canonic introspects the schema and drafts your semantics.
  </Step>

  <Step title="First answer">
    The wizard runs a real query against your data and shows the result, plus how fresh it is and which definition it used.
  </Step>
</Steps>

## Ask your own questions

You now have a working context layer committed to your repo:

```bash theme={null}
canonic query --metrics revenue --dimensions order_date
canonic query --metrics revenue --filter "status=paid"
```

For a query with more filters or joins than is comfortable inline, write a `SemanticQuery` JSON file and pass it with `-f` instead; see [`canonic query`](/cli-reference/query-sql-assert) for the full flag reference.

<Note>
  `canonic knowledge search` is not implemented yet; see [CLI Reference: knowledge](/cli-reference/knowledge) for its current status.
</Note>

## Review what canonic drafted

It's all an ordinary git diff:

```bash theme={null}
canonic review
canonic status        # always tells you the best next step
```

## Out of the box vs. a bit more effort

**Works immediately, zero modeling:**

* Connect a database (SQLite or Postgres) and canonic introspects the live schema.
* It auto-drafts semantics: typed columns, primary-key grains, foreign-key joins, and additive measures (sums, counts).
* The setup wizard ends by **answering a real question from your data**, so you see the payoff in minutes.
* Connect your agent over MCP and start asking.

**A bit more manual effort (when you need it):**

* **Canonical bindings**: when two sources define "revenue" differently, you pick the authoritative one. canonic surfaces the ambiguity; you resolve it once.
* **Knowledge prose**: the business "why" behind a definition; canonic drafts it, you refine it.
* **Guardrails & contracts**: mandatory filters, required dimensions, final-vs-provisional rules. Added when a number needs protecting.
* **Non-additive metrics**: ratios, averages, distinct counts, balances. Declared as composable definitions so they stay correct at any grain.
* **More sources**: dbt / Metabase / Notion / web pages, layered on as context evidence. The connector contract is extensible, so a Confluence, Jira, or other wiki/knowledge-base connector can be added the same way.

The design principle throughout: **canonic proposes, you approve.** It never silently edits your context: every change is a reviewable diff.
