Natural language interface for creating Apache Superset dashboards
Project description
superset-ai
A Python library and LangGraph agent for managing Apache Superset via natural language.
Features
- 16 chart types: bar, line, pie, table, big number (KPI), area, big number with trendline, timeseries bar, bubble, funnel, gauge, treemap, histogram, box plot, heatmap
- Full CRUD: create, read, update, delete for charts and dashboards
- Tabbed dashboards: organize charts into named tabs
- Native filters: add/remove/list interactive filters (select, range, time, etc.)
- Color schemes: 12 built-in color schemes for dashboards
- Dataset management: find or create datasets, list columns, discover databases/schemas/tables
- Automatic asset reuse: finds existing datasets and charts when possible
- Session-based memory: multi-turn conversations with context (agent mode)
Quick Start
# Create virtual environment
python3.13 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -e ".[dev]"
# Start Superset (Docker required)
docker-compose up -d
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Test connection
superset-ai test-connection
# Start chatting (requires agent extras)
superset-ai chat
LangChain Agent
Embed the Superset agent in your Python application:
from superset_ai.agent.graph import create_graph
from superset_ai.agent.tools import set_tool_context
# Create the agent graph
graph = create_graph()
# Set tool context (provides service instances)
set_tool_context(your_context)
# Invoke the agent
result = await graph.ainvoke({"messages": [("user", "Create a bar chart of sales by region")]})
CLI
# Interactive chat mode (requires superset-ai[agent])
superset-ai chat
# Test Superset connection
superset-ai test-connection
# List available databases
superset-ai list-databases
Configuration
All settings use the SUPERSET_AI_ environment variable prefix:
| Variable | Default | Description |
|---|---|---|
SUPERSET_AI_SUPERSET_BASE_URL |
http://localhost:8088 |
Superset instance URL |
SUPERSET_AI_SUPERSET_USERNAME |
admin |
Superset username |
SUPERSET_AI_SUPERSET_PASSWORD |
admin |
Superset password |
SUPERSET_AI_LLM_PROVIDER |
copilot |
LLM provider (copilot or openai) |
SUPERSET_AI_COPILOT_MODEL |
gpt-4o |
Model for GitHub Copilot provider |
SUPERSET_AI_OPENAI_API_KEY |
— | OpenAI API key (when using openai provider) |
SUPERSET_AI_OPENAI_MODEL |
gpt-4o |
Model for OpenAI provider |
SUPERSET_AI_REQUEST_TIMEOUT |
30 |
HTTP request timeout (seconds) |
SUPERSET_AI_MAX_RETRIES |
3 |
Max retry attempts |
SUPERSET_AI_LOG_LEVEL |
INFO |
Log level |
Architecture
Agent tools (agent/tools.py) ──→ operations/ ──→ api/ ──→ Superset REST API
api/— HTTP client and service classes that talk to the Superset REST APIschemas/— Chart/dashboard payload builders and layout generatorsoperations/— Shared business logic (pure functions, no side effects)agent/— LangChain@toolwrappers with session caching and asset trackingcore/— Configuration, authentication, exceptionscli/— Typer CLI application
Development
# Run tests
pytest
# Type checking
python -m pyright src/superset_ai/
# Linter
ruff check src/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
superset_ai-0.2.1.tar.gz
(62.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file superset_ai-0.2.1.tar.gz.
File metadata
- Download URL: superset_ai-0.2.1.tar.gz
- Upload date:
- Size: 62.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c2001ae1cf61060c833f64ced5cdb5d7a1d08ff7ce34a2886159d7be051afa4
|
|
| MD5 |
4c889b1ddb48a86959c75b0cf0f4fefe
|
|
| BLAKE2b-256 |
8186898fde0f012064d17b72e2e453242edaf4babc7f42a386a1922be3ea3daf
|
File details
Details for the file superset_ai-0.2.1-py3-none-any.whl.
File metadata
- Download URL: superset_ai-0.2.1-py3-none-any.whl
- Upload date:
- Size: 75.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e68c887823e0fde0b4ce13bdeb1bceb9e04cffaed3c2b60c756bf1b80b259ac9
|
|
| MD5 |
54e946817609de1c92e42077e6162c25
|
|
| BLAKE2b-256 |
a101968aeee9ad60fd2ba3920b1af49c09bd6955085aa4138a2ea6c7c1fb6fe5
|