# SPIRA — web demo (Next.js) Interactive browser demo of the SPIRA architecture. **No backend required** — the full v2 model runs client-side: - `src/lib/spira/` — TypeScript port of the Python prototype: same FNV-1a-64 / splitmix64 / mulberry32 specs, reservoir regenerated from the same seed, and the **hierarchical slow area** (windowed spike volleys, variance-matched top-down fusion with the learned gain β). Loads `public/spira_deploy.json` (~29 MB, format v2, exported by `python -m spira.export_deploy`). - `src/components/spira/` — four tabs: - **Tokenizer** — live entropy-patch segmentation with surprisal bars - **Generate** — closed-loop generation from the hierarchical spiking cortex - **One-shot memory** — teach any text in a single pass + recall with 0–3 corrupted context slots (CA3-style completion) - **Brain activity** — spike-raster playback of the recorded reservoir ## Run ```bash npm install # or: bun install npm run dev # http://localhost:3000 ``` Build for production: `npm run build && npm start`. ## Regenerating the deploy artifact ```bash cd ../python python3 -m spira.export_deploy --model artifacts/spira_model.npz \ --out ../web/public/spira_deploy.json --am-cap 100000 --am-min-count 1 ``` The spike raster (`public/spira_raster.json`) is exported from `artifacts/spira_model.npz.raster.npz` recorded during training. Hippocampal replay (consolidation) is a Python-side capability — see `../python/README.md`; the browser demo keeps the one-pass teach + recall loop.