Skip to content

Repository files navigation

BrainGym ๐Ÿง 

Daily Mental Resistance Training to Counteract AI-Induced Cognitive Atrophy.

Live Demo

Live Demo License MIT Dual-Mode Hybrid TypeScript Roadmap


โšก The 10-Year Cognitive Atrophy Crisis

"When pocket calculators became ubiquitous, humanity lost the reflex for quick mental arithmetic. Today, as generative AI drafts our sentences, debugs our logic, and synthesizes our systems, we risk something far more dangerous: the atrophy of active human reasoning."

When you delegate every sentence curation, every back-of-the-envelope estimation, and every architectural trade-off to an AI assistant, the neural pathways responsible for first-principles synthesis weaken. In 10 years, a generation dependent on AI prompts may struggle with independent critical deduction.

BrainGym is the antidote. Just as you visit a physical gym to lift iron against gravity because modern life removed physical strain, you come to BrainGym to exert deliberate cognitive effort against rigorous, unassisted challenges.

                      THE COGNITIVE ATROPHY DILEMMA
                      
   Era: 1980s                 Era: 2020s                  Era: 2030s (Unchecked)
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚  Calculators  โ”‚          โ”‚ Generative AI โ”‚           โ”‚ Complete Passive โ”‚
   โ”‚  introduced   โ”‚          โ”‚  introduced   โ”‚           โ”‚  Mental Atrophy  โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ฒโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚                          โ”‚                            โ”‚
           โ–ผ                          โ–ผ                            โ”‚
   Mental Arithmetic          Sentence Curation                    โ”‚
     reflex dies                & Synthesis dies                   โ”‚
                                      โ”‚                            โ”‚
                                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                    โ”‚
                                                    โ–ผ
                                           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                           โ”‚   BRAINGYM ๐Ÿง    โ”‚
                                           โ”‚ Daily Cognitive โ”‚
                                           โ”‚   Resistance    โ”‚
                                           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฎ The 3 Core Mental Workout Modes

1. ๐Ÿงฎ Fermi Speed Drills (Quantitative Intuition)

  • The Challenge: Rapid order-of-magnitude estimation under zero-search conditions.
  • Example: "How many pianos are tuned in Chicago each year?" or "How many liters of aviation fuel cross the North Atlantic daily?"
  • The Workout: Decompose messy real-world reality into populations, adoption rates, turnover frequencies, and dimensional sanity checks.
  • The Judge: Evaluates your mathematical tree, verifies logarithmic orders of magnitude, and scores your estimation factor.

2. ๐Ÿงฉ Lateral Thinking Conundrums (Divergent Deduction)

  • The Challenge: Counter-intuitive scenarios and mysterious paradoxes where reality contradicts initial intuition.
  • Example: "A man is found dead in the middle of a desert clutching an unopened package. There are no footprints or tire marks. How did he die?"
  • The Workout: Probe the problem space using targeted questions. Break assumptions.
  • The Arbiter: Answers strictly with YES, NO, or IRRELEVANT, penalizing confirmation bias and rewarding rapid hypothesis bifurcation.

3. โš–๏ธ Architecture Trade-off Showdowns (Systems Synthesis)

  • The Challenge: High-stakes engineering and architectural dilemmas with severe physical constraints.
  • Example: "REST vs. GraphQL vs. WebSockets under intermittent 3G connectivity with 50,000 concurrent delivery riders."
  • The Workout: Weigh protocol overhead against failure modes, battery drain, backpressure, and operational complexity.
  • The Arbiter: Evaluates your trade-off analysis across a 5-dimension radar (Scalability, Fault Tolerance, Latency, Operational Cost, and Synthesis).

4. ๐Ÿ” The Hallucination Hunter (Cognitive Scalpel & Logic Audits)

  • The Challenge: Auditing subtle, deceptive factual errors and mathematical sleights of hand in generated AI responses.
  • The Workout: Inspect claims with a cognitive scalpel. Identify hallucinated citations, inverted causality, and statistical fallacies.
  • The Arbiter: Rewards rapid identification of logical fallacies and penalizes false positives.

5. ๐Ÿฐ The Memory Fortress (Working Memory & Spatial Recall)

  • The Challenge: Multi-stage working memory tests and spatial sequence retention under high cognitive load.
  • The Workout: Retain, manipulate, and reconstruct multi-variable states without writing anything down.
  • The Progression: Integrated into a 15-Level Journey Map rewarding consistency, streak retention, and cognitive XP.

๐Ÿ›๏ธ Architecture Standard: Dual-Mode Hybrid Showcase

BrainGym is engineered as a zero-dependency, dual-mode application:

                              BRAINGYM HYBRID CORE
                                       โ”‚
                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                โ–ผ                                             โ–ผ
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚   WEB ARENA (SPA)   โ”‚                       โ”‚     CLI ENGINE      โ”‚
     โ”‚ React 18 + Vite 6   โ”‚                       โ”‚ Node.js CLI Script  โ”‚
     โ”‚ Tailwind CSS (2026) โ”‚                       โ”‚ Interactive Prompt  โ”‚
     โ”‚ Web Audio Synthesizerโ”‚                      โ”‚ Pure Terminal Play  โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ”‚                                             โ”‚
                โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                       โ–ผ
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                       โ”‚   OFFLINE COGNITIVE ARBITER  โ”‚
                       โ”‚  - Deterministic Math Bounds โ”‚
                       โ”‚  - Deduction State Machine   โ”‚
                       โ”‚  - Architecture Rubric Check โ”‚
                       โ”‚  - Optional BYOK Live AI     โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  1. Client-Side Web Arena:

    • Hosted on GitHub Pages with zero backend dependencies.
    • Built-in algorithmic judge engines evaluate formulas, questions, and trade-offs instantly in your browser.
    • Procedural Web Audio synthesizer generates authentic gavel strikes, chimes, and haptic clicks using raw audio oscillators.
    • Optional BYOK (Bring Your Own Key) for live conversational banter using Gemini or OpenAI models.
  2. Local Terminal CLI:

    • Play directly in your developer terminal via npm run cli.
    • Fast, distraction-free keyboard-driven resistance training.

๐Ÿš€ Getting Started

Play in Browser (Instant)

Simply visit: https://1997agarwal.github.io/BrainGym

Run Locally (Web App)

# Clone the repository
git clone https://github.com/1997agarwal/BrainGym.git
cd BrainGym

# Install dependencies
npm install

# Start development server
npm run dev

Open http://localhost:3000 in your browser.

Run in Terminal (CLI Mode)

# Launch interactive terminal workout
npm run cli

๐ŸŽจ Design System: Modern 2026 Light Theme

  • Canvas: Clean, glare-free #f8fafc canvas designed for deep cognitive focus.
  • Elevation: Crisp card panels with delicate inner borders and subtle micro-shadows.
  • Zero Audio Bloat: 100% procedural sound synthesis using the Web Audio API โ€” zero external .mp3 downloads, zero latency, zero asset breakage.

๐Ÿ“‚ Repository Structure

BrainGym/
โ”œโ”€โ”€ .github/workflows/
โ”‚   โ””โ”€โ”€ deploy.yml            # Automated GitHub Pages CI/CD
โ”œโ”€โ”€ bin/
โ”‚   โ””โ”€โ”€ braingym.mjs          # Standalone Terminal CLI Engine
โ”œโ”€โ”€ src/                      # React 18 Web Arena
โ”‚   โ”œโ”€โ”€ App.tsx               # Arena Orchestrator & View Switcher
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ FermiArena.tsx    # Order-of-magnitude estimation arena
โ”‚   โ”‚   โ”œโ”€โ”€ LateralArena.tsx  # Yes/No deduction inquiry state machine
โ”‚   โ”‚   โ”œโ”€โ”€ ArchitectureArena.tsx # 5-dimension system design radar
โ”‚   โ”‚   โ”œโ”€โ”€ HallucinationHunterArena.tsx # AI error audit scalpel
โ”‚   โ”‚   โ”œโ”€โ”€ MemoryFortressArena.tsx # Spatial working memory grid
โ”‚   โ”‚   โ”œโ”€โ”€ LevelMap.tsx      # 15-Level cognitive journey
โ”‚   โ”‚   โ”œโ”€โ”€ Header.tsx        # Streak, XP & navigation top bar
โ”‚   โ”‚   โ””โ”€โ”€ ModeSelector.tsx  # Workout selection dashboard
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”‚   โ””โ”€โ”€ challenges.ts     # Curated drills & benchmark datasets
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ””โ”€โ”€ audio.ts          # Procedural Web Audio synthesizer
โ””โ”€โ”€ index.html                # 2026 Light Theme HTML entry

๐Ÿ‘ค Author

Harshit Agarwal
AI Product Manager & 0-to-1 Systems Builder

LinkedIn X GitHub Email


๐Ÿ“„ License

This project is licensed under the MIT License.

About

Daily mental resistance training to counteract AI-induced cognitive atrophy. Speed drills, logic audits, spatial retention & terminal CLI.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages