Skip to content
Browse documentation
Get started

Installation & Quickstart

Install AVA and go from your first dataset to a visual answer.

Using AVA through an AI agent? Start with the Agent Skill guide. This quickstart covers the TypeScript / JavaScript SDK.

Install

Use Node.js 22.13.0 or later , as required by the package. Install AVA 4.0.0 with your preferred package manager:

bash
npm install @antv/ava@4
# or
pnpm add @antv/ava@4
# or
yarn add @antv/ava@4

Configure your model

The example below reads OPENAI_API_KEY and optional OPENAI_MODEL / OPENAI_BASE_URL from your process environment. Set these before running it. AVA also accepts a preconfigured AI SDK model; see model configuration.

Run your first analysis

This complete Node.js example uses the default DuckDB engine. Save it as an ES module in a project with @antv/ava installed.

javascript
import { AVA } from '@antv/ava';
 
const ava = new AVA({
  llm: {
    model: process.env.OPENAI_MODEL || 'gpt-4o-mini',
    apiKey: process.env.OPENAI_API_KEY,
    baseURL: process.env.OPENAI_BASE_URL,
  },
});
 
try {
  await ava.source({
    type: 'json',
    options: {
      data: [
        { region: 'East', revenue: 120 },
        { region: 'West', revenue: 90 },
        { region: 'East', revenue: 80 },
      ],
    },
  });
 
  const schema = await ava.schema();
  const profile = await ava.profile();
  console.log(schema.models, profile.models[0].metrics);
 
  const result = await ava.analyze('Show total revenue by region');
  console.log(result.text, result.data);
 
  const chart = await ava.visualize(result);
  if (chart) console.log(chart.config);
} finally {
  await ava.dispose();
}

Cleanup and errors

source() replaces the current dataset and releases the previous engine. dispose() releases connections and engine resources and clears the schema and cached profile. Always await cleanup, including after a failed analysis.

Next steps

See the API Reference for every method and its input parameters.