Skip to content

antvis/AVA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

964 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AVA, AI-native Visual Analytics

AVA logo

AVA (AVA examples Visual Analytics) is a technology framework designed for more convenient visual analytics. The first A has multiple meanings: AI native, Automated, Augmented, and VA stands for Visual Analytics. It can assist users in unstructured data loading, data processing and analysis, as well as visualization code generation.

GitHub Website Documentation AI Agent llms

πŸš€ Features

AVA is a fundamental shift from rule-based analytics to AI-native capabilities:

  • Natural Language Queries: Ask questions about your data in plain English
  • LLM-Powered Analysis: Leverages large language models for intelligent data analysis
  • Smart Data Handling: Automatically chooses between in-memory processing and SQLite based on data size
  • Modular Architecture: Clean separation of concerns with data, analysis, and visualization modules
  • Browser & Node.js Compatible: Runs seamlessly in both browser and server environments

πŸ“– Quick Start

  • Install AVA by npm
npm install @antv/ava

pnpm install @antv/ava

yarn add @antv/ava
  • Then run the code below
import { AVA } from '@antv/ava';

// Initialize with LLM config
const ava = new AVA({
  llm: {
    model: 'ling-1t',
    apiKey: 'YOUR_API_KEY',
    baseURL: 'LLM_BASE_URL',
  },
  sqlThreshold: 1024 * 1024 * 2, // Threshold for switching to SQLite
});

// Load data from various sources in Node.js
await ava.loadCSV('data/companies.csv');

// Load CSV from file input in browser
const fileInput = document.querySelector('input[type="file"]');
const file = fileInput.files[0];
const csvContent = await file.text();
await ava.loadCSV(csvContent);

// or load from JSON object
await ava.loadObject([{ city: '杭州', gdp: 18753 }, { city: '上桷', gdp: 43214 }]);

// or load from URL
await ava.loadURL('https://api.example.com/data', (response) => response.data);

// or extract from text
await ava.loadText('杭州 100,上桷 200οΌŒεŒ—δΊ¬ 300');

// Ask questions in natural language
const result = await ava.analysis('What is the average revenue by region?');
console.log(result);

// Clean up
ava.dispose();

πŸ—οΈ Architecture

AVA uses a modular pipeline architecture that processes user queries through distinct stages. Data is loaded from multiple sources (CSV, JSON, URL, or text), analyzed intelligently based on size (JavaScript for small datasets, SQLite for large ones), results are summarized using LLM into natural language responses, and optionally visualized with chart recommendations.

User Query
    ↓
AVA Instance
    ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Data Module    β”‚ β†’ Load from multiple sources:
β”‚                 β”‚   β€’ CSV File (loadCSV)
β”‚                 β”‚   β€’ JSON Object (loadObject)
β”‚                 β”‚   β€’ URL (loadURL)
β”‚                 β”‚   β€’ Text (loadText + LLM)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Metadata Extract β”‚ β†’ Type inference, statistics
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Size Check  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    ↓         ↓
 <10KB      β‰₯10KB
    ↓         ↓
JavaScript  SQLite
 Helpers    Storage
    ↓         ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Analysis Module  β”‚ β†’ Generate & Execute Code/SQL
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ LLM Summary  β”‚ β†’ Natural Language Response
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Visualization       β”‚ β†’ Optional chart generation:
β”‚ Module (Optional)   β”‚   β€’ Detect visualization intent
β”‚                     β”‚   β€’ Recommend chart type
β”‚                     β”‚   β€’ Generate chart syntax & HTML
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    ↓
User Response
(Text + Data + Chart)

🌐 Browser & Server Compatibility

AVA v4 is designed to run seamlessly in both browser and Node.js environments:

βœ… Browser Support

  • All core features work in modern browsers (Chrome, Firefox, Safari, Edge)
  • CSV loading via File API or direct content strings
  • JSON object and URL loading fully supported
  • In-memory data processing for datasets under 10KB
  • Note: SQLite is not available in browsers; keep datasets under 10KB or use the server-side version for large datasets

βœ… Node.js Support

  • Full feature set including large dataset handling with SQLite
  • File system access for CSV loading
  • Automatic switching between in-memory and SQLite based on data size (10KB threshold)

Environment Detection

AVA automatically detects the runtime environment and adapts:

  • Browser: Uses in-memory processing, accepts CSV content strings
  • Node.js: Supports file paths for CSV, uses SQLite for large datasets (>10KB)

🀝 Developer Contributions

This is an experimental branch. Contributions are welcome! Please ensure:

  • Code is clean and well-documented
  • TypeScript types are properly defined
  • New features include examples, and tests
  • READMEs are updated as needed

πŸ”— Related Projects

πŸ“„ License

MIT