Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
An open-source AI agent that explores a semantic layer in a Vercel Sandbox to answer natural-language questions with SQL.
OSS Data Analyst is an open-source reference architecture from Vercel Labs for a text-to-SQL agent that explores a semantic layer inside a Vercel Sandbox to answer natural-language questions with SQL.
OSS Data Analyst is a Next.js application combining the Vercel AI SDK, Vercel Sandbox, and SQLite to translate natural-language questions into SQL queries. Instead of hardcoding schema knowledge into prompts, the agent is given shell access to a sandbox populated with your semantic layer YAML files. It discovers the schema at runtime using cat, grep, and ls, builds SQL, executes it against a SQLite database, and returns results with a narrative explanation. The project is maintained by Vercel Labs and is available on GitHub.
cat, grep, ls) to browse catalog.yml and entity definitions, so it adapts to any schema without prompt changes.src/semantic/entities/ are picked up automatically; no code changes or redeployment required.src/semantic/ with a catalog.yml index and separate YAML files for each entity (companies, people, accounts), each defining sql_table_name, fields, joins, and example questions.pnpm initDatabase creates a SQLite database with sample Companies, People, and Accounts tables for testing.catalog.yml; the agent discovers them at runtime without code changes.The workflow is: create a Vercel Sandbox and populate it with your semantic layer files; the agent explores the catalog and entity definitions using shell commands; it constructs SQL based on the discovered schema; queries execute against SQLite; and results are reported with a narrative explanation. Setup requires Node.js 20+, pnpm, and a Vercel AI Gateway API key.
OSS Data Analyst is an open-source reference architecture from Vercel Labs for building a text-to-SQL agent. It uses a Vercel Sandbox to give the agent shell access to your semantic layer YAML files, so it can discover schema dynamically and answer natural-language questions with SQL.
Yes. The quick start instructs copying env.local.example to .env.local and adding your Vercel AI Gateway key. The agent uses it to power the language model that generates SQL and narratives.
The current implementation runs queries against a SQLite database. The repository includes a script (pnpm initDatabase) that creates a sample SQLite database with Companies, People, and Accounts tables.
Yes. Add entity YAML files to src/semantic/entities/ and update src/semantic/catalog.yml. Because the agent explores schema at runtime, no code changes are needed and the new entities are discovered automatically.
