ScienceLab
AI-powered research environment for VS Code. Describe a scientific concept and ScienceLab generates interactive HTML simulations, manages research knowledge, and runs autonomous investigation loops — all inside your editor.
Features
Interactive Simulations
Tell the agent what you want to explore and it produces a self-contained HTML simulation rendered live in a side panel. Simulations support runtime parameters, telemetry, and auto-repair when errors occur.
- Create — generate a new simulation from a natural-language description
- Enhance — iteratively improve an existing simulation with new features
- Fix — automatically detect and repair runtime errors
- Fork — run parallel experiments side by side (
Cmd+Shift+F)
20+ Scientific Libraries
ScienceLab ships with skill files that teach the agent how to use major scientific libraries. When a prompt matches a library's domain, the relevant skill is injected into context so the agent produces correct, idiomatic code.
| Domain |
Libraries |
| Symbolic math |
math.js, numeric.js, nerdamer, Algebrite, Complex.js, Fraction.js |
| Visualization |
Plotly.js, D3.js, Chart.js, KaTeX |
| Physics |
Matter.js, Cannon-es, Rapier |
| Geometry |
Turf.js, earcut, robust-predicates, cdt2d, JSXGraph, GeoGebra |
| Linear algebra |
gl-matrix |
| Semantic computing |
TinyAleph |
Simulations can exchange data between libraries through a shared window.labData protocol with typed containers, an event bus, and converter helpers.
Research Workflow
- Knowledge Base — save, search, and cross-reference findings across sessions
- Research Roadmap — define a mission with phased milestones; the agent tracks progress
- Journal — timestamped research notes linked to simulation artifacts
- Autonomous Loop — the agent generates its own follow-up questions and iterates (up to 10 cycles)
- Deep Research — launch long-running Google Deep Research investigations and poll for results
- Paper Generation — export a research session as a structured academic paper
VS Code Integration
ScienceLab uses native VS Code APIs throughout:
- Sidebar — activity bar icon with tree views for roadmap, knowledge, messages, tasks, timeline, and portfolio
- Chat Participant —
@sciencelab in the VS Code chat panel with /research, /simulate, and /knowledge commands
- Language Model Tools — deep research, knowledge search, and simulation creation available to any chat participant
- Notebooks —
.sciencelab notebook format with executable research cells
- CodeLens — "Run in ScienceLab" and "Export Simulation" actions on HTML files
- Debug Adapter — pause, resume, step, inspect, and evaluate expressions inside running simulations
- Test Controller — automated simulation tests (renders, doesn't error, converges)
- File System Provider — browse workspace research data via
sciencelab:// URIs
- Decorations — knowledge-linked highlights on simulation source files
- Comments — AI-generated annotations on simulation code
- Timeline — chronological view of messages and journal entries
- Multi-Root — portfolio tree for cross-project search, knowledge cross-referencing, and simulation comparison
- Tasks — deep research and paper generation as VS Code tasks
- Status Bar — current model and research status at a glance
- External Services — arXiv search, Wolfram Alpha queries, GitHub Gist sharing
Multi-Model Support
Works with Gemini, Anthropic (Claude), and OpenAI models. API keys are stored securely in VS Code's SecretStorage. Select a model from the status bar or with Cmd+Shift+M.
Getting Started
Prerequisites
- VS Code 1.95+
- At least one LLM API key (Gemini, Anthropic, or OpenAI)
Install
- Install the
.vsix file: Extensions > ... > Install from VSIX...
- Open the command palette and run ScienceLab: Configure API Keys
- Enter your API key for at least one provider
- Run ScienceLab: Open Researcher (
Cmd+Shift+L) to launch the main panel
First Simulation
- Type a prompt like "Simulate a double pendulum with adjustable mass and length"
- The agent generates an interactive HTML simulation in the viewer
- Use the parameter sliders to adjust values in real time
- Click Enhance or type a follow-up to iterate
Autonomous Research
- Set a research mission in the roadmap panel
- Enable Auto Loop in settings (
sciencelab.autoLoop)
- The agent generates synthetic questions, runs simulations, and advances the roadmap automatically
Keyboard Shortcuts
| Shortcut |
Command |
Cmd+Shift+L |
Open ScienceLab |
Cmd+Shift+N |
New Research Session |
Cmd+Shift+M |
Select Model |
Cmd+Shift+O |
Open Workspace |
Cmd+Shift+F |
Fork Experiment to Side Panel |
Settings
| Setting |
Default |
Description |
sciencelab.voiceEnabled |
false |
Text-to-speech narration of results |
sciencelab.defaultModel |
"" |
Default LLM model ID |
sciencelab.webGrounding |
false |
Web grounding for research queries |
sciencelab.autoLoop |
false |
Autonomous research loop |
sciencelab.showKnowledgeDecorations |
true |
Knowledge-linked decorations on files |
Adding Custom Skills
Drop .md files into the skills/ directory of your research workspace. Each skill file uses YAML frontmatter:
---
name: my-library
description: How to use MyLibrary for X
trigger: keyword
keywords: [mylib, custom-domain]
---
Usage instructions and code examples here...
trigger: auto — always included in the system prompt
trigger: keyword — included when the user's prompt matches any keyword
trigger: manual — only included when explicitly referenced
Architecture
src/
extension.ts — activation, commands, webview panels
backend.ts — IPC message routing, workspace/data management
agent/
orchestrator.ts — task dispatch, autonomous loop, skill loading
agent-host.ts — ObotoAgent wrapper, event bridging
tool-tree.ts — simulation create/enhance/fix tool handlers
skill-manager.ts — skill file loading and prompt injection
system-prompt.ts — orchestrator system prompt builder
simulation-prompt.ts — simulation generation prompt builder
constants.ts — default model IDs
providers.ts — LLM client factory
event-types.ts — shared TypeScript interfaces
providers/
16 VS Code API integration modules
webview-ui/
src/
contexts/ — LabStateContext (central state)
hooks/ — useAgentChat, useModels, useWorkspace, etc.
components/ — React UI components
api.js — IPC fetch wrapper
vscodeNative.js — native VS Code dialog/config bridge
skills/ — library skill files (.md)
License
MIT
| |