Skip to content
Open Source · Apache 2.0

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/cli

24

Packages

42+

Tools

10

MCP Servers

8

Subagents

6

Routing Strategies

/ How Routing Works(01)

Every 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.

01

Classify

Task type + complexity (code-gen, debug, refactor, architecture, Q&A)

02

Route

Thompson sampling picks optimal model from 10+ candidates across 8 providers

03

Execute

42+ tools available — filesystem, shell, git, web search, MCP servers

04

Verify

Auto-run build/test after edits. Self-correct on failure before responding.

05

Learn

Outcome → Router rankings update. Full trajectory → LLM training data.

/ Architecture(02)

24 packages. Each one 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. This means you can 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

8 subagent types, 4 workflow presets, 9-phase pipeline, lifecycle hooks

Tools

@brainstorm/tools, @brainstorm/mcp, @brainstorm/plugin-sdk

42+ 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

/ The Agent Pipeline(03)

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.

01Proactive context compaction
02Sentiment-aware tone guidance
03Trajectory capture → BrainstormLLM training
04Build state tracking (persistent warnings)
05Subagent depth/budget limits
06Token counting + cost tracking
07Style learning (code + prose)
08Memory auto-extraction (4 types)
09Tool health monitoring
10Session checkpointing (crash recovery)
/ Capabilities(04)

Intelligent Routing

Thompson sampling learns which model handles each task best. 6 strategies: quality, cost, combined, capability, learned, rule-based.

6 strategies

42+ Built-in Tools

Filesystem, shell, git, GitHub, web search, planning, agents, transactions, and BrainstormRouter intelligence tools.

11 categories

8 Subagent Types

Explore, plan, code, review, research, decompose, general, and external. Each with scoped tools and focused prompts.

8 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

/ In Action(05)
storm chat — routing

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 — one command

$ 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.

/ In Production(06)

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.

/ Comparison(07)
FeatureBrainstormClaude CodeCursorAider
Multi-model routing6 strategies + ThompsonAuto onlyManual
Open source
Built-in tools42+20+10+5
MCP servers10 built-inUser-config
Role workflows5 rolesArchitect only
Subagents8 types1
Terminal dashboard4 modesIDE
Background agentsWorktree
Codebase ingestRepo map
Programmatic SDK
/ Open Core(08)

CLI — Free Forever

All 24 packages, 42+ 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
/ Get Started(09)
1

Install

npm install -g @brainstorm/cli
2

Configure

storm init

Sets up config, discovers providers, connects to Router

3

Start coding

storm chat

Or: storm ingest to analyze your codebase first