SPIRA / web /README.md
thefinalboss's picture
SPIRA v2: entropy-patch tokenization + hierarchical dopamine-gated spiking cortex + hippocampal one-shot memory with replay consolidation
032a961 verified
|
Raw History Blame Contribute Delete
1.57 kB

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

npm install        # or: bun install
npm run dev        # http://localhost:3000

Build for production: npm run build && npm start.

Regenerating the deploy artifact

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.