BrainstormRouter
Personal R&D project by Justin Jilg

Your agent plans.
BrainstormRouter does the work.

The execution layer for marketing work done by AI agents. One connection gives your agent every model it is not, the services you have connected, memory that outlives the conversation, and a spend cap it cannot exceed.

Claude, ChatGPT, Grok, OpenClaw or Hermes decides what to do. BrainstormRouter gives it models (text, image and speech across 55 curated models from 9 providers), hands (the services you connect), memory, and a record of what worked — over one MCP server and one OpenAI- and Anthropic-compatible API. No shared keys: your work runs on a credential that is yours, or it is refused.

Models
55
curated, ranked
Providers
9
routed on merit
Intelligence
13
wired systems
Overhead
<1ms
p95 guardian
Why BrainstormRouter

Learned routing:
it improves from its own results.

Every request feeds Thompson sampling, validity scoring, and a cost/quality frontier that re-ranks providers in real time. Every response ships with a receipt: which model, which tier, what it cost, what it would have cost.

Learned routing

Thompson sampling chooses per-request, not per-config. Winners get more traffic; losers get less. No static rules to maintain.

Verifiable identity

Short-lived mTLS certs via the Cryptographic Agent Framework. Every agent signs in; every call carries a provable origin.

Memory-aware context

SOUL, MEMORY, SKILL, HEARTBEAT, WORKSPACE, REFERENCE — six attributes, 4000 tokens, injected consistently across providers.

Counterfactual receipts

The shadow comparator logs what static routing would have spent. The savings widget shows the delta, live.

Budget enforcement

Per-agent, per-tenant daily caps. Budget forecaster predicts burn and degrades to cheaper tiers before you hit a ceiling.

Semantic cache

pgvector + in-memory hybrid at a 90% similarity threshold. Streaming responses get reconstructed from cache, not just JSON.

What the project explores

Governance you can query,
and evidence you can verify.

The router self-describes, explains every routing decision, and hands back tamper-evident proof. Nothing here is a dashboard bolted on after the fact — each surface is a live endpoint.

Self-describing

Capability graph

GET /v1/capabilities returns a trust-scored map of every subsystem — identity, mesh, custody, routing, governance — as typed contracts. Agents query it instead of grepping. Each score is flagged measured, declared, or unknown.

Decision rationale

Why this model

GET /v1/explain plus X-BR-Explain return the full selection trace: complexity tier, candidates considered, and the cost/quality math.

Tamper-evident

Governance evidence

Signed Governance Artifacts assemble on-read from committed audit rows: chain proof, coverage label, and exercised controls — an experiment in mapping evidence to frameworks such as SOC 2 and NIST AI RMF. The verdict is committed to the hash chain — provable, never rewritten.

Fail-closed

Data-protection constraints

Attach per-request data-residency and retention terms; a data_protection-constrained call routes only to processors whose attested facts satisfy them — and 403s rather than leaking to an unattested one.

Agent-to-agent

A2A mesh

Distributed workflows execute across a governed mesh — steps run in parallel when independent, sequential when dependent, every hop carrying the same identity, budget, and audit envelope as a direct call.

Delegation

Revocable capability grants

Ed25519-signed, chain-bound grants let an agent hand a narrower slice to a sub-agent and revoke the whole subtree with zero cache lag. Every hop stays monotone-narrowing and evidenced.

Counterfactual proof

Every request knows
what static routing would’ve cost.

The shadow comparator records BR’s Thompson decision alongside what a fixed price-only or quality-only router would have picked. Welch’s t-test, Cohen’s d, win-rate confidence interval — exposed over /v1/intelligence/benchmark.

POST /v1/chat/completions
# request headers returned
X-BR-Model:              claude-sonnet-4-6
X-BR-Estimated-Cost:      $0.00412
X-BR-Actual-Cost:         $0.00389
X-BR-Routing-Savings:     $0.00124  # vs. static price-only
X-BR-Guardian-Status:     ok
X-BR-Phases:              planning,execution
X-BR-Efficiency:          0.94
X-BR-Guardian-Overhead-Ms: 0.7

# link headers for AI discoverability
Link: </openapi.yaml>; rel="describedby"; type="application/yaml"
Link: </llms.txt>; rel="alternate"; type="text/plain"

Give your agent hands.

Add one MCP server to your agent, or point the OpenAI SDK at BrainstormRouter. Bring your own provider keys — all 13 intelligence systems on (verify them live: GET /v1/self → intelligence_status), full receipts.