Skip to content
AI Notebook Lab

AI Notebook Lab

AI-powered notebook environment built on JupyterLab for data science, analysis, and development.

Overview

AI Notebook Lab is built on JupyterLab, the industry-standard notebook environment, enhanced with deeply integrated AI capabilities. Query databases with natural language, generate visualizations, learn from your codebase, and leverage multiple AI providers—all within your notebooks.

Key Capabilities

Database Magic (%db / %%db)

Interact with your databases using natural language or direct SQL:

  • Natural Language SQL - Ask questions in plain English, get SQL + results
  • Multi-Database Support - PostgreSQL, MySQL, SQLite, BigQuery, Snowflake, Redshift, and more
  • One-shot schema discovery - Auto-inspect datasource schemas
  • DataFrame results - Results returned as pandas DataFrames

AI Magic (%ai / %%ai)

Direct access to AI models for code generation, explanations, and more:

  • Multiple Providers - OpenAI, Anthropic, Google, Mistral, Ollama, AWS Bedrock
  • Output Formats - Code, markdown, HTML, math, JSON, text
  • Variable Interpolation - Reference notebook variables in prompts
  • Conversation Memory - Multi-turn context across cells

Chat Interface

Sidebar chat with slash commands:

  • /learn - Index local files for Q&A
  • /generate - Create entire notebooks from descriptions
  • /fix - Diagnose and fix code errors
  • /ask - Query learned content
  • /clear - Reset conversation

Quick Start

Natural Language SQL

%%db ask sales_db
What were the top 10 products by revenue last quarter?

Output includes:

  • Generated SQL query
  • Executed results as a pandas DataFrame
  • _df and _sql variables available for further processing

Connect to a Database

%db list                    # See available datasources
%db connect sales_db        # Connect (creates SQLAlchemy engine)
%db schema sales_db         # Inspect tables and columns

Code Generation

%%ai anthropic:claude-3-5-sonnet-20241022 -f code
Write a function to calculate compound interest with
principal, rate, time, and compounding frequency parameters

Learn Your Codebase

# In chat sidebar
/learn ./src

# Then ask questions
/ask How does the authentication system work?

Example Notebooks

Explore the Calliope Demo Repository with 28 ready-to-run notebooks:

By Database

DatabaseTypeUse Case
SakilaMySQLDVD rental analytics, inventory
ChinookPostgreSQLMusic store, e-commerce
NorthwindPostgreSQLBusiness operations, supply chain
EmployeesMySQLHR analytics, compensation
WorldMySQLGeographic, demographics
AirportDBMySQLTransportation, logistics

By Topic

  • Calliope-GettingStarted.ipynb - First queries, model selection
  • Calliope-AdvancedQueries.ipynb - Joins, window functions, analytics
  • Calliope-Visualizations.ipynb - Charts, plots, dashboards
  • Calliope-DirectSQL.ipynb - SQL generation and debugging
  • Calliope-JupyterAI-Integration.ipynb - Multi-model workflows

When to Use Lab

TaskBest Tool
Data analysis and explorationLab
Natural language SQL queriesLab
Interactive notebooksLab
Visualizations and chartsLab
Multi-file code developmentIDE
Web automationAgentic Browser

Documentation