Skip to content
Browse documentation
More resources

Architecture & source map

Understand how the public API connects to the implementation.

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, model context, events, and engine lifecycle.

Source directory map

SourceResponsibility
ava.tsPublic API, source state, and lifecycle
types.tsConfiguration, engine, and result contracts
engines.tsInternal engine registry
analysis/Direct, loop, and subset 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 syntax, 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 methodResponsibility / 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, analysis/loop.ts, or analysis/subset.ts
translate() / query()Engine getDSL() / execute()
suggest()suggest/index.ts
recommend()visualization/advisor.ts and syntax generation
viz()HTML wrapping in visualization/generator.ts
visualize()Compose recommend() and viz()

Context and state

An AVA instance holds one source configuration's active engine, schema, and latest profile. A source may contain multiple tables. Loading a new source clears existing context; profiling enriches later model calls.

Analysis strategies share a runtime containing the engine, model configuration, schema/profile context, 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.