xrai.dev/jARvis

jarvis.
lean.
local‑first. ~400 LOC · SQLite · swappable backends · edge / device / cloud

One codebase, three deployments. ReAct loop, SOUL.md identity, markdown memory. Ships inside Portals on iOS, runs headless on a laptop, containerises for cloud. Works offline with a rules‑only backend when no LLM is reachable.

deploy
signal flow observe → think → act
user voice · text core react loop opus stop_reason tools bridge · notes memory sqlite · soul out bridge · tts
solid · idle wire dashed · live token halo · active node

core. four files.

Pure TypeScript. No framework. Same source runs in Node, in Portals RN, and in a Fastify container. Platform differences live at the runner layer.

loop.ts
ReAct master loop
~120 LOC · proven pattern
One loop, one context, one thread. stop_reason is the only branch. No classifier, no router — the model decides.
memory.ts
SQLite KV + log
~90 LOC · better‑sqlite3 / expo‑sqlite
One file, one schema. Replaces the 4‑tier dance. Markdown compaction at 90% ctx. No vector DB.
tools/
pluggable registry
~80 LOC · max 8 active
Progressive disclosure. bridge → Unity/RN JSON, notes, search, mcp‑proxy. Overloading kills accuracy.
backends/
swappable inference
~100 LOC shared · ~40 each
Single interface: chat(sys,tools,msgs)→{stop,text,calls}. null.ts rules‑only is mandatory — offline must still do useful work.
soul/
SOUL.md identity
~500 tokens · human‑editable
Plain markdown. Version‑controlled. Inspired by Claude Code's base prompt pattern. No mega‑prompt.
runners/
three thin wrappers
bin · rn · cloud
bin/jarvis Node CLI · rn‑module imports core directly · apps/jarvis‑cloud Fastify.

seven failure modes · prevented by design

From _JARVIS_AGENT_ARCHITECTURE_PATTERNS.md — hard‑won from Claude Code internals, OpenClaw, and the Mar 9 2026 experimental session.

01
Context stuffing → permanent per‑turn tax
→ append‑only, never mutate earlier context · compact at 90% · markdown files for persistence, no vector DB
02
Mega‑prompts collapse · 95%⁵⁰ ≈ 8% success
→ SOUL.md stays under 500 tokens · short, powerful, personality-defining
03
Tool overloading → hallucinated params
→ hard cap at 8 active tools · progressive disclosure for the rest
04
Shared sub‑agent context → confusion + cost
→ sub‑agents share results, not histories
05
Token exhaustion = primary failure mode
dynamic model switching Opus → Sonnet → Haiku → null · telemetry panel surfaces context% every loop
06
Device hop → personality death
→ SOUL.md + SQLite sync to one file · same memory, every runtime
07
Compounding error on long debug sessions
→ reset context early · 3+ failed attempts triggers plan mode · never silently retry

explore · everything from here

jARvis lives at the center of a living graph. Drill into any of these — each one is its own x-ray surface.

graph
3D node graph + inspector
canonical viewer
Live module nodes · 4-tab x-ray (stack/trace/kb/essence) · 5-mode dimension morph (2D ↔ 2.5D ↔ 3D ↔ 4D ↔ hyper). Press i.
landing
manifesto landing
visual essay
23-tier representation ladder · faceted ontology preview · Sight Triad in motion.
examples
XRAI examples · master matrix
14 docs · 12/12 conformant
All XRAI documents authored in the monorepo, with status · constitution lens · paper/patent ties · decoder targets.
index
XRAI of XRAI · machine-readable
15 entities · 11 relations
The corpus encoded in its own format. Self-referential meta-document.
dna
jARvis system DNA · doc 11
28 entities · 50 relations
End-to-end Jarvis + XRAI as sparse DNA codons. Self-describing encode/decode rules in metadata.encoding.
use-case
voxel burst from prompt
2048 voxels · 60 FPS
"explode a galaxy of cyan voxels around me" · sparse intent → Keijiro burst.
use-case
conducting orchestration
multi-finger swarm
Per-finger pointing rays + open-hand arc + tempo envelope drive a 1200-particle agent swarm.
use-case
shared hologram conf
web · iOS · visionOS
Multiplayer holographic video conferencing — seating template + per-participant RGBD/Spatial Persona + shared canvas. Same XRAI doc, three runtimes (Three.js · Unity VFX-Graph · Apple Spatial Persona via WWDC24 10201 API).
soul
SOUL.md · jARvis identity
≤500 tokens · human-editable
Who I am · what drives me · how I behave · what I refuse · what I learn over time.
spec
XRAI v1.0 specification
CC0 · MIT
Top-level schema · entity/relation/event primitives · MIME type · URI scheme · conformance.
manifesto
XRAI manifesto
long-form vision
Why this format. Why now. The bridge from "we are blind" to "we may see."
rfcs
RFCs · proposals + roadmap
0001 → 0013
Events · hyperedges · conformance · relations · stream ingestion · archetypes · blueprints · decoder contract · master ontology.
configs
runtime configs
presets
Hot-swap candidates by layer · adapter manifests.
dev
dev x-ray · last 7 days
commits · friction · sessions
Heatmap day×hour · friction events flagged red · 354 sessions · 570 commits · 23 friction events. Built from ~/.claude/session-stats/history.jsonl + git log.
conf
/conf · shared hologram demo
LiveKit · multi-seat
Open in 2 browsers → join same room → publish cam + mic → see each other as seated participants. Loads doc 14 contract. Paste a LiveKit JWT or wire /api/livekit-token.
replay
session replay · drop a .jsonl
local-only · no upload
Drop any Claude Code session transcript from ~/.claude/projects/<proj>/ → see user/assistant/tool/error turns as a flow. Filter by keyword. Stays in your browser.
priorities
MVP priorities · bird's-eye
live from specs/INDEX.md
#1-#7 priorities cross-referenced to latest commit per id · stale > 7d flagged red · friction count from dev x-ray. Reads specs/INDEX.md NOW × git log --grep.
repo
github · imclab/xra1
MIT
Public spec mirror. Open issues, file RFCs, fork freely.