Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3675ab8
bar chart completed
IAMkecheng Feb 27, 2026
8d1ee82
complete bar, line, boxplot, heatmap, area, ranged-dot
IAMkecheng Feb 28, 2026
97c39c7
complete echarts
IAMkecheng Mar 1, 2026
98b6916
Merge remote-tracking branch 'upstream/dev' into dev
IAMkecheng Mar 2, 2026
b31af43
add .vscode/settings.json
Chenglong-MS Mar 4, 2026
acaaa02
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
Chenglong-MS Mar 4, 2026
148f28f
Bump immutable from 5.1.4 to 5.1.5
dependabot[bot] Mar 4, 2026
f469e06
update dataloader dependency
Chenglong-MS Mar 5, 2026
bede19f
add color suggestion, update echarts
IAMkecheng Mar 6, 2026
927efcb
Merge pull request #249 from IAMkecheng/dev
Chenglong-MS Mar 10, 2026
e193b82
Merge pull request #248 from microsoft/dependabot/npm_and_yarn/immuta…
Chenglong-MS Mar 10, 2026
70f848f
Bump tornado from 6.5.4 to 6.5.5
dependabot[bot] Mar 12, 2026
d34ae91
Configure pipeline: copilot instructions, CI, and static analysis
WolffM Mar 13, 2026
2350dca
Switch copilot-setup-steps to github-hosted runners (firewall enforce…
WolffM Mar 13, 2026
15ac57e
Bump pyjwt from 2.11.0 to 2.12.0
dependabot[bot] Mar 14, 2026
e35bbe1
library update
Chenglong-MS Mar 14, 2026
e1a890e
Add Docker support
WolffM Mar 14, 2026
5ffacfa
fix requirement for deployment
Chenglong-MS Mar 14, 2026
9d72dda
fix color problem of echarts
IAMkecheng Mar 16, 2026
8d35834
fix color of chart.js
IAMkecheng Mar 16, 2026
16717cd
Merge pull request #255 from IAMkecheng/dev
Chenglong-MS Mar 16, 2026
3080868
Potential fix for pull request finding
Chenglong-MS Mar 16, 2026
9b5b8ee
Potential fix for pull request finding
Chenglong-MS Mar 16, 2026
dc0bd46
Potential fix for pull request finding
Chenglong-MS Mar 16, 2026
3aac5ad
fix the color decision function of echarts and chartjs
IAMkecheng Mar 17, 2026
ba7bd02
Update pie.ts
IAMkecheng Mar 17, 2026
7dda34f
fix: docker volume permissions and sandbox user mismatch
Mar 17, 2026
76c7114
Merge pull request #256 from IAMkecheng/dev
Chenglong-MS Mar 17, 2026
f5e46fe
Bump pyasn1 from 0.6.2 to 0.6.3
dependabot[bot] Mar 17, 2026
aacd947
my effort improving stuff
Chenglong-MS Mar 17, 2026
aafa73d
Potential fix for pull request finding
Chenglong-MS Mar 18, 2026
37e406a
security fixes
Chenglong-MS Mar 18, 2026
0bd37dd
Merge pull request #253 from WolffM/fix/85-add-docker-support
Chenglong-MS Mar 18, 2026
1d72a8b
Merge pull request #257 from microsoft/dependabot/uv/pyasn1-0.6.3
Chenglong-MS Mar 18, 2026
c823961
Merge pull request #252 from microsoft/dependabot/uv/pyjwt-2.12.0
Chenglong-MS Mar 18, 2026
180f52f
Merge pull request #251 from microsoft/dependabot/uv/tornado-6.5.5
Chenglong-MS Mar 18, 2026
32ae2c6
move file
Chenglong-MS Mar 18, 2026
2e95ddc
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
Chenglong-MS Mar 18, 2026
bcf3899
docker update for users
Chenglong-MS Mar 18, 2026
a15ac05
update readme
Chenglong-MS Mar 19, 2026
509c703
template update
Chenglong-MS Mar 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.git
.gitignore
node_modules
__pycache__
*.pyc
.env
.env.*
*.egg-info
dist
build
.pytest_cache
.mypy_cache
6 changes: 3 additions & 3 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ SANDBOX=local # code execution backend: 'local' (default) or 'docke
# OpenAI
OPENAI_ENABLED=true
OPENAI_API_KEY=#your-openai-api-key
OPENAI_MODELS=gpt-5.2,gpt-5.1 # comma separated list of models
OPENAI_MODELS=gpt-5.4,gpt-4.1 # comma separated list of models

# Azure OpenAI
AZURE_ENABLED=true
AZURE_API_KEY=#your-azure-openai-api-key
AZURE_API_BASE=https://your-azure-openai-endpoint.openai.azure.com/
AZURE_MODELS=gpt-5.1
AZURE_MODELS=gpt-5.4

# Anthropic
ANTHROPIC_ENABLED=true
Expand All @@ -35,7 +35,7 @@ ANTHROPIC_MODELS=claude-sonnet-4-20250514
# Ollama
OLLAMA_ENABLED=true
OLLAMA_API_BASE=http://localhost:11434
OLLAMA_MODELS=deepseek-v3.1:latest # models with good code generation capabilities recommended
OLLAMA_MODELS=qwen3:32b # models with good code generation capabilities recommended

# Add other LiteLLM-supported providers with PROVIDER_API_KEY, PROVIDER_MODELS, etc.

Expand Down
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"chat.tools.terminal.autoApprove": {
"npx tsc": true,
"npx vite": true,
"npx tsx": true
}
}
39 changes: 39 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,45 @@ uv run data_formulator --dev # Run backend only (for frontend development)
Open [http://localhost:5567](http://localhost:5567) to view it in the browser.


## Docker

Docker is the easiest way to run Data Formulator without installing Python or Node.js locally.

### Quick start

1. **Copy the environment template and add your API keys:**

```bash
cp .env.template .env
# Edit .env and set your OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.
```

2. **Build and start the container:**

```bash
docker compose up --build
```

3. Open [http://localhost:5567](http://localhost:5567) in your browser.

To stop the container: `docker compose down`

Workspace data (uploaded files, sessions) is persisted in a Docker volume (`data_formulator_home`) so it survives container restarts.

### Build the image manually

```bash
docker build -t data-formulator .
docker run --rm -p 5567:5567 --env-file .env data-formulator
```

### Docker sandbox (`SANDBOX=docker`) is not supported inside a container

The Docker sandbox backend works by calling `docker run -v <host_path>:...` to bind-mount temporary workspace directories into child containers. When Data Formulator itself runs in a Docker container those paths refer to the *container* filesystem, not the host, so Docker daemon cannot mount them and the feature does not work.

Use `SANDBOX=docker` only when running Data Formulator **directly on the host** (e.g. with `uv run data_formulator --sandbox docker` or `python -m data_formulator --sandbox docker`). When using the Docker image, keep the default `SANDBOX=local`.


## Sandbox

AI-generated Python code runs inside a **sandbox** to isolate it from the main server process. Two backends are available:
Expand Down
65 changes: 65 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# ---------------------------------------------------------------------------
# Stage 1: Build the React/TypeScript frontend
# ---------------------------------------------------------------------------
FROM node:20-slim AS frontend-builder

WORKDIR /app

# Install dependencies
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Copy source and build
COPY index.html tsconfig.json vite.config.ts eslint.config.js ./
COPY public ./public
COPY src ./src
RUN yarn build

# ---------------------------------------------------------------------------
# Stage 2: Python runtime with the built frontend bundled in
# ---------------------------------------------------------------------------
FROM python:3.11-slim AS runtime

# System dependencies needed by some Python packages
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
libpq-dev \
unixodbc-dev \
curl \
&& rm -rf /var/lib/apt/lists/*

# Create a non-root user to run the application
RUN useradd -m -s /bin/bash appuser

# Set the home directory for workspace data to a deterministic path
ENV DATA_FORMULATOR_HOME=/home/appuser/.data_formulator

WORKDIR /app

# Copy Python package sources
COPY pyproject.toml MANIFEST.in README.md ./
COPY py-src ./py-src

# Copy the compiled frontend into the package's expected location
COPY --from=frontend-builder /app/py-src/data_formulator/dist ./py-src/data_formulator/dist

# Install the package and its dependencies
RUN pip install --no-cache-dir .

# Switch to non-root user and ensure workspace and app directories are owned by it
RUN mkdir -p "${DATA_FORMULATOR_HOME}" && chown -R appuser:appuser /app "${DATA_FORMULATOR_HOME}"
USER appuser

EXPOSE 5567

HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -f http://localhost:5567/ || exit 1

# Run the app on all interfaces so Docker port-forwarding works.
# We do not pass --dev so Flask runs in production mode (no debugger/reloader).
# webbrowser.open() fails silently in a headless container, which is harmless.
ENTRYPOINT ["python", "-m", "data_formulator", "--host", "0.0.0.0", "--port", "5567"]
161 changes: 25 additions & 136 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ https://github.com/user-attachments/assets/8ca57b68-4d7a-42cb-bcce-43f8b1681ce2

## News 🔥🔥🔥

[03-02-2026] **Data Formulator 0.7 (alpha)** — More charts, new experience, enterprise-ready
[03-18-2026] **Data Formulator 0.7 (alpha)** — More charts, new experience, enterprise-ready
- 📊 **30 chart types** with a new semantic chart engine (area, streamgraph, candlestick, pie, radar, maps, and more).
- 💬 **Hybrid chat + data thread** — chat woven into the exploration timeline with lineage, previews, and reasoning.
- 🤖 **Unified `DataAgent`** replacing four separate agents, plus new recommendation and insight agents.
Expand All @@ -42,6 +42,11 @@ https://github.com/user-attachments/assets/8ca57b68-4d7a-42cb-bcce-43f8b1681ce2
- 📦 **UV-first build** — reproducible builds via `uv.lock`; `uv sync` + `uv run data_formulator`.
- 📝 Detailed writeup on the new architecture coming soon — stay tuned!

> [!TIP]
> **Are you a developer?** Join us to shape the future of AI-powered data exploration!
> We're looking for help with new agents, data connectors, chart templates, and more.
> Check out the [Developers' Guide](DEVELOPMENT.md) and our [open issues](https://github.com/microsoft/data-formulator/issues).

## Previous Updates

Here are milestones that lead to the current design:
Expand All @@ -60,179 +65,63 @@ Here are milestones that lead to the current design:
- **Data Extraction**: Parse data from images and text ([demo](https://github.com/microsoft/data-formulator/pull/31#issuecomment-2403652717))
- **Initial Release**: [Blog](https://www.microsoft.com/en-us/research/blog/data-formulator-exploring-how-ai-can-help-analysts-create-rich-data-visualizations/) | [Video](https://youtu.be/3ndlwt0Wi3c)

<details>
<summary><b>View detailed update history</b></summary>

- [07-10-2025] Data Formulator 0.2.2: Start with an analysis goal
- Some key frontend performance updates.
- You can start your exploration with a goal, or, tab and see if the agent can recommend some good exploration ideas for you. [Demo](https://github.com/microsoft/data-formulator/pull/176)

- [05-13-2025] Data Formulator 0.2.1.3/4: External Data Loader
- We introduced external data loader class to make import data easier. [Readme](https://github.com/microsoft/data-formulator/tree/main/py-src/data_formulator/data_loader) and [Demo](https://github.com/microsoft/data-formulator/pull/155)
- Current data loaders: MySQL, Azure Data Explorer (Kusto), Azure Blob and Amazon S3 (json, parquet, csv).
- [07-01-2025] Updated with: Postgresql, mssql.
- Call for action [link](https://github.com/microsoft/data-formulator/issues/156):
- Users: let us know which data source you'd like to load data from.
- Developers: let's build more data loaders.

- [04-23-2025] Data Formulator 0.2: working with *large* data 📦📦📦
- Explore large data by:
1. Upload large data file to the local database (powered by [DuckDB](https://github.com/duckdb/duckdb)).
2. Use drag-and-drop to specify charts, and Data Formulator dynamically fetches data from the database to create visualizations (with ⚡️⚡️⚡️ speeds).
3. Work with AI agents: they generate SQL queries to transform the data to create rich visualizations!
4. Anchor the result / follow up / create a new branch / join tables; let's dive deeper.
- Checkout the demos at [[https://github.com/microsoft/data-formulator/releases/tag/0.2]](https://github.com/microsoft/data-formulator/releases/tag/0.2)
- Improved overall system performance, and enjoy the updated derive concept functionality.

- [03-20-2025] Data Formulator 0.1.7: Anchoring ⚓︎
- Anchor an intermediate dataset, so that followup data analysis are built on top of the anchored data, not the original one.
- Clean a data and work with only the cleaned data; create a subset from the original data or join multiple data, and then go from there. AI agents will be less likely to get confused and work faster. ⚡️⚡️
- Check out the demos at [[https://github.com/microsoft/data-formulator/releases/tag/0.1.7]](https://github.com/microsoft/data-formulator/releases/tag/0.1.7)
- Don't forget to update Data Formulator to test it out!

- [02-20-2025] Data Formulator 0.1.6 released!
- Now supports working with multiple datasets at once! Tell Data Formulator which data tables you would like to use in the encoding shelf, and it will figure out how to join the tables to create a visualization to answer your question. 🪄
- Checkout the demo at [[https://github.com/microsoft/data-formulator/releases/tag/0.1.6]](https://github.com/microsoft/data-formulator/releases/tag/0.1.6).
- Update your Data Formulator to the latest version to play with the new features.

- [02-12-2025] More models supported now!
- Now supports OpenAI, Azure, Ollama, and Anthropic models (and more powered by [LiteLLM](https://github.com/BerriAI/litellm));
- Models with strong code generation and instruction following capabilities are recommended (gpt-4o, claude-3-5-sonnet etc.);
- You can store API keys in `.env` to avoid typing them every time (copy `.env.template` to `.env` and fill in your keys).
- Let us know which models you have good/bad experiences with, and what models you would like to see supported! [[comment here]](https://github.com/microsoft/data-formulator/issues/49)

- [11-07-2024] Minor fun update: data visualization challenges!
- We added a few visualization challenges with the sample datasets. Can you complete them all? [[try them out!]](https://github.com/microsoft/data-formulator/issues/53#issue-2641841252)
- Comment in the issue when you did, or share your results/questions with others! [[comment here]](https://github.com/microsoft/data-formulator/issues/53)

- [10-11-2024] Data Formulator python package released!
- You can now install Data Formulator using Python and run it locally, easily. [[check it out]](#get-started).
- Our Codespaces configuration is also updated for fast start up ⚡️. [[try it now!]](https://codespaces.new/microsoft/data-formulator?quickstart=1)
- New experimental feature: load an image or a messy text, and ask AI to parse and clean it for you(!). [[demo]](https://github.com/microsoft/data-formulator/pull/31#issuecomment-2403652717)

- [10-01-2024] Initial release of Data Formulator, check out our [[blog]](https://www.microsoft.com/en-us/research/blog/data-formulator-exploring-how-ai-can-help-analysts-create-rich-data-visualizations/) and [[video]](https://youtu.be/3ndlwt0Wi3c)!

</details>

## Overview

**Data Formulator** is a Microsoft Research prototype for data exploration with visualizations powered by AI agents.

Data Formulator enables analysts to iteratively explore and visualize data. Started with data in any format (screenshot, text, csv, or database), users can work with AI agents with a novel blended interface that combines *user interface interactions (UI)* and *natural language (NL) inputs* to communicate their intents, control branching exploration directions, and create reports to share their insights.
Data Formulator enables analysts to explore data with visualizations. Started with data in any format (screenshot, text, csv, or database), you can work with AI agents with a novel blended interface that combines *user interface interactions (UI)* and *natural language (NL) inputs* to communicate their intents, control branching exploration directions, and create reports to share their insights.

## Get Started

Play with Data Formulator with one of the following options:
Play with Data Formulator with one of the following options.

- **Option 1: Install via uv (recommended)**

[uv](https://docs.astral.sh/uv/) is an extremely fast Python package manager. If you have uv installed, you can run Data Formulator directly without any setup:

```bash
# Run data formulator directly (no install needed)
uvx data_formulator
```

Or install it in a project/virtual environment:

```bash
# Install data_formulator
uv pip install data_formulator

# Run data formulator
python -m data_formulator
```

Data Formulator will be automatically opened in the browser at [http://localhost:5567](http://localhost:5567).
Run `uvx data_formulator --help` to see all available options, such as custom port, sandboxing mode, and data storage location.

- **Option 2: Install via pip**

Use pip for installation (recommend: install it in a virtual environment).

```bash
# install data_formulator
pip install data_formulator

# Run data formulator with this command
python -m data_formulator
pip install data_formulator # install
python -m data_formulator # run
```

Data Formulator will be automatically opened in the browser at [http://localhost:5567](http://localhost:5567).

*you can specify the port number (e.g., 8080) by `python -m data_formulator --port 8080` if the default port is occupied.*

- **Option 3: Codespaces (5 minutes)**

You can also run Data Formulator in Codespaces; we have everything pre-configured. For more details, see [CODESPACES.md](CODESPACES.md).

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/data-formulator?quickstart=1)
- **Option 3: Run with Docker**

- **Option 4: Working in the developer mode**

You can build Data Formulator locally if you prefer full control over your development environment and develop your own version on top. For detailed instructions, refer to [DEVELOPMENT.md](DEVELOPMENT.md).
```bash
docker compose up --build
```

Open [http://localhost:5567](http://localhost:5567) in your browser. To stop, press `Ctrl+C` or run `docker compose down`.

## Using Data Formulator
- **Option 4: Codespaces**

### Load Data
You can run Data Formulator in Codespaces; we have everything pre-configured. For more details, see [CODESPACES.md](CODESPACES.md).

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/data-formulator?quickstart=1)

Besides uploading csv, tsv or xlsx files that contain structured data, you can ask Data Formulator to extract data from screenshots, text blocks or websites, or load data from databases use connectors. Then you are ready to explore.

<img width="1920" alt="image" src="https://github.com/user-attachments/assets/e23cdb47-984c-4ce4-a014-8f36e025e393" />
- **Option 5: Working as developer**

You can build Data Formulator locally and develop your own version. Check out details in [DEVELOPMENT.md](DEVELOPMENT.md).

### Explore Data

There are four levels to explore data based depending on whether you want more vibe or more control:
## Using Data Formulator

- Level 1 (most control): Create charts with UI via drag-and-drop, if all fields to be visualized are already in the data.
- Level 2: Specify chart designs with natural language + NL. Describe how new fields should be visualized in your chart, AI will automatically transform data to realize the design.
- Level 3: Get recommendations: Ask AI agents to recommend charts directly from NL descriptions, or even directly ask for exploration ideas.
- Level 4 (most vibe): In agent mode, provide a high-level goal and let AI agents automatically plan and explore data in multiple turns. Exploration threads will be created automatically.
Besides uploading csv, tsv or xlsx files that contain structured data, you can ask Data Formulator to extract data from screenshots, text blocks or websites, or load data from databases use connectors. Then you are ready to explore. Ask visualizaiton questions, edit charts, or delegate some exploration tasks to agents. Then, create reports to share your insights.

https://github.com/user-attachments/assets/164aff58-9f93-4792-b8ed-9944578fbb72

- Level 5: In practice, leverage all of them to keep up with both vibe and control!

### Create Reports

Use the report builder to compose a report of the style you like, based on selected charts. Then share the reports to others!

<!--
### The basics of data visualization
* Set up model provider, for agentic experience, model with reasoning and strong code generation ablity is recommended.
* Describe the exploration

https://github.com/user-attachments/assets/0fbea012-1d2d-46c3-a923-b1fc5eb5e5b8


### Create visualization beyond the initial dataset (powered by 🤖)
* You can type names of **fields that do not exist in current data** in the encoding shelf:
- this tells Data Formulator that you want to create visualizations that require computation or transformation from existing data,
- you can optionally provide a natural language prompt to explain and clarify your intent (not necessary when field names are self-explanatory).
* Click the **Formulate** button.
- Data Formulator will transform data and instantiate the visualization based on the encoding and prompt.
* Inspect the data, chart and code.
* To create a new chart based on existing ones, follow up in natural language:
- provide a follow up prompt (e.g., *``show only top 5!''*),
- you may also update visual encodings for the new chart.

https://github.com/user-attachments/assets/160c69d2-f42d-435c-9ff3-b1229b5bddba

https://github.com/user-attachments/assets/c93b3e84-8ca8-49ae-80ea-f91ceef34acb

Repeat this process as needed to explore and understand your data. Your explorations are trackable in the **Data Threads** panel. -->

## Developers' Guide

Follow the [developers' instructions](DEVELOPMENT.md) to build your new data analysis tools on top of Data Formulator.

Help wanted:

* Add more database connectors (https://github.com/microsoft/data-formulator/issues/156)
* Scaling up messy data extractor: more document types and larger files.
* Adding more chart templates (e.g., maps).
* other ideas?

## Research Papers
* [Data Formulator 2: Iteratively Creating Rich Visualizations with AI](https://arxiv.org/abs/2408.16119)

Expand Down
Loading
Loading