<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[AI Data]]></title><description><![CDATA[AI Data]]></description><link>https://ai-data.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 21:55:37 GMT</lastBuildDate><atom:link href="https://ai-data.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[The Same DuckDB Table, Two Definitions, Two Opposite Trends]]></title><description><![CDATA[DuckDB is often the right tool when you want local SQL over files, without standing up a database server. This walkthrough stays in that world: one CSV…]]></description><link>https://ai-data.hashnode.dev/the-same-duckdb-table-two-definitions-two-opposite-trends</link><guid isPermaLink="true">https://ai-data.hashnode.dev/the-same-duckdb-table-two-definitions-two-opposite-trends</guid><category><![CDATA[duckDB]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Node.js]]></category><category><![CDATA[data analysis]]></category><dc:creator><![CDATA[Rena Z]]></dc:creator><pubDate>Tue, 01 Dec 2026 17:05:01 GMT</pubDate><content:encoded><![CDATA[<p>DuckDB is often the right tool when you want local SQL over files, without standing up a database server. This walkthrough stays in that world: one CSV, explicit DuckDB SQL, and totals you can check.</p>
<p>The catch is not the engine. It is the metric.</p>
<p>I used AVA's official synthetic retail dataset — 18,971 line items, 15,510 orders, snapshot date 2026-10-05 — from the <a href="https://github.com/antvis/AVA/tree/ai/data/retail-semantics"><code>retail-semantics</code></a> folder on the <code>ai</code> branch of <a href="https://github.com/antvis/AVA">antvis/AVA</a>. Under the project's finance definition, net sales fell from CNY 4,293,025.42 in August 2026 to CNY 3,697,575.18 in September, a drop of CNY 595,450.24, or 13.87%. Under the trading definition, net sales rose from CNY 6,740,687.05 to CNY 7,803,998.06, an increase of CNY 1,063,311.01, or 15.77%.</p>
<p>Those totals are published in the dataset README and were independently cross-checked there. I reproduced them in two ways on 2 December 2026: a direct pass over the CSV in Python, and AVA's CLI, which runs the queries on its default Node.js engine, DuckDB. Both routes matched.</p>
<p>This is a follow-up to <a href="https://dev.to/yvonneyx/give-your-coding-agent-inspectable-data-analysis-without-a-second-model-key-466m">Give Your Coding Agent Inspectable Data Analysis Without a Second Model Key</a>, which used an 8-row sample. The idea is the same: if you cannot read the SQL, you cannot trust the trend.</p>
<p>The file is synthetic. It is not a real company. It also has no inventory, traffic, or advertising events, so a change in net sales is not evidence of a stockout or a campaign.</p>
<h2>What AVA is doing with DuckDB</h2>
<p><a href="https://ava.antv.vision">AVA</a> 4.0 is an open-source TypeScript framework from AntV for data analysis and visualization in JavaScript applications and AI agents. In the Node.js SDK, omitting <code>engine</code> selects DuckDB. The engine creates an in-memory DuckDB instance, registers your sources as tables or views, and executes SQL you provide with <code>query</code> (or <code>ava query</code> on the CLI).</p>
<p>That is documented in the <a href="https://ava.antv.vision/documentation/engines/overview/">engine overview</a> and the <a href="https://ava.antv.vision/documentation/engines/duckdb/">DuckDB engine guide</a>. This walkthrough used <code>@antv/ava@4.0.5</code>, which depends on <code>@duckdb/node-api</code>. A local install on 2 December 2026 resolved <code>@duckdb/node-api@2.0.0-r.1</code>. I am not treating that npm tag as identical to a specific DuckDB LTS blog announcement.</p>
<p><code>query</code> does not call a model and does not rewrite your SQL from a semantic file. If you want the finance or trading definition, it has to appear in the statement you run. Commands such as <code>analyze</code> and <code>suggest</code> are different: they need model configuration. The earlier article covers that boundary.</p>
<p>DuckDB inside AVA is also not a full-privilege SQL shell. The engine guide describes several safeguards for model-generated SQL, and they apply here too:</p>
<ul>
<li>Exactly one read-only <code>SELECT</code> (including <code>WITH</code>); writes and multi-statement queries are rejected</li>
<li>External access is restricted after the source is registered</li>
<li>Automatic extension install and load are disabled by default</li>
<li>Default limits are 512 MB of memory, one worker thread, and a 30-second query timeout, separate from <code>maxRows</code> / <code>maxResultBytes</code> on returned rows</li>
</ul>
<h2>Get the file</h2>
<p>The CSV is about 4.6 MB. Download it from the official repository (default branch name: <code>ai</code>):</p>
<pre><code class="language-bash">curl -fsSL -o sales.csv \
  https://raw.githubusercontent.com/antvis/AVA/ai/data/retail-semantics/sales.csv
</code></pre>
<p>You need Node.js 22.13 or later. You can install the CLI globally with <code>npm install -g @antv/ava</code>, or use a project-local binary:</p>
<pre><code class="language-bash">npm install @antv/ava@4.0.5
npx ava source sales.csv &gt; session.json
DATASET_ID=$(node -p 'JSON.parse(require("fs").readFileSync("session.json", "utf8")).datasetId')
npx ava schema "$DATASET_ID" &gt; schema.json
</code></pre>
<p>Redirecting <code>source</code> matters: the CLI prints a guide in a terminal and JSON when piped or redirected.</p>
<p>Read <code>schema.json</code> before writing SQL. For this single CSV, the DuckDB loader exposes one table named <code>data</code>. The schema language is <code>duckdb-sql</code>. There are 29 columns, including <code>paid_at</code>, <code>completed_at</code>, <code>status</code>, <code>order_kind</code>, <code>business_model</code>, <code>selling_store_name</code>, <code>channel</code>, <code>product_name</code>, <code>line_paid_amount</code>, <code>refund_amount</code>, and <code>commission_rate</code>.</p>
<p>In this snapshot, every <code>self_operated</code> line has <code>commission_rate</code> of <code>1</code>, and every <code>consignment</code> line has <code>0.03</code>. That is why the official finance formula — which always multiplies by <code>commission_rate</code> — matches the prose that company-owned lines recognize the full paid amount minus refund, while consignment lines recognize commission only. Do not assume those rates on another file; read the data.</p>
<h2>Two official definitions</h2>
<p>Both definitions come from the published semantic files in the same folder. I am quoting the rules and the <code>net_revenue</code> expressions, not inventing a third metric.</p>
<p><strong>Finance</strong> (<code>semantic-finance.json</code>): net sales are recognized revenue on external customer orders that have been fulfilled. Keep <code>order_kind = 'customer_sale'</code> and <code>status = 'completed'</code>. Attribute the line to the calendar month of <code>completed_at</code>. Refunds in the 2026-10-05 snapshot are applied back to the original fulfillment month, not to <code>refunded_at</code>.</p>
<p>The official <code>net_revenue</code> expression is:</p>
<pre><code class="language-sql">SUM(
  CASE
    WHEN order_kind = 'customer_sale' AND status IN ('completed') THEN (
      ROUND(CAST(line_paid_amount AS DECIMAL(18, 2)) * CAST(commission_rate AS DECIMAL(6, 4)), 2)
      - ROUND(COALESCE(CAST(refund_amount AS DECIMAL(18, 2)), 0) * CAST(commission_rate AS DECIMAL(6, 4)), 2)
    )
    ELSE 0
  END
)
</code></pre>
<p><strong>Trading</strong> (<code>semantic-trading.json</code>): net sales are net payments from external customers. Keep <code>order_kind = 'customer_sale'</code> and <code>status</code> in <code>completed</code>, <code>shipped</code>, or <code>paid</code>. Attribute the line to the calendar month of <code>paid_at</code>. Company-owned and consignment lines both use the full line payment minus refund, with no commission multiplier. Paid but not-yet-fulfilled orders are included. Refunds are applied back to the original payment month.</p>
<p>The official <code>net_revenue</code> expression is:</p>
<pre><code class="language-sql">SUM(
  CASE
    WHEN order_kind = 'customer_sale' AND status IN ('completed', 'shipped', 'paid') THEN (
      CAST(line_paid_amount AS DECIMAL(18, 2))
      - COALESCE(CAST(refund_amount AS DECIMAL(18, 2)), 0)
    )
    ELSE 0
  END
)
</code></pre>
<p>Attribution is also defined: use <code>selling_store_*</code> for sales responsibility. <code>fulfillment_*</code> is where the order was fulfilled, and a centralized warehouse should not reassign the selling store.</p>
<h2>Run the two monthly totals</h2>
<p>Save this as <code>query-finance-months.sql</code>:</p>
<pre><code class="language-sql">SELECT
  date_trunc('month', CAST(completed_at AS DATE)) AS month,
  SUM(
    CASE
      WHEN order_kind = 'customer_sale' AND status IN ('completed') THEN (
        ROUND(CAST(line_paid_amount AS DECIMAL(18, 2)) * CAST(commission_rate AS DECIMAL(6, 4)), 2)
        - ROUND(COALESCE(CAST(refund_amount AS DECIMAL(18, 2)), 0) * CAST(commission_rate AS DECIMAL(6, 4)), 2)
      )
      ELSE 0
    END
  ) AS net_revenue
FROM data
WHERE CAST(completed_at AS DATE) &gt;= DATE '2026-08-01'
  AND CAST(completed_at AS DATE) &lt; DATE '2026-10-01'
GROUP BY 1
ORDER BY 1;
</code></pre>
<p>And this as <code>query-trading-months.sql</code>:</p>
<pre><code class="language-sql">SELECT
  date_trunc('month', CAST(paid_at AS DATE)) AS month,
  SUM(
    CASE
      WHEN order_kind = 'customer_sale' AND status IN ('completed', 'shipped', 'paid') THEN (
        CAST(line_paid_amount AS DECIMAL(18, 2))
        - COALESCE(CAST(refund_amount AS DECIMAL(18, 2)), 0)
      )
      ELSE 0
    END
  ) AS net_revenue
FROM data
WHERE CAST(paid_at AS DATE) &gt;= DATE '2026-08-01'
  AND CAST(paid_at AS DATE) &lt; DATE '2026-10-01'
GROUP BY 1
ORDER BY 1;
</code></pre>
<pre><code class="language-bash">npx ava query "$DATASET_ID" --dsl @query-finance-months.sql
npx ava query "$DATASET_ID" --dsl @query-trading-months.sql
</code></pre>
<p>You should see:</p>
<table>
<thead>
<tr>
<th>Definition</th>
<th align="right">August (CNY)</th>
<th align="right">September (CNY)</th>
<th align="right">Change (CNY)</th>
<th align="right">Change</th>
</tr>
</thead>
<tbody><tr>
<td>Finance</td>
<td align="right">4,293,025.42</td>
<td align="right">3,697,575.18</td>
<td align="right">−595,450.24</td>
<td align="right">−13.87%</td>
</tr>
<tr>
<td>Trading</td>
<td align="right">6,740,687.05</td>
<td align="right">7,803,998.06</td>
<td align="right">+1,063,311.01</td>
<td align="right">+15.77%</td>
</tr>
</tbody></table>
<p>The CLI returns <code>month</code> as a timestamp, such as <code>2026-08-01 00:00:00</code>. The net revenue type in this run was <code>DECIMAL(38,2)</code>.</p>
<p>Nothing in DuckDB "chose" a trend. The two statements include different statuses, use different date columns, and treat consignment income differently. If an agent only prints "sales were down in September," you cannot tell which of those choices it made.</p>
<h2>Where the finance decline came from</h2>
<p>The finance semantic file says to locate change by absolute amount, keep offsetting gains, and use selling store, channel, and product together. This query lists the five largest finance declines at that grain:</p>
<pre><code class="language-sql">WITH monthly AS (
  SELECT
    selling_store_name,
    channel,
    product_name,
    date_trunc('month', CAST(completed_at AS DATE)) AS month,
    SUM(
      CASE
        WHEN order_kind = 'customer_sale' AND status IN ('completed') THEN (
          ROUND(CAST(line_paid_amount AS DECIMAL(18, 2)) * CAST(commission_rate AS DECIMAL(6, 4)), 2)
          - ROUND(COALESCE(CAST(refund_amount AS DECIMAL(18, 2)), 0) * CAST(commission_rate AS DECIMAL(6, 4)), 2)
        )
        ELSE 0
      END
    ) AS net_revenue
  FROM data
  WHERE CAST(completed_at AS DATE) &gt;= DATE '2026-08-01'
    AND CAST(completed_at AS DATE) &lt; DATE '2026-10-01'
  GROUP BY 1, 2, 3, 4
)
SELECT
  selling_store_name,
  channel,
  product_name,
  SUM(CASE WHEN month = DATE '2026-08-01' THEN net_revenue ELSE 0 END) AS august_cny,
  SUM(CASE WHEN month = DATE '2026-09-01' THEN net_revenue ELSE 0 END) AS september_cny,
  SUM(CASE WHEN month = DATE '2026-09-01' THEN net_revenue ELSE 0 END)
    - SUM(CASE WHEN month = DATE '2026-08-01' THEN net_revenue ELSE 0 END) AS change_cny
FROM monthly
GROUP BY 1, 2, 3
ORDER BY change_cny
LIMIT 5;
</code></pre>
<p>The first row is 深圳南山店 / 线上商城 / 电动升降桌: August CNY 1,790,783.35, September CNY 1,232,006.98, change CNY −558,776.37. That single combination accounts for most of the CNY 595,450.24 finance decline. Grouping only by <code>selling_store_name</code> shows that 广州天河店 moved the other way, from CNY 518,590.81 to CNY 585,304.12, or +CNY 66,713.31, which offsets part of the drop. Both figures match the dataset README.</p>
<p>The file still cannot tell you why those combinations moved. There is no stock or media table to join.</p>
<h2>Cleanup</h2>
<pre><code class="language-bash">npx ava dispose "$DATASET_ID"
</code></pre>
<p>Sessions expire after 30 idle minutes. If that happens, load the source again and use the new dataset ID.</p>
<h2>What this is not</h2>
<p>It is not a benchmark of DuckDB, and it is not a claim that AVA replaces the DuckDB CLI for every workflow. If you already have a DuckDB script, you can run the same SQL there and compare. AVA's value in this path is a Node.js session around DuckDB, with inspectable <code>query</code> results, and — separately, when you want it — an agent skill that is supposed to show you the statement it ran.</p>
<p>It is also not a head-to-head with <a href="https://docs.pandas-ai.com/v3/introduction">PandasAI</a>. PandasAI is a Python library for asking questions of data in natural language. AVA's README describes AVA as a JavaScript-ecosystem counterpart, but there is no official PandasAI Node.js SDK in the PandasAI documentation I reviewed, and this article does not run both tools on the same question. A fair comparison belongs in a later piece, with documented features and no invented integration.</p>
<h2>What to read next</h2>
<ul>
<li>The dataset and official definitions: <a href="https://github.com/antvis/AVA/tree/ai/data/retail-semantics">https://github.com/antvis/AVA/tree/ai/data/retail-semantics</a></li>
<li>AVA DuckDB engine: <a href="https://ava.antv.vision/documentation/engines/duckdb/">https://ava.antv.vision/documentation/engines/duckdb/</a></li>
<li>AVA CLI reference: <a href="https://ava.antv.vision/documentation/reference/cli/">https://ava.antv.vision/documentation/reference/cli/</a></li>
<li>The 8-row introductory walkthrough: <a href="https://dev.to/yvonneyx/give-your-coding-agent-inspectable-data-analysis-without-a-second-model-key-466m">https://dev.to/yvonneyx/give-your-coding-agent-inspectable-data-analysis-without-a-second-model-key-466m</a></li>
<li>DuckDB documentation: <a href="https://duckdb.org/docs/">https://duckdb.org/docs/</a></li>
</ul>
<h2>Disclosure</h2>
<p>This article was drafted with AI assistance and reviewed against AVA's official documentation and the published <code>retail-semantics</code> files. The queries were executed locally with <code>@antv/ava@4.0.5</code> on 2 December 2026, and the monthly totals were also recomputed directly from the CSV. I am affiliated with work on AVA's developer content.</p>
]]></content:encoded></item><item><title><![CDATA[Give Your Coding Agent Inspectable Data Analysis Without a Second Model Key]]></title><description><![CDATA[You already have a coding agent. You should not need a second model API key just to load a CSV, run a query you can read, and save a chart. AVA 4.0 is an…]]></description><link>https://ai-data.hashnode.dev/give-your-coding-agent-inspectable-data-analysis-without-a-second-model-key</link><guid isPermaLink="true">https://ai-data.hashnode.dev/give-your-coding-agent-inspectable-data-analysis-without-a-second-model-key</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[AI]]></category><category><![CDATA[data visualization]]></category><category><![CDATA[duckDB]]></category><dc:creator><![CDATA[Rena Z]]></dc:creator><pubDate>Tue, 01 Dec 2026 16:47:18 GMT</pubDate><content:encoded><![CDATA[<p>You already have a coding agent. You should not need a second model API key just to load a CSV, run a query you can read, and save a chart.</p>
<p><a href="https://github.com/antvis/AVA">AVA</a> 4.0 is an open-source TypeScript framework from <a href="https://ava.antv.vision">AntV</a> for data analysis and visualization in JavaScript apps and AI agents. Its Agent Skill teaches your existing agent to use the AVA CLI. On the core path — <code>source</code> → <code>schema</code> → <code>query</code> → <code>viz</code> — the agent does the reasoning, AVA executes the work, and you do not configure a separate AVA model key. Your agent's own provider usage still follows that provider's pricing.</p>
<p>This matters because a useful analysis is one you can check. You should be able to see the SQL, the rows it returned, and the chart built from those rows.</p>
<p>This walkthrough uses the official 8-row sample from the <a href="https://ava.antv.vision/documentation/agent-skill/">Agent Skill guide</a>. I also ran the same CLI commands locally against <code>@antv/ava@4.0.5</code> on 1 December 2026. The totals match the documentation: January $30,000, February $37,500, net change +$7,500.</p>
<p>If you want to wire a custom agent loop in TypeScript instead, see Yuxin's earlier tutorial, <a href="https://dev.to/yvonneyx/build-a-data-analysis-agent-with-ava-40-duckdb-and-typescript-4pfe">Build a Data Analysis Agent with AVA 4.0, DuckDB, and TypeScript</a>. That article uses the JavaScript API. This one stays on the Skill and the CLI.</p>
<h2>What needs a model key, and what does not</h2>
<p>The <a href="https://ava.antv.vision/documentation/agent-skill/">Agent Skill</a> and <a href="https://ava.antv.vision/documentation/reference/cli/">CLI</a> documentation draw a clear line:</p>
<ul>
<li>No separate AVA model key: loading structured data (<code>source</code>), inspecting structure (<code>schema</code>), profiling, managing business definitions (<code>semantic</code>), executing a query you provide (<code>query</code>), and rendering a chart spec you already have (<code>viz</code>).</li>
<li>Model configuration required: <code>analyze</code>, <code>suggest</code>, <code>translate</code>, <code>recommend</code>, and <code>visualize</code>, plus text extraction. For dataset sessions, set those model variables <em>before</em> you run <code>ava source</code>. Session model settings cannot be changed afterward.</li>
</ul>
<p>Do not read "no second key" as "AVA never needs a model." It means the inspectable core path can run on the agent's own reasoning.</p>
<h2>Prerequisites</h2>
<ul>
<li>Node.js 22.13 or later</li>
<li>npm</li>
<li>macOS or Linux for the shell commands below (the Skill documents PowerShell equivalents for Windows)</li>
</ul>
<h2>Install the CLI and the Skill</h2>
<p>From the <a href="https://ava.antv.vision/documentation/agent-skill/">Agent Skill guide</a>:</p>
<pre><code class="language-bash">npm install -g @antv/ava
npx --yes skills add antvis/AVA --skill ava --yes
</code></pre>
<p>Then check the install:</p>
<pre><code class="language-bash">ava --help
ava source --help
npx --yes skills list
</code></pre>
<p><code>ava --help</code> should list <code>source</code>, <code>schema</code>, <code>query</code>, and <code>viz</code>. Start a new agent session after installation if your agent needs that to discover the Skill.</p>
<p>You can also skip the global install and call a project-local binary with <code>npx ava</code>, as the <a href="https://ava.antv.vision/documentation/reference/cli/">CLI reference</a> describes.</p>
<h2>Get the sample data</h2>
<p>Download the official file and save it as <code>sales.csv</code> in your working directory:</p>
<p><a href="https://ava.antv.vision/examples/agent-skill/sales.csv">https://ava.antv.vision/examples/agent-skill/sales.csv</a></p>
<p>It contains eight synthetic rows of monthly revenue, in USD, for four products:</p>
<pre><code class="language-csv">month,product,revenue
2025-01,Analytics,12000
2025-02,Analytics,18000
2025-01,Automation,8000
2025-02,Automation,10000
2025-01,Reporting,6000
2025-02,Reporting,5000
2025-01,Support,4000
2025-02,Support,4500
</code></pre>
<p>A small file is easier to check by hand. You can add the January column and the February column on paper before you trust any tool.</p>
<h2>Path A: ask your agent</h2>
<p>After installation, start a new agent session and paste a prompt like the official demo (use the real path if you saved the file elsewhere):</p>
<pre><code class="language-text">Use the AVA skill to analyze ./sales.csv.

Compare total revenue in January and February 2025, in USD.
Calculate the absolute and percentage change. Break down the change by product,
identify the largest contributor, and check that the product changes add up
to the overall change. Do not infer causes that are not in the data.

Save a horizontal bar chart of each product's revenue change as revenue-change.html
in a new output folder. Include a short explanation, the results table,
and the query used so I can reproduce the analysis.
</code></pre>
<p>Ask the agent to show you the query and the result table, not only a summary. Wording and chart layout may differ from run to run; the calculations for this sample should match the table in the next section.</p>
<h2>Path B: run the CLI yourself</h2>
<p>This is the same core path the Skill uses, and you can audit every step. Commands follow the <a href="https://ava.antv.vision/documentation/reference/cli/">CLI reference</a>. Redirecting <code>source</code> is important: in a terminal it prints a guide, and it prints JSON when piped or redirected.</p>
<pre><code class="language-bash">ava source sales.csv &gt; session.json
DATASET_ID=$(node -p 'JSON.parse(require("fs").readFileSync("session.json", "utf8")).datasetId')
ava schema "$DATASET_ID" &gt; schema.json
</code></pre>
<p>Read <code>schema.json</code> before you write SQL. For this CSV, AVA's DuckDB loader exposes a table named <code>data</code>, and the schema language is <code>duckdb-sql</code>. That table name is documented in the Agent Skill guide; always take it from <code>ava schema</code> for your own files.</p>
<p>Save this as <code>query-totals.sql</code>:</p>
<pre><code class="language-sql">SELECT
  SUM(CASE WHEN month = '2025-01' THEN revenue ELSE 0 END) AS january_usd,
  SUM(CASE WHEN month = '2025-02' THEN revenue ELSE 0 END) AS february_usd,
  SUM(CASE WHEN month = '2025-02' THEN revenue ELSE 0 END)
    - SUM(CASE WHEN month = '2025-01' THEN revenue ELSE 0 END) AS change_usd
FROM data;
</code></pre>
<p>And this as <code>query-by-product.sql</code>:</p>
<pre><code class="language-sql">SELECT
  product,
  SUM(CASE WHEN month = '2025-01' THEN revenue ELSE 0 END) AS january_usd,
  SUM(CASE WHEN month = '2025-02' THEN revenue ELSE 0 END) AS february_usd,
  SUM(CASE WHEN month = '2025-02' THEN revenue ELSE 0 END)
    - SUM(CASE WHEN month = '2025-01' THEN revenue ELSE 0 END) AS change_usd
FROM data
GROUP BY product
ORDER BY change_usd DESC;
</code></pre>
<p>Run them:</p>
<pre><code class="language-bash">ava query "$DATASET_ID" --dsl @query-totals.sql
ava query "$DATASET_ID" --dsl @query-by-product.sql
</code></pre>
<p><code>query</code> executes the DSL as written. It does not call a model, and session-level semantic definitions do not rewrite the SQL.</p>
<p>You should see these results:</p>
<table>
<thead>
<tr>
<th>Product</th>
<th align="right">January (USD)</th>
<th align="right">February (USD)</th>
<th align="right">Change (USD)</th>
</tr>
</thead>
<tbody><tr>
<td>Analytics</td>
<td align="right">12,000</td>
<td align="right">18,000</td>
<td align="right">+6,000</td>
</tr>
<tr>
<td>Automation</td>
<td align="right">8,000</td>
<td align="right">10,000</td>
<td align="right">+2,000</td>
</tr>
<tr>
<td>Support</td>
<td align="right">4,000</td>
<td align="right">4,500</td>
<td align="right">+500</td>
</tr>
<tr>
<td>Reporting</td>
<td align="right">6,000</td>
<td align="right">5,000</td>
<td align="right">−1,000</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td align="right"><strong>30,000</strong></td>
<td align="right"><strong>37,500</strong></td>
<td align="right"><strong>+7,500</strong></td>
</tr>
</tbody></table>
<p>The net increase is $7,500, or 25%. The four product changes add up to $7,500, so the breakdown reconciles. Analytics accounts for $6,000, which is 80% of the net increase. Reporting fell by $1,000 and partly offset growth elsewhere.</p>
<p>These figures show <em>where</em> the change occurred. The sample has no promotions, prices, or customer counts, so it cannot explain <em>why</em>.</p>
<h2>Render a chart from the numbers you already checked</h2>
<p><code>recommend</code> and <code>visualize</code> need a model. <code>viz</code> does not: it validates a specification you provide and can write HTML. The documented GPT-Vis config shape is a <code>type</code> plus <code>data</code> rows. Save this as <code>chart-spec.json</code>, using the product changes from the query:</p>
<pre><code class="language-json">{
  "chartType": "bar",
  "config": {
    "type": "bar",
    "data": [
      { "category": "Analytics", "value": 6000 },
      { "category": "Automation", "value": 2000 },
      { "category": "Support", "value": 500 },
      { "category": "Reporting", "value": -1000 }
    ]
  }
}
</code></pre>
<p><code>bar</code> and this <code>{ category, value }</code> layout follow AVA's published chart types and the column-chart example in the <a href="https://ava.antv.vision/documentation/visualization/overview/">visualization guide</a>.</p>
<pre><code class="language-bash">ava viz --spec @chart-spec.json --output revenue-change.html
</code></pre>
<p><code>--output</code> writes a new file and will not overwrite an existing path. The HTML loads the pinned GPT-Vis 1.3.1 runtime from a CDN, so you need network access to view the chart. If the page is blank, check that access and compare the bars with the table above.</p>
<p>When you are finished, release the session:</p>
<pre><code class="language-bash">ava dispose "$DATASET_ID"
</code></pre>
<p>Sessions expire after 30 idle minutes. If that happens, load the source again, use the new dataset ID, and re-run schema and queries.</p>
<h2>A compact installation prompt</h2>
<p>If you want the agent to install and smoke-test the Skill for you, the official guide provides a prompt that includes this requirement: use your own reasoning for analysis, and do not ask for an additional AVA model API key. The full prompt is in the <a href="https://ava.antv.vision/documentation/agent-skill/">Agent Skill guide</a>.</p>
<h2>When you should configure a model</h2>
<p>Use model configuration when you want AVA itself to suggest questions, translate natural language into DSL, run <code>analyze</code>, or recommend a chart from a question and a set of rows. Set <code>OPENAI_API_KEY</code> and, if needed, <code>OPENAI_MODEL</code> or <code>OPENAI_BASE_URL</code> before <code>ava source</code> for those session-scoped commands. Standalone <code>recommend</code> and <code>visualize</code> read the key at command time. Defaults are documented in the CLI reference (<code>OPENAI_MODEL</code> defaults to <code>gpt-4o-mini</code>).</p>
<h2>What to read next</h2>
<ul>
<li><a href="https://ava.antv.vision/documentation/agent-skill/">Agent Skill guide</a> — installation prompt and the official revenue demo</li>
<li><a href="https://ava.antv.vision/documentation/reference/cli/">CLI reference</a> — flags, engines, and session lifecycle</li>
<li><a href="https://ava.antv.vision/documentation/quickstart/">SDK quickstart</a> — the same ideas in TypeScript</li>
<li><a href="https://ava.antv.vision/blog/ava-4-release/">AVA 4.0 release notes</a> — why the framework is built around verifiable context</li>
<li><a href="https://dev.to/yvonneyx/build-a-data-analysis-agent-with-ava-40-duckdb-and-typescript-4pfe">Build a Data Analysis Agent with AVA 4.0, DuckDB, and TypeScript</a> — a custom agent loop on the JavaScript API</li>
</ul>
<p>AVA is MIT licensed. Issues and ideas are welcome at <a href="https://github.com/antvis/AVA">github.com/antvis/AVA</a>.</p>
<h2>Disclosure</h2>
<p>This article was drafted with AI assistance and reviewed against AVA's official documentation. The CLI examples were executed locally with <code>@antv/ava@4.0.5</code>. The sample CSV and the expected totals come from the official Agent Skill guide.</p>
]]></content:encoded></item></channel></rss>