Public entry points
index.ts registers all Node.js engines and exports AVA plus public types. index.browser.ts registers only JavaScript. ava.ts coordinates source state, data model, events, and engine lifecycle.
Source directory map
| Source | Responsibility |
|---|---|
ava.ts | Public API, source state, and lifecycle |
types.ts | Configuration, engine, and result contracts |
engines.ts | Internal engine registry |
analysis/ | Direct and loop strategies |
duckdb/ | SQL engine, source loaders, and profiling |
interpreter/javascript/ | In-memory data and JavaScript execution |
interpreter/python/ | pandas execution and source validation |
remote/supabase/ | Management API, schema, and profiling |
remote/clickhouse/ | Remote SQL, schema, and profiling |
query/ | Query generation and dialect validation |
visualization/ | Chart advice, GPT-Vis config, and HTML generation |
suggest/ | Suggested analysis questions |
event/ | Event types and payloads |
cli/ | Commands and local dataset sessions |
util/ | Model resolution, schemas, metrics, and result limits |
Method to module
| Public method | Responsibility / implementation |
|---|---|
source() / schema() / dispose() | Source state and engine lifecycle in ava.ts |
profile() | Per-engine profiling; shared metric contracts in util/profile.ts |
analyze() | Dispatch to analysis/direct.ts or analysis/loop.ts |
translate() / query() | Engine getDSL() / execute() |
suggest() | suggest/index.ts |
recommend() | visualization/advisor.ts and config generation |
viz() | HTML wrapping in visualization/generator.ts |
visualize() | Compose recommend() and viz() |
Context and state
An AVA instance owns one active engine and its schema/profile cache. source() loads data; schema() discovers structure on first use. profile() computes and retains fresh observations; the data model is assembled from cached metadata when needed. Reloading or disposal clears both caches.
Engines retain data and connections. Their load() returns no metadata; schema() discovers it, profile(schema, options?) computes observations, and getDSL(query, dataModel) consumes AVA's data model. Shared validators live in util/schema.ts and util/profile.ts.
Analysis strategies share a runtime containing the engine, model configuration, data model, and event emitter. Query result limits are normalized through shared utilities.
Documentation organization
Each topic is a separate MDX file under site/content/docs/, grouped into data/, analysis/, visualization/, engines/, and reference/. This mirrors the public capabilities without exposing every internal helper as a separate user-facing page.