{"_id":"@antv/ava@4.0.0","bin":{"ava":"lib/cli/index.js"},"bugs":{"url":"https://github.com/antvis/AVA/issues"},"dist":{"shasum":"759225fbdbd17bdca3247af4c0e2116d62f5394e","tarball":"http://registry-npm.ywwl.com/@antv/ava/download/@antv/ava-4.0.0.tgz","fileCount":220,"integrity":"sha512-NWmu7VrkO9rqYCgsayodKn602atNLVvHEoQrQUtiaoLr2JCsvnqHoPE89aXpWaehpC3my5Hd2Me2R/uJ2IBBrA==","signatures":[{"sig":"MEUCIGsOJK2KZjxZ1wPVuq83NltCSaW21oDj9qmcyyVXmWsSAiEAnNDxuC8p5i60ZdfRolVbmFb6D68Zji/HO035a0ycwgY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB9ykhKk4opZpagws60tZFWlFsiNg1pRATjAQAtCMFtnAiAJjY4gbx1SCxa5O01uDHiCnMY77p8DjAkDGJdmOL3xtg=="}],"unpackedSize":700872,"size":188381,"noattachment":false,"key":"/@antv/ava/-/@antv/ava-4.0.0.tgz"},"main":"lib/index.js","name":"@antv/ava","types":"lib/index.d.ts","author":{"url":"https://antv.antgroup.com/","name":"AntV"},"module":"esm/index.mjs","engines":{"node":">=22.13.0"},"exports":{".":{"import":"./esm/index.mjs","browser":{"import":"./esm/index.browser.mjs","require":"./lib/index.browser.js"},"require":"./lib/index.js"},"./browser":{"import":"./esm/index.browser.mjs","require":"./lib/index.browser.js"},"./package.json":"./package.json"},"gitHead":"84ff2fe552d65e230c7b3a84b568726ca037eedc","license":"MIT","scripts":{"lint":"eslint --ext .ts,.tsx src __tests__","test":"vitest run","build":"npm run clean && npm run build:cjs && npm run build:esm","clean":"rimraf lib esm","format":"prettier --write \"src/**/*.{ts,tsx}\" && npm run lint-fix","test:ui":"vitest --ui","lint-fix":"eslint --ext .ts,.tsx src __tests__ --fix","build:cjs":"tsc --module commonjs --outDir lib","build:esm":"vite build","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"version":"4.0.0","_npmUser":{"name":"banxuan","email":"zhuyuxin0627@gmail.com"},"homepage":"https://ava.antv.vision/","keywords":["visualization","ai-native","visual-analytics","llm"],"repository":{"url":"git+https://github.com/antvis/AVA.git","type":"git"},"_npmVersion":"10.8.2","description":"A framework for AI-native Visual Analytics","directories":{"lib":"lib"},"maintainers":[{"name":"lvisei","email":"yunji.me@outlook.com"},{"name":"iaaron","email":"943720372@qq.com"},{"name":"jinke.li","email":"jinke.li666@gmail.com"},{"name":"lzxue","email":"120635640@qq.com"},{"name":"army8735","email":"army8735@qq.com"},{"name":"dengfuping","email":"dengfuping_private@163.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"chenluli","email":"chenluuli@gmail.com"},{"name":"kn9117","email":"1175863618@qq.com"},{"name":"bbsqq","email":"1491812683@qq.com"},{"name":"banxuan","email":"zhuyuxin0627@gmail.com"},{"name":"yanxiong","email":"ojh496845051@gmail.com"},{"name":"atool","email":"wzwahl36@qq.com"},{"name":"pearl_wang","email":"610999886@qq.com"},{"name":"interstellarmt","email":"787982239@qq.com"},{"name":"alex_zjt","email":"alex_zjt@163.com"},{"name":"duxinyue023","email":"duxinyue.dxy@antgroup.com"},{"name":"wang1212","email":"mrwang1212@126.com"},{"name":"gaofuhong","email":"gaofh1023@163.com"}],"sideEffects":["./esm/index.mjs","./lib/index.js","./esm/index.browser.mjs","./lib/index.browser.js"],"_nodeVersion":"20.19.5","dependencies":{"ai":"^7.0.112","zod":"^4.6.7","ssh2":"^1.17.0","saxes":"^6.0.0","tslib":"^2.3.1","adm-zip":"^0.6.1","csv-parse":"^7.0.3","jsonrepair":"^3.15.0","@ai-sdk/openai":"^4.0.73","@duckdb/node-api":"^1.5.5-r.5","@clickhouse/client":"^1.23.1","@antv/event-emitter":"^0.1.3","@supabase/pg-parser":"^0.1.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.6","yaml":"^2.9.1","eslint":"^7.32.0","rimraf":"^3.0.2","vitest":"4.1.11","prettier":"^2.4.1","@vitest/ui":"4.1.11","typescript":"^5.9.3","@types/node":"^22.20.4","@types/ssh2":"^1.15.5","@types/adm-zip":"^0.5.8","@vitest/coverage-v8":"^4.1.11","eslint-plugin-import":"^2.24.1","eslint-config-prettier":"^8.3.0","@typescript-eslint/parser":"^4.29.2","@typescript-eslint/eslint-plugin":"^4.29.2","eslint-import-resolver-typescript":"^2.4.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ava_4.0.0_1793764492116_0.09115473914938799"},"readme":"<div align=\"center\">\n  <h1>AVA, AI-native Visual Analytics</h1>\n  <img width=\"200\" height=\"120\" src=\"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*yOHIQ48aRwgAAAAAAAAAAAAADmJ7AQ/original\" alt=\"AVA logo\">\n</div>\n\n<p align=\"center\">\n  <a href=\"https://ava.antv.vision\">\n    <img src=\"https://img.shields.io/badge/Website-2F54EB?style=for-the-badge\" alt=\"Website\" />\n  </a>\n  <a href=\"https://ava.antv.vision/documentation/\">\n    <img src=\"https://img.shields.io/badge/Docs-722ED1?style=for-the-badge\" alt=\"Documentation\" />\n  </a>\n  <a href=\"https://ava.antv.vision/ai/\">\n    <img src=\"https://img.shields.io/badge/AI%20Agent-EB2F96?style=for-the-badge\" alt=\"AI Agent\" />\n  </a>\n  <a href=\"https://sive.antv.antgroup.com/\" title=\"A data analysis app built with AVA\">\n    <img src=\"https://img.shields.io/badge/Try%20Sive-13A8A8?style=for-the-badge\" alt=\"Try Sive\" />\n  </a>\n  <a href=\"https://github.com/antvis/ava\">\n    <img src=\"https://img.shields.io/badge/GitHub-000000?style=for-the-badge&logo=github&logoColor=white\" alt=\"GitHub\" />\n  </a>\n  <a href=\"https://ava.antv.vision/llms.txt\">\n    <img src=\"https://img.shields.io/badge/LLMS-FA8C16?style=for-the-badge\" alt=\"llms\" />\n  </a>\n</p>\n\n[AVA](https://github.com/antvis/AVA) (<img src=\"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*QzIsSrfsCW0AAAAAAAAAAAAADmJ7AQ/original\" width=\"16\" alt=\"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.\n\n> [!NOTE]\n> **Think of AVA as PandasAI for JavaScript. 💬📊🤖**\n>\n> It brings natural-language data analysis and visualization to your apps and AI agents.\n\n## ✨ Why AVA?\n\n<table width=\"100%\">\n  <tr>\n    <td width=\"33%\" valign=\"top\">\n      <h3>🔌 Unified data access</h3>\n      <p>Connect <strong>files and databases</strong> through one interface.</p>\n      <a href=\"https://ava.antv.vision/documentation/data/sources/\">Data sources →</a>\n    </td>\n    <td width=\"33%\" valign=\"top\">\n      <h3>🔎 Grounded answers</h3>\n      <p>Inspect the <strong>queries and results</strong> behind each answer.</p>\n      <a href=\"https://ava.antv.vision/documentation/analysis/overview/\">Trusted analysis →</a>\n    </td>\n    <td width=\"33%\" valign=\"top\">\n      <h3>📊 Smart visualization</h3>\n      <p>Get charts guided by <strong>your question and data</strong>.</p>\n      <a href=\"https://ava.antv.vision/documentation/visualization/overview/\">Visualization →</a>\n    </td>\n  </tr>\n  <tr>\n    <td width=\"33%\" valign=\"top\">\n      <h3>💻 Local execution</h3>\n      <p>Choose <strong>where analysis runs</strong> and which model endpoint it uses.</p>\n      <a href=\"https://ava.antv.vision/documentation/engines/overview/\">Execution engines →</a>\n    </td>\n    <td width=\"33%\" valign=\"top\">\n      <h3>🎯 Published benchmarks</h3>\n      <p>Check accuracy against <strong>reference answers</strong> under published test conditions.</p>\n      <a href=\"https://ava.antv.vision/documentation/reference/benchmarks/\">Benchmarks →</a>\n    </td>\n    <td width=\"33%\" valign=\"top\">\n      <h3>🤖 Agent integration</h3>\n      <p>Your agent reasons; <strong>AVA executes</strong> the data workflow.</p>\n      <a href=\"https://ava.antv.vision/documentation/agent-skill/\">Agent integration →</a>\n    </td>\n  </tr>\n</table>\n\n## 🚀 Getting started\n\nInstall AVA 4.0 with Node.js 22.13+:\n\n```bash\nnpm install @antv/ava@4\n```\n\n## 💻 Usage\n\nDownload [sales.csv](__tests__/datasets/sales.csv) and configure your model:\n\n```typescript\nimport { AVA } from '@antv/ava';\n\nconst ava = new AVA({\n  llm: {\n    model: '<your-model>',\n    apiKey: '<your-api-key>',\n    // baseURL: '<your-provider-api-url>',\n  },\n});\n```\n\n### 1. Load\n\n```typescript\nawait ava.source({ type: 'csv-file', options: { path: './sales.csv' } });\n```\n\n> [!NOTE]\n> **Data preview**\n>\n> First 3 of 240 rows, selected columns:\n>\n> | order_date | product | sales |\n> | --- | --- | ---: |\n> | 2025-01-01 | Monitor | 224.10 |\n> | 2025-01-02 | Office Chair | 680.20 |\n> | 2025-01-04 | Monitor | 2,191.20 |\n\n### 2. Explore\n\nInspect the structure and data quality, then add [business definitions](https://ava.antv.vision/documentation/data/semantic/):\n\n```typescript\nconst schema = await ava.schema();\nconst profile = await ava.profile({ metrics: ['row_count', 'null_count'] });\nawait ava.semantic(undefined, () => ({\n  description: 'Use the sales column for amounts after discounts and order_date for monthly comparisons.',\n}));\n```\n\n> [!NOTE]\n> **Analysis context**\n>\n> | Context | Details |\n> | --- | --- |\n> | Structure | `data`: 12 columns |\n> | Quality | 240 rows; 1 missing `region` and 1 missing `quantity` |\n> | Semantics | `sales` is after discounts; monthly comparisons use `order_date` |\n\n### 3. Suggest\n\n```typescript\nconst suggestions = await ava.suggest(3);\n```\n\n> [!NOTE]\n> **Suggested questions** (examples)\n>\n> - How did sales change from January to February 2025?\n> - Which products contributed most to the sales decline?\n> - How do sales and profit vary by region?\n\n### 4. Analyze\n\n```typescript\nconst result = await ava.analyze(\n  'Compare January and February 2025 sales by product. Show both months and the change, ordered by the largest decline.'\n);\n```\n\n> [!NOTE]\n> **Analysis result**\n>\n> Total sales fell **43.94%**, led by a **16,092.10** decline in laptop sales.\n>\n> First 3 of 9 products:\n>\n> | Product | January sales | February sales | Change |\n> | --- | ---: | ---: | ---: |\n> | Laptop | 19,688.10 | 3,596.00 | −16,092.10 |\n> | Standing Desk | 9,655.80 | 5,546.10 | −4,109.70 |\n> | Monitor | 6,536.25 | 4,731.00 | −1,805.25 |\n\n### 5. Visualize\n\n```typescript\nconst chart = await ava.visualize({\n  query: 'Plot the sales change by product from January to February 2025 as a bar chart.',\n  data: result.data,\n});\n```\n\n> [!NOTE]\n> **Chart preview**\n>\n> <img src=\".github/assets/sales-change.png\" width=\"800\" alt=\"Sales change by product from January to February 2025, with decreases in red and increases in green.\">\n>\n> *Powered by [GPT-Vis](https://gpt-vis.antv.vision/).*\n\n## 🔌 Connect your data\n\n<table width=\"100%\">\n  <tr>\n    <td align=\"center\" width=\"14%\"><a href=\"https://ava.antv.vision/documentation/data/sources/#csv\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*SEIZRJCeCuYAAAAAQBAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"CSV\" /><br />CSV</a></td>\n    <td align=\"center\" width=\"14%\"><a href=\"https://ava.antv.vision/documentation/data/sources/#json\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*VBNjQJDMvMIAAAAAHYAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"JSON\" /><br />JSON</a></td>\n    <td align=\"center\" width=\"14%\"><a href=\"https://ava.antv.vision/documentation/data/sources/#parquet\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*-_h8RrPPA54AAAAAFkAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"Parquet\" /><br />Parquet</a></td>\n    <td align=\"center\" width=\"14%\"><a href=\"https://ava.antv.vision/documentation/data/sources/#excel\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*GfCXT7Mb_5gAAAAAQCAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"Excel\" /><br />Excel</a></td>\n    <td align=\"center\" width=\"14%\"><a href=\"https://ava.antv.vision/documentation/data/sources/#text\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*XrY8SK_9fGwAAAAAEsAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"Text\" /><br />Text</a></td>\n    <td align=\"center\" width=\"14%\"><a href=\"https://ava.antv.vision/documentation/data/sources/#feishu-bitable\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*Rly3Rou8Wv8AAAAAQFAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"Feishu Bitable\" /><br />Feishu Bitable</a></td>\n    <td align=\"center\" width=\"14%\"><a href=\"https://ava.antv.vision/documentation/data/sources/#csv-files\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*wH-PT4nF70wAAAAAMkAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"Tencent Docs\" /><br />Tencent Docs</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"https://ava.antv.vision/documentation/data/sources/#sqlite\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*3xulRYi0wWkAAAAAQBAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"SQLite\" /><br />SQLite</a></td>\n    <td align=\"center\"><a href=\"https://ava.antv.vision/documentation/data/sources/#mysql\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*8TDeSpgXAi0AAAAAQEAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"MySQL\" /><br />MySQL</a></td>\n    <td align=\"center\"><a href=\"https://ava.antv.vision/documentation/data/sources/#postgresql\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*h6xsS5N0EbcAAAAAQFAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"PostgreSQL\" /><br />PostgreSQL</a></td>\n    <td align=\"center\"><a href=\"https://ava.antv.vision/documentation/engines/custom/\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*XVBPSaYT6p0AAAAAQJAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"SQL Server\" /><br />SQL Server</a></td>\n    <td align=\"center\"><a href=\"https://ava.antv.vision/documentation/data/sources/#mongodb\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*5VYbTakXL7EAAAAAIlAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"MongoDB\" /><br />MongoDB</a></td>\n    <td align=\"center\"><a href=\"https://ava.antv.vision/documentation/data/sources/#supabase\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*IWbeTqNDuu4AAAAAFFAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"Supabase\" /><br />Supabase</a></td>\n    <td align=\"center\"><a href=\"https://ava.antv.vision/documentation/data/sources/#clickhouse\"><img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*o0VuQ5NvHZ8AAAAAELAAAAgAegfkAQ/original\" width=\"32\" height=\"32\" alt=\"ClickHouse\" /><br />ClickHouse</a></td>\n  </tr>\n</table>\n\n> [!TIP]\n> **Missing a data source? 💡🛠️**\n>\n> **[💬 Open an issue](https://github.com/antvis/AVA/issues/new/choose)** · **[🛠️ Submit a pull request](https://github.com/antvis/AVA/compare)**\n\n## 🎯 Benchmarks\n\nWe evaluate AVA on established benchmarks to measure the accuracy and efficiency of its data analysis.\n\n<img src=\"https://mdn.alipayobjects.com/huamei_aphk1k/afts/img/A*XjhtSbWcb70AAAAAUlAAAAgAegfkAQ/original\" width=\"100%\" alt=\"DataBench and Spider2-Lite evaluation results comparing raw data, schema and profile, and semantic context.\">\n\n[Evaluation setup and reports →](https://ava.antv.vision/documentation/reference/benchmarks/)\n\n## 🧩 More ways to use AVA\n\nThe agent and CLI workflows run on Node.js 22.13+ on macOS or Linux.\n\n### Use with an Agent\n\nAsk your AI agent:\n\n```text\nInstall the AVA skill with `npx skills add antvis/AVA`, then follow its setup instructions.\n```\n\n[Agent setup guide →](https://ava.antv.vision/documentation/agent-skill/)\n\n### Use from the CLI\n\nLoad and analyze data from your terminal:\n\n```bash\nava source ./sales.csv\nava analyze '<dataset-id>' 'Compare January and February 2025 sales by product.'\n```\n\nSee the [CLI guide](https://ava.antv.vision/documentation/reference/cli/) for setup and commands.\n\n## 📚 Resources\n\n- [Documentation](https://ava.antv.vision/documentation/) — Guides and examples\n- [Analysis strategies](https://ava.antv.vision/documentation/analysis/strategies/) — Direct and loop execution\n- [API Reference](https://ava.antv.vision/documentation/reference/api/) — Methods and configuration\n- [AI](https://ava.antv.vision/ai/) — Try out AVA in the browser environment\n- [Benchmarks](https://ava.antv.vision/documentation/reference/benchmarks/) — Evaluation results\n- [Issues](https://github.com/antvis/AVA/issues) — Bug reports and feature requests\n\n## 🤝🛠️ Contributing\n\nContributions are welcome. Include tests, examples, and documentation with new features.\n\nRun `npm test` to test your changes. For model-backed tests, copy `.env.example` to `.env` and add your model settings.\n\n## 📑 Papers\n\n[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.\n\n[《数据可视化设计的类型学实践》（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.\n\n## ⚖️ License\n\nMIT\n","publish_time":1793764492221,"_cnpm_publish_time":1793764492221,"dist-tags":{"alpha":"4.0.0-alpha.6","beta":"4.0.0-beta.5","latest":"4.0.0"}}