The AI coding assistant that
routes every task to the right model.
Architecture to Opus. Coding to Sonnet. Quick edits to Haiku. Brainstorm learns which model handles each task best — and every decision feeds back into BrainstormRouter and BrainstormLLM, making the whole system smarter.
npm install -g @brainstorm/cliEvery task flows through the intelligence pipeline.
When you type a prompt, it doesn't just go to one model. Brainstorm classifies the task (is it refactoring? debugging? architecture?), estimates complexity (trivial to expert), and selects the optimal model via Thompson sampling — a multi-armed bandit that learns from every outcome.
After execution, the result feeds back: did the code compile? Did tests pass? How much did it cost? This outcome data flows to BrainstormRouter, which updates its model rankings, and to BrainstormLLM, which trains on the full session trajectory.
The result: routing gets smarter with every task you run. Not just for you — for everyone.
Classify
Task type + complexity (code-gen, debug, refactor, architecture, Q&A)
Route
Thompson sampling picks optimal model from 10+ candidates across 8 providers
Execute
58+ tools available — filesystem, shell, git, web search, MCP servers
Verify
Auto-run build/test after edits. Self-correct on failure before responding.
Learn
Outcome → Router rankings update. Full trajectory → LLM training data.
27 packages. Each does one thing well.
Not a monolith. A Turborepo monorepo where each package has a single responsibility — from the task classifier to the encrypted vault to the Docker sandbox. Use the SDK without the CLI, the router without the tools, or swap any layer.
Core
@brainstorm/shared, @brainstorm/config, @brainstorm/db, @brainstorm/providers, @brainstorm/vault
Types, config, persistence, provider discovery, encrypted secrets
Intelligence
@brainstorm/router, @brainstorm/gateway, @brainstorm/eval, @brainstorm/core
Task classifier, 6 strategies, Thompson sampling, BR API client, capability probes, agent loop + 10 middleware
Agents
@brainstorm/agents, @brainstorm/workflow, @brainstorm/orchestrator, @brainstorm/hooks
9 subagent types, 4 workflow presets, 9-phase pipeline, lifecycle hooks
Tools
@brainstorm/tools, @brainstorm/mcp, @brainstorm/plugin-sdk
58+ tools, 10 MCP servers (OAuth, SSE, stdio), plugin SDK for extensions
Analysis
@brainstorm/ingest, @brainstorm/docgen
Deterministic codebase analysis + documentation generation (architecture, module, API docs with Mermaid)
Interface
@brainstorm/cli, @brainstorm/sdk, @brainstorm/vscode, @brainstorm/projects, @brainstorm/scheduler
Ink TUI (4 modes), programmatic SDK, VS Code extension, project registry, cron scheduler
10 middleware interceptors shape every interaction.
Every message passes through a composable middleware pipeline before and after the LLM call. Context compaction, sentiment detection, trajectory recording, subagent limits, build state tracking — all running automatically, all configurable.
This is how Brainstorm stays aware of your project even in long sessions. Proactive compaction keeps context under the window limit. Style learning matches your codebase's patterns. Memory extraction captures important facts across sessions.
Intelligent Routing
Thompson sampling learns which model handles each task best. 6 strategies: quality, cost, combined, capability, learned, rule-based.
6 strategies
58+ Built-in Tools
Filesystem, shell, git, GitHub, web search, planning, agents, transactions, and BrainstormRouter intelligence tools.
11 categories
9 Subagent Types
Explore, plan, code, review, research, decompose, general, and external. Each with scoped tools and focused prompts.
9 types
5 Role Workflows
Architect (read-only), Sr. Developer, Jr. Developer, Product Manager, QA. Each with curated models and tool permissions.
5 roles
10 MCP Servers
Playwright, GitHub, Slack, Linear, Jira, Notion, Datadog, AWS, Stripe, filesystem. Zero-config when installed.
10 servers
Encrypted Vault
AES-256-GCM with Argon2id key derivation. 1Password bridge for teams. Environment variable fallback chain.
AES-256-GCM
4-Mode TUI
Chat, Dashboard, Models, Config — switchable with number keys. Live routing log, tool health gauges, cost tracking.
4 modes
9-Phase Orchestration
Spec → architecture → implementation → review → verify → refactor → deploy → document → report. Multi-model per step.
9 phases
storm ingest
Drop into any codebase. Analyzes languages, frameworks, dependencies, complexity. Generates docs and AI infrastructure.
1 command
you > refactor auth to use JWT
# [classify] type: refactoring, complexity: medium
# [route] claude-sonnet-4.6 via Thompson (0.87 quality)
brainstorm > Reading auth files...
# [tool] file_read src/middleware/auth.ts ✓
# [tool] file_edit src/middleware/auth.ts ✓
# [tool] shell npm test ✓ (23 passed)
brainstorm > Done. $0.004
# [learn] outcome:success → Thompson updated
$ storm ingest
# Phase 1: Analyzing codebase...
✓ 847 files, 94K lines, 12 modules
# Phase 2: Generating documentation...
✓ ARCHITECTURE.md + 12 module docs
# Phase 3: Setting up AI infrastructure...
✓ BRAINSTORM.md generated
✓ 8 .agent.md domain experts
✓ Recipe directory initialized
Ingest complete in 2.1s. Run storm chat to start.
Every platform we build is built with Brainstorm CLI.
This isn't a demo tool. It's how 4 production platforms were built — generating trajectories that train BrainstormLLM and routing data that sharpens BrainstormRouter.
BrainstormMSP
93% auto-heal
37 AI agents for autonomous MDR. Built entirely with storm chat + /architect + /sr-developer roles.
Peer10
App Store live
Youth sports platform with 35 domain services. ChangeSet pattern designed in /architect, implemented by /sr-developer.
Brainstorm-GTM
1 operator
70 autonomous marketing agents. Each agent designed via storm workflows, deployed through storm orchestrate.
Lead Network
Fully autonomous
33 domains across 7 verticals. Single codebase scaffold via storm ingest, expanded with storm spawn.
CLI — Free Forever
All 27 packages, 58+ tools, role system, TUI, and plugin SDK are open source under Apache 2.0. Use with your own API keys — direct to providers.
- ✓Full CLI with all features
- ✓Local model support (Ollama, LM Studio, llama.cpp)
- ✓Direct provider API keys (Anthropic, OpenAI, Google, DeepSeek, Moonshot)
- ✓6 local routing strategies
+ Router = Intelligence
Connect to BrainstormRouter for cloud-scale intelligence. Thompson sampling across 362 models, semantic cache, streaming guardrails, persistent memory, and the evidence ledger.
- ✓362 models across 30+ providers
- ✓13 intelligence systems
- ✓Streaming token guardrails
- ✓Every session trains BrainstormLLM
Install
npm install -g @brainstorm/cliConfigure
storm initSets up config, discovers providers, connects to Router
Start coding
storm chatOr: storm ingest to analyze your codebase first
Free · Apache 2.0
Route every task. Free forever.
27 packages. 58+ tools. Zero vendor lock-in. Connect your own keys or plug into the Router.