Upload any media. See your brain's response. Understand it instantly.
Resonance pairs Meta's TRIBE v2 brain encoding model with Claude to predict fMRI activation maps from video, audio, images, or text — then explains the results in plain language. No neuroscience required.
- Upload media → 3D brain activation map renders in seconds
- A/B mode → compare two stimuli, get a diff map and Claude winner declaration
- Experiment builder → multi-condition hypothesis testing with ranked results
- Demo gallery → three preloaded experiments, works with no backend
| Tool | Version | Install |
|---|---|---|
| Node.js | 18+ | nodejs.org |
| Yarn | 4.x | corepack enable |
| Python | 3.11+ | python.org |
| FFmpeg | any | brew install ffmpeg |
Create .env in the project root. Never commit this file.
cp .env.example .env # if it exists, else create manuallyRequired variables:
ANTHROPIC_API_KEY=sk-ant-...
MODAL_TOKEN_ID=...
MODAL_TOKEN_SECRET=...
TRIBE_ENDPOINT_URL=https://...modal.run
Get ANTHROPIC_API_KEY at console.anthropic.com.
Get Modal credentials at modal.com after running modal setup.
cd frontend
yarn install
yarn devRuns at http://localhost:5173.
First time only — install feature packages:
yarn add three @types/three recharts jspdf html2canvas lucide-reactcd backend
pip install -r requirements.txt
uvicorn main:app --reloadRuns at http://localhost:8000.
Required for real inference. Skip for demo-only mode (backend runs in stub mode without this).
TRIBE v2 uses LLaMA 3.2-3B internally. You need access to both gated repos:
- https://huggingface.co/facebook/tribev2 — click "Agree and access"
- https://huggingface.co/meta-llama/Llama-3.2-3B — click "Expand to review and access", submit form
Create a Read token at https://huggingface.co/settings/tokens.
cd modal_deploy
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
modal setup # opens browser for auth
modal secret create huggingface HF_TOKEN=hf_YOUR_TOKENcd modal_deploy
source venv/bin/activate
modal deploy tribe_endpoint.pyModal prints a URL like https://yourworkspace--tribev2-endpoint-predict.modal.run.
Add the URL to backend/.env:
TRIBE_ENDPOINT_URL=https://yourworkspace--tribev2-endpoint-predict.modal.run
echo "The cat sat on the mat." > /tmp/hello.txt
curl -X POST "$TRIBE_ENDPOINT_URL" -F media=@/tmp/hello.txt -F modality=textFirst call cold-starts (~2 min). Subsequent calls are fast. See modal_deploy/SETUP.md for the full runbook.
Three preloaded experiments in frontend/src/data/demos/ work offline:
demo_ad_copy_ab.json— emotional vs rational ad copy (text A/B)demo_calm_vs_exciting.json— nature clip vs action trailer (video A/B)demo_podcast_intro.json— two podcast cold opens (audio A/B)
Run frontend only, select a demo card, no API keys needed.
# Frontend
cd frontend
yarn dev # dev server
yarn typecheck # TypeScript check
yarn lint # ESLint
# Backend
cd backend
uvicorn main:app --reload # dev server
pytest # tests
ruff check . # lintresonance-app/
├── README.md
├── CLAUDE.md # AI agent instructions — read before coding
├── .env # Never commit
├── docs/ # Full specifications
│ ├── 01-architecture.md # Module rules, data flow, directory tree
│ ├── 02-design-system.md # Colors, typography, Tailwind theme
│ ├── 03-component-contracts.md # Component props + acceptance criteria
│ ├── 04-backend-contracts.md # Python module APIs + isolation rules
│ ├── 05-api-schema.md # HTTP routes + TypeScript types
│ ├── 06-feature-build-guide.md # Build order, install commands, gotchas
│ └── 07-claude-patterns.md # Claude API prompt patterns
├── frontend/
│ ├── src/
│ │ ├── App.tsx
│ │ ├── theme.ts # Tailwind design tokens / CSS vars
│ │ ├── types/api.ts # Shared TypeScript types
│ │ ├── components/ # Feature components (F-01 through F-10)
│ │ ├── pages/ # Playground.tsx, Results.tsx
│ │ └── data/demos/ # Preloaded demo JSON files
│ └── package.json
├── backend/
│ ├── main.py # FastAPI app + CORS
│ ├── routes/version_1.py # All API route handlers
│ ├── claude_interpreter.py # Claude API calls (only file that calls Claude)
│ ├── processor/
│ │ ├── runner.py # TRIBE v2 inference — stub or remote via Modal
│ │ └── preprocessor.py # FFmpeg media normalization
│ ├── data/region_labels.json # Brain region metadata
│ └── requirements.txt
└── modal_deploy/
├── tribe_endpoint.py # Modal L4 GPU endpoint for TRIBE v2
├── requirements.txt # modal + fastapi (local CLI only)
└── SETUP.md # Full deployment runbook
| Layer | Stack |
|---|---|
| Frontend | React 19 + TypeScript + Tailwind CSS + Three.js |
| Backend | Python 3.11 + FastAPI + Uvicorn |
| AI | Claude (claude-sonnet-4-6) via Anthropic SDK |
| Inference | Meta TRIBE v2 on Modal L4 GPU |
| Visualization | Three.js BufferGeometry, 20484-vertex brain mesh (fsaverage5) |
Full specifications live in /docs/. Read the relevant doc before touching any feature.
| Doc | When to read |
|---|---|
docs/01-architecture.md |
Starting anything |
docs/02-design-system.md |
Touching any UI |
docs/03-component-contracts.md |
Implementing a component |
docs/04-backend-contracts.md |
Implementing a Python module |
docs/05-api-schema.md |
Wiring frontend ↔ backend |
docs/06-feature-build-guide.md |
Building a feature end-to-end |
docs/07-claude-patterns.md |
Writing claude_interpreter.py |