**English** | [็ฎ€ไฝ“ไธญๆ–‡](./README.zh-CN.md)

AVA, AI-native Visual Analytics

AVA logo

Website Documentation AI Agent Try Sive GitHub llms

[AVA](https://github.com/antvis/AVA) (AVA examples Visual Analytics) is a technology framework designed for more convenient visual analytics. **A** stands for AI-native, Automated, and Augmented; **VA** stands for Visual Analytics.

AVA agent workflow: data access, schema inspection, profiling, metric definitions, analysis, visualization, and follow-up questions, with verifiable SQL and results.

> [!NOTE] > **Think of AVA as PandasAI for JavaScript. ๐Ÿ’ฌ๐Ÿ“Š๐Ÿค–** > > It brings natural-language data analysis and visualization to your apps and AI agents. ## โœจ Why AVA?

๐Ÿ”Œ Analysis across data sources

Join data from files and databases in a single query.

Connect multiple sources โ†’

๐Ÿ”Ž Grounded answers

Inspect the queries and results behind each answer.

Trusted analysis โ†’

๐Ÿ“Š Smart visualization

Get charts guided by your question and data.

Visualization โ†’

๐Ÿ’ป Local execution

Choose where analysis runs and which model endpoint it uses.

Execution engines โ†’

๐ŸŽฏ Published benchmarks

Check accuracy against reference answers under published test conditions.

Benchmarks โ†’

๐Ÿค– Agent integration

Your agent reasons; AVA executes the data workflow.

Agent integration โ†’
## ๐Ÿš€ Getting started Install AVA with Node.js 22.13+: ```bash npm install @antv/ava ``` ## ๐Ÿ’ป Usage Download [sales.csv](__tests__/datasets/sales.csv) and configure your model: ```typescript import { AVA } from '@antv/ava'; const ava = new AVA({ llm: { model: '', apiKey: '', // baseURL: '', }, }); ``` ### 1. Load ```typescript await ava.source({ type: 'csv-file', options: { path: './sales.csv' } }); ``` > [!NOTE] > **Data preview** > > First 3 of 240 rows, selected columns: > > | order_date | product | sales | > | --- | --- | ---: | > | 2025-01-01 | Monitor | 224.10 | > | 2025-01-02 | Office Chair | 680.20 | > | 2025-01-04 | Monitor | 2,191.20 | ### 2. Explore Inspect the structure and data quality, then add [business definitions](https://ava.antv.vision/documentation/data/semantic/): ```typescript const schema = await ava.schema(); const profile = await ava.profile({ metrics: ['row_count', 'null_count'] }); await ava.semantic(undefined, () => ({ description: 'Use the sales column for amounts after discounts and order_date for monthly comparisons.', })); ``` > [!NOTE] > **Analysis context** > > | Context | Details | > | --- | --- | > | Structure | `data`: 12 columns | > | Quality | 240 rows; 1 missing `region` and 1 missing `quantity` | > | Semantics | `sales` is after discounts; monthly comparisons use `order_date` | ### 3. Suggest ```typescript const suggestions = await ava.suggest(3); ``` > [!NOTE] > **Suggested questions** (examples) > > - How did sales change from January to February 2025? > - Which products contributed most to the sales decline? > - How do sales and profit vary by region? ### 4. Analyze ```typescript const result = await ava.analyze( 'Compare January and February 2025 sales by product. Show both months and the change, ordered by the largest decline.' ); ``` > [!NOTE] > **Analysis result** > > Total sales fell **43.94%**, led by a **16,092.10** decline in laptop sales. > > First 3 of 9 products: > > | Product | January sales | February sales | Change | > | --- | ---: | ---: | ---: | > | Laptop | 19,688.10 | 3,596.00 | โˆ’16,092.10 | > | Standing Desk | 9,655.80 | 5,546.10 | โˆ’4,109.70 | > | Monitor | 6,536.25 | 4,731.00 | โˆ’1,805.25 | ### 5. Visualize ```typescript const chart = await ava.visualize({ query: 'Plot the sales change by product from January to February 2025 as a bar chart.', data: result.data, }); ``` > [!NOTE] > **Chart preview** > > Sales change by product from January to February 2025, with decreases in red and increases in green. > > *Powered by [GPT-Vis](https://gpt-vis.antv.vision/).* ## ๐Ÿ”Œ Connect your data
CSV
CSV
JSON
JSON
Parquet
Parquet
Excel
Excel
Text
Text
Feishu Bitable
Feishu Bitable
Tencent Docs
Tencent Docs
GitHub
GitHub
SQLite
SQLite
MySQL
MySQL
PostgreSQL
PostgreSQL
SQL Server
SQL Server
MongoDB
MongoDB
Supabase
Supabase
ClickHouse
ClickHouse
Snowflake
Snowflake
> [!TIP] > **Missing a data source? ๐Ÿ’ก๐Ÿ› ๏ธ** > > **[๐Ÿ’ฌ Open an issue](https://github.com/antvis/AVA/issues/new/choose)** ยท **[๐Ÿ› ๏ธ Submit a pull request](https://github.com/antvis/AVA/compare)** ## ๐ŸŽฏ Benchmarks We evaluate AVA on established benchmarks to measure the accuracy and efficiency of its data analysis. DataBench and Spider2-Lite evaluation results comparing raw data, schema and profile, and semantic context. [Evaluation setup and reports โ†’](https://ava.antv.vision/documentation/reference/benchmarks/) ## ๐Ÿงฉ More ways to use AVA ### Use with an Agent Ask your AI agent: ```text Install the AVA skill with `npx skills add antvis/AVA`, then follow its setup instructions. ``` [Agent setup guide โ†’](https://ava.antv.vision/documentation/agent-skill/) ### Use from the CLI Load and analyze data from your terminal: ```bash ava source ./sales.csv ava analyze '' 'Compare January and February 2025 sales by product.' ``` See the [CLI guide](https://ava.antv.vision/documentation/reference/cli/) for setup and commands. ## ๐Ÿ“š Resources - [Documentation](https://ava.antv.vision/documentation/) โ€” Guides and examples - [Analysis strategies](https://ava.antv.vision/documentation/analysis/strategies/) โ€” Direct and loop execution - [API Reference](https://ava.antv.vision/documentation/reference/api/) โ€” Methods and configuration - [AI](https://ava.antv.vision/ai/) โ€” Try out AVA in the browser environment - [Benchmarks](https://ava.antv.vision/documentation/reference/benchmarks/) โ€” Evaluation results - [Issues](https://github.com/antvis/AVA/issues) โ€” Bug reports and feature requests ## ๐Ÿค๐Ÿ› ๏ธ Contributing Contributions are welcome. Include tests, examples, and documentation with new features. Run `npm test` to test your changes. For model-backed tests, copy `.env.example` to `.env` and add your model settings. ## ๐Ÿ“‘ Papers [VizLinter](https://vegalite-linter.idvxlab.com/) - Chen, Q., Sun, F., Xu, X., Chen, Z., Wang, J. and Cao, N., 2021. VizLinter: A Linter and Fixer Framework for Data Visualization. *IEEE transactions on visualization and computer graphics*, 28(1), pp.206-216. [ใ€Šๆ•ฐๆฎๅฏ่ง†ๅŒ–่ฎพ่ฎก็š„็ฑปๅž‹ๅญฆๅฎž่ทตใ€‹๏ผˆExploring the Typology of Visualization Design๏ผ‰](https://oversea.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFD&dbname=CJFDAUTO&filename=MSDG202203021&uniplatform=OVERSEAS_EN&v=HcZsiecIxauSoKEB1s92_BImgnrMiazYsfZUpb-gcl0zXYx_MEwv5alz1UgtPjz1) - ่“ๆ˜Ÿๅฎ‡, ็Ž‹ๅ˜‰ๅ–†. ๆ•ฐๆฎๅฏ่ง†ๅŒ–่ฎพ่ฎก็š„็ฑปๅž‹ๅญฆๅฎž่ทต, ใ€Š็พŽๆœฏๅคง่ง‚ใ€‹, 2022(3), 149-152. ## โš–๏ธ License MIT