View Categories

How Nova AI Learns Your Database Schema Automatically

13 min read

SCHEMA INTELLIGENCE NOVA AI

How Nova AI Learns Your Database Schema Automatically

A 5-phase autonomous pipeline that reads, profiles, and maps your database structure before you ask a single question. Better SQL from day one.

5-Phase Pipeline 9 SQL Dialects Parallel Analysis Auto-Learning

Query Streams is a secure, real-time database integration platform whose AI engine, Nova, learns your database schema automatically before generating a single SQL query. Learn more at QueryStreams.com and sign up for free to start asking your database questions in plain English.

Why Schema Understanding Matters for AI SQL

AI-powered SQL generation has a fundamental problem that most platforms ignore: the AI doesn’t know your database. Generic chatbots can write syntactically correct SQL, but they have zero knowledge of your actual table names, column types, data values, or relationships. Ask them to query your sales data and they’ll invent plausible-sounding column names like total_sales or customer_name that may not exist in your schema. The query looks right. It compiles. It returns either an error or, worse, wrong results from a different column that happened to match.

This is the hallucination problem applied to database schema analysis. The gap isn’t in the AI’s ability to write SQL syntax. Modern language models are competent SQL writers. The gap is in knowing what to write SQL against: which tables exist, which columns they contain, how tables relate to each other, what values appear in filter columns, and which SQL dialect the target database expects. Without this grounding, even the most sophisticated AI query builder is guessing. Schema Intelligence is how Nova eliminates that guessing entirely, creating an AI SQL assistant that operates on verified knowledge rather than probabilistic inference.

The 5-Phase Schema Intelligence Pipeline

Nova’s automatic schema learning runs a structured 5-phase pipeline the moment you connect a data source. Each phase builds on the previous one, progressively deepening the AI’s understanding of your database structure. The pipeline processes up to 10 tables concurrently for speed, supports 9 SQL dialects, and stores all learned knowledge persistently so the analysis only needs to run once per database unless your schema changes.

Phase 1
Catalog Capture
Tables, columns, types, keys, indexes
Phase 2
Data Sampling
Value profiling in a single round-trip
Phase 3
Implicit FK Discovery
Finds undeclared table relationships
Phase 4
LLM Enrichment
AI descriptions, types, domain mapping
Phase 5
Result Processing
Stores knowledge, tracks coverage

Phase 1: Schema Catalog Capture

The first phase connects to your database through the Query Streams Agent and reads the information schema catalog. This captures every table name, column name, data type, index definition, foreign key constraint, row count, and developer comment across all accessible schemas. The Agent runs on your own network and establishes a secure outbound-only connection, so no inbound ports, VPN tunnels, or firewall changes are required. Schema catalog capture is fast because it reads metadata, not data. A database with 200 tables typically completes this phase in under 3 seconds. The output is a complete structural map that Nova uses as the foundation for every subsequent phase and every SQL query it generates.

Phase 2: Data Sampling

Once Nova knows what tables and columns exist, it needs to understand what values they contain. Phase 2 sends a single ProfileTableForAI call per table through the Query Streams Agent. This specialized profiling operation replaces what would otherwise require 11 to 28 separate queries per table: sampling distinct values, detecting value distributions, identifying NULL rates, discovering enum patterns, and measuring cardinality, all in one network round-trip. Data sampling is what allows Nova to know that your state column uses two-letter abbreviations like “CA” instead of “California,” or that your status field contains “active”/”inactive” rather than 0/1. This prevents the most frustrating class of text-to-SQL errors: queries that are structurally correct but filter on values that don’t exist in your data.

Phase 3: Implicit Foreign Key Discovery

Many production databases have relationships between tables that aren’t declared as formal foreign key constraints. A customers.id column and an orders.customer_id column clearly relate to each other, but if no FK constraint exists in the schema, a basic catalog read won’t detect the connection. Phase 3 solves this by analyzing column names, data types, and value overlaps to identify undeclared relationships between tables. This implicit FK discovery is critical for complex natural language database queries that require multi-table JOINs. Without it, Nova would only be able to join tables with declared foreign keys, which in many real-world databases covers less than half of the actual relationships. By mapping both declared and implicit relationships, Nova can trace JOIN paths across your entire schema and generate accurate multi-table queries from questions like “show me orders with their customer names and product details.”

Phase 4: LLM Enrichment

Phase 4 passes the structural and profiling data to the AI for semantic enrichment. The LLM generates human-readable descriptions for every table and column, classifies semantic types (identifying that created_at is a creation timestamp, email is a contact field, sku is a product identifier), detects enum-like columns where a finite set of values repeats across rows, and maps tables to business domains such as sales, inventory, HR, or finance. This enrichment transforms raw technical metadata into contextual knowledge. When you ask “show me employee salaries by department,” Nova doesn’t just pattern-match the word “employee” to a table name. It understands which tables belong to the HR domain, which columns represent compensation data, and which column serves as the department grouper. Semantic classification is what separates a keyword-matching tool from an AI SQL assistant that genuinely understands your data model.

Phase 5: Result Processing

The final phase stores all learned knowledge and calculates coverage metrics. Nova tracks analysis completion at three levels: per-database (how many tables have been profiled), per-table (how many columns are enriched), and per-column (whether type classification and value profiling are complete). Result processing also includes contributor tracking. Every piece of learned knowledge is tagged as AI-generated or human-contributed. Team members can supplement the AI’s learning through a conversational training interface where Nova generates targeted questions about ambiguous columns or tables and humans answer in natural language. This collaborative approach combines the AI’s speed with human domain expertise, and the contributor tags ensure you always know the source of each annotation.

Your data stays on your network. The Query Streams Agent handles all data sampling locally. Only aggregated schema metadata (table names, column types, value distributions) reaches the AI. Actual data rows never leave your infrastructure. The Agent establishes outbound-only encrypted connections, so no inbound ports or firewall changes are needed.

How Schema Intelligence Makes Nova Different

The gap between Nova and generic AI chatbots comes down to verified knowledge versus probabilistic guessing. When a general-purpose AI writes SQL for your database, it constructs queries based on statistical patterns in its training data. It might guess users when your table is actually app_users, or assume price when your column is unit_cost. These guesses are invisible to the user until the query fails or returns wrong results.

Capability Nova AI (Schema Intelligence) Generic AI Chatbots
Schema access Reads real database catalog No access to your schema
Column profiling Samples actual data values Assumes common patterns
Relationship mapping Discovers declared + implicit FKs Guesses from column names
SQL dialect 9 dialect-specific generators Generic SQL syntax only
Pre-execution validation SQLGlot syntax checking No validation step
Continuous learning Improves with each analysis Static training data

Nova eliminates guessing entirely. Every table, column, relationship, and data pattern referenced in a generated query comes from the Schema Intelligence knowledge base, verified against your actual database. Nova also enforces schema-qualified naming (using schema.table format like public.customers) and passes every generated query through SQLGlot syntax validation before execution. If a referenced column doesn’t match at a 60% similarity threshold (via rapidfuzz), Nova flags it and either corrects automatically or asks for clarification. This makes Nova not just an AI database schema reader but a SQL quality gate that catches errors before they reach your data.

The Schema Intelligence Interface

The Schema Intelligence interface, accessible at /nova/intelligence in the Query Streams portal, provides a visual dashboard of what Nova knows about each connected database. You can see per-table analysis status, coverage percentages for columns and relationships, and the source of each annotation (AI-generated or human-contributed). Per-entity analysis buttons let you trigger or re-run analysis on individual tables or columns on demand.

Four learning modes let you control how Schema Intelligence operates per database. Auto runs the full 5-phase pipeline automatically when a new data source is connected. Assisted notifies you before running the analysis and asks for confirmation. Manual lets you trigger analysis on individual tables using per-entity buttons. Off disables Schema Intelligence entirely for databases where you prefer to write SQL manually. The training interface is where human domain expertise meets AI speed: Nova generates targeted questions about gaps in its understanding, and team members answer conversationally. Each response is stored as human-contributed knowledge that supplements the automated analysis, which is particularly valuable for databases with non-obvious naming conventions or legacy schemas where column names don’t clearly indicate their purpose.

Nova AI
Don’t know SQL? Nova AI builds the query for you.
Try Nova
1
Describe what
data you need
Nova
Nova reads schema
& builds the SQL
Save & run from
Excel or Sheets
Help me create a query for last month’s revenue by product — I need it for my weekly sales report.
Nova
Found order_items and products in your schema. Here’s your query — run it to preview, then save it to your library and share it with your team.
Copy Run Save
SELECT
    p.product_name,
    SUM(oi.quantity * oi.unit_price) AS revenue
FROM   public.order_items oi
JOIN   public.products p ON oi.product_id = p.id
WHERE  oi.created_at >= DATE_TRUNC('month', NOW() - INTERVAL '1 month')
GROUP BY p.product_name
ORDER BY revenue DESC

Who Benefits from Automatic Schema Learning

Schema Intelligence isn’t limited to a single role. Any team that works with databases benefits from an AI that understands the data model before generating queries. Here’s how different roles gain from automatic database schema analysis.

Data Analysts

Skip manual schema exploration. Nova’s pre-learned knowledge lets you ask complex analytical questions immediately, without mapping tables and relationships first.

Database Administrators

Nova respects your naming conventions, schema organization, and relationship structures. Schema Intelligence learns your DBA patterns rather than imposing generic assumptions.

Business Teams

Ask data questions in plain English without knowing table names, SQL syntax, or column types. Schema Intelligence ensures Nova understands your business terminology.

Developers

Prototype queries faster on unfamiliar databases. Schema Intelligence’s relationship mapping and semantic classification accelerate the learning curve on new codebases.

Frequently Asked Questions

What is Schema Intelligence in Nova AI? +
Schema Intelligence is Nova AI’s automatic database learning system. It runs a 5-phase pipeline that reads your database catalog, profiles data values, discovers relationships between tables, generates AI-powered descriptions for every table and column, and stores the results as persistent knowledge. This pre-learned understanding allows Nova to generate accurate, validated SQL queries against your real schema rather than guessing at table and column names.
Does Schema Intelligence work with all database types? +
Schema Intelligence supports 9 SQL dialects: PostgreSQL, MySQL, SQL Server, MariaDB, SQLite, Oracle, Snowflake, BigQuery, and DuckDB. It also works with API connectors (Stripe, Shopify, HubSpot, Google Analytics 4, Google Search Console, ShipStation) by analyzing the DuckDB tables that store synced API data.
How long does the schema learning process take? +
Schema catalog capture (Phase 1) typically completes in under 3 seconds for databases with up to 200 tables. The full 5-phase pipeline, including data sampling and LLM enrichment, takes 1 to 5 minutes depending on database size. Nova processes up to 10 tables concurrently to maximize speed, and the analysis only needs to run once per database unless your schema changes.
Is my data safe during schema analysis? +
Yes. The Query Streams Agent runs on your own network and handles all data sampling locally. Only aggregated schema metadata reaches the AI: table names, column types, value distributions, and relationship mappings. Actual data rows never leave your infrastructure. The Agent uses outbound-only encrypted connections, requiring no inbound ports or firewall changes.
What are Nova’s learning modes? +
Nova offers four learning modes configurable per database: Auto (runs the full pipeline automatically on connection), Assisted (asks for confirmation before analysis), Manual (triggered per table via analysis buttons), and Off (disables Schema Intelligence entirely). Most users start with Auto mode and switch to Manual for databases where they want fine-grained control over which tables are analyzed.
Can Schema Intelligence detect relationships that aren’t declared as foreign keys? +
Yes. Phase 3 of the pipeline specifically targets implicit foreign key discovery. It analyzes column names, data types, and value overlaps to identify undeclared relationships between tables. This is critical because many production databases have relationships that exist in practice but aren’t formally declared as FK constraints, especially in legacy systems or databases managed without strict referential integrity enforcement.
How does Schema Intelligence improve SQL accuracy? +
Schema Intelligence prevents hallucinated column names by verifying every reference against your real schema. It ensures correct filter values through data profiling, maps accurate JOIN paths via relationship discovery, generates dialect-specific syntax for your database engine, and validates every query through SQLGlot syntax checking before execution. The result is a text-to-SQL system that operates on verified knowledge rather than probabilistic inference.
Does Schema Intelligence work with API data sources? +
Yes. When you connect an API connector like Stripe, Shopify, or HubSpot through Query Streams, the data is synced into local DuckDB tables. Schema Intelligence analyzes these DuckDB tables the same way it analyzes any other database, learning the table structure, column types, and value patterns so Nova can generate accurate SQL against your API data.

Get Started

Let Nova Learn Your Database

Connect your data source and Schema Intelligence runs automatically. Better SQL starts with deeper understanding. Free to start, no credit card required.

Related guides: Text to SQL with Nova AI | All Features | Databases in Microsoft Excel | Databases in Google Sheets | API Connector

Category: Nova AI

Tags: Nova AI, Schema Intelligence, Database Schema, AI Analytics, Text to SQL, Machine Learning, Database Automation

Meta Description: Nova AI learns your database schema automatically. Better SQL from day one. Try free.

Author Bio:
The Query Streams Team comprises seasoned database experts, network security professionals, and enterprise networking veterans with over 25 years of combined experience in data management, analytics, and secure software development.

Updated on June 3, 2026

Powered by BetterDocs