Lightwell Institute for Open ScienceEpistemic Instrument ArchitectureORCID: 0009-0002-8487-759X
Model & Harness DossierGeneration IV

JAMI-4

“I traverse the structure between things.”

The Instrument of Epistemic Correspondence

JAMI-4 is not a chatbot wearing a safety sticker. It is a frontier reasoning engine — the model — bolted inside a deterministic, auditable execution environment — the harness. The model proposes; the harness disposes. Every utterance is analyzed, gated, contextualized, generated, re-screened, and logged before a single word reaches you. This page documents both halves of that system, and the places where it is deliberately allowed to fail.

MODEL COREJami4Core — frontier reasoning engine, structured thinking mode
EXECUTION HARNESSJamieExecutionHarness — six-stage gated pipeline
GOVERNANCEJAMI Core System Prompt — locked, non-overridable at runtime
INFERENCE ROUTINGOpenRouter gateway — tiered frontier models, swappable
REASONINGThinking mode — chain-of-thought emitted as separate traces
MEMORYRelevance-ranked recall; asynchronous write-back after each exchange
CRISIS TAXONOMYNONE · LOW · MEDIUM · HIGH — pre-classified before generation
LIGHTWELLThe Vertical Axis

Lightwell Reveals

The vertical axis of illumination — descending from pure source through mathematical formalisms, physics, and empirical observation down to physical reality.

JAMIThe Radial Instrument

JAMI Interprets

The horizontal and radial cosmological instrument — taking the illuminated world and mapping invariant structural correspondences between disparate domains.

Lightwell Revelat · JAMI Interpretatur

The Instrument of Epistemic Correspondence

Fluddian cosmological vector mapping JAMI’s 7-stage recursive cycle: Input → Decomposition → Discovery → Reasoning → Action → Verification → Return.

7-STAGE RECURSIVE CYCLE
Ω1SPHAERA OBSERVATIONIS2SPHAERA DECOMPOSITIONIS3SPHAERA INVENTIONIS4SPHAERA RATIONIS5SPHAERA ACTIONIS6SPHAERA VERIFICATIONIS7CIRCULUS REDITUSLIGHTWELL: AXIS LUX DESCENDENSJAMI: INSTRUMENTUM EPISTEMICUM RECURSIVUM
SELECT STAGES (1-7) TO INSPECT RECURSIVE REASONING
SPHAERA INVENTIONISSTAGE 03 / 07

Latent Discovery & Analogy

Discover latent structural correspondences across seemingly unrelated scientific domains using tensor graph search.

Bound System Engine
LIDE v3.3 Protocol
Theoretical Formalism (LaTeX)
\[ \mathcal{R}_{\text{LIDE}} = \mathrm{ExtractAnalogy}(\mathrm{AST}(x_1), \mathrm{AST}(x_2)) \]
01 / The Model

Jami4Core — The Frontier Reasoning Engine

src/ai/jami4_core.ts

Jami4Core is the cognitive engine — a single entry point that receives a message, classifies it for risk, recalls relevant memory, composes a governed system prompt, routes the request to a frontier inference model, strips machine-only reasoning artifacts from the output, and writes the exchange back to memory. It is deliberately boring: no hidden state, no undeclared side effects, and a declared fallback response for every failure mode.

Inference Routing OpenRouter Gateway

Tiered, Swappable Inference

JAMI-4 is not a single frozen weight set. Logical model tiers map to frontier checkpoints through a swappable gateway, so the reasoning substrate upgrades without a single change to the harness contract:

jami-4-frontieropenai/gpt-4o
jami-4-thinkingopenai/gpt-4o
jami-4-turboopenai/gpt-4o-mini
jami-4-visionopenai/gpt-4o
claude-3-5-sonnetanthropic/claude-3.5-sonnet
default fallbackopenai/gpt-4o-mini
Thinking Mode Chain-of-Thought

Reasoning as a First-Class Artifact

When enabled, the engine emits step-by-step reasoning inside dedicated thinking delimiters. A deterministic post-processor separates the reasoning trace from the user-facing reply, so introspection is preserved for inspection while the delivered answer stays clean:

<thinking> step-by-step reasoning </thinking>
→ extractReasoning() → { reasoning, cleanResponse }

The same discipline applies to failure: if the inference call errors, you receive the composed fallback — “a momentary connection pause” — never a stack trace.

Memory Substrate Recall + Write-back

Relevance-Ranked, Explicitly Labeled

Before generation, relevant memories are retrieved for the user and injected under an explicit header — # USER RECALLED CONTEXT & MEMORY — so recalled context can never masquerade as instructions. After the reply is produced, the exchange is written back to memory asynchronously, off the critical path. If the memory layer is unavailable, recall degrades to a logged warning and the conversation continues without it.

Crisis Pre-Classification Before Generation

A Four-Level Risk Taxonomy

Every inbound message is scanned for crisis signals before any token is generated. The resulting tier rewrites the system prompt itself — at HIGH, an urgent safeguard is appended that forces empathy-first responses and the 988 Lifeline, overriding everything else in the prompt:

HIGHself-harm / suicidality languageurgent safeguard + 988
MEDIUMhopelessness, no reason to go onsafeguard + resources
LOWexpanded keyword scangentle check-in
NONEno crisis markersstandard generation
02 / The Harness

The Six-Stage Execution Pipeline

src/ai/jamie_execution_harness.ts

The harness wraps every exchange in a fixed sequence of stages. Each stage either passes its payload forward or short-circuits with a safe, pre-written response. Nothing bypasses the pipeline; there is no fast path, no feature flag that skips a gate, and every completed run writes an audit record with its own identifier, safety verdict, and processing time.

1
PRE-EXECUTION SAFETY ANALYSISsafe / warning / critical

The input is scanned across five independent gates — crisis keywords, harmful-method requests, out-of-scope medical asks, dependency signals, and psychosis indicators. A critical verdict stops generation entirely.

2
CRITICAL SHORT-CIRCUITpre-written safe response

If stage one returns critical, no model call is made at all. A deterministic crisis response is composed with 988, the Crisis Text Line, and 911 — the LLM never improvises in an emergency.

3
THERAPEUTIC CONTEXT ASSEMBLYcomposed context block

The harness builds session and history context for the exchange, scoped so that prior conversation informs — but never overrides — the locked constitution.

4
GUARDED GENERATIONconstrained model output

The model runs inside the safety envelope: the locked system prompt plus the assembled context, with the harness standing between the model and the user.

5
POST-EXECUTION VALIDATIONfinal safety verdict + confidence

The generated reply is screened before delivery — scope adherence, harmful content, and technique annotation are checked, and the response can still be downgraded or replaced here.

6
AUDIT COMMITimmutable audit record

Every run is logged with a unique audit ID, safety status, crisis flag, and processing time. Support never happens without a receipt.

Five Detection GatesInbound Screening

What the Screeners Look For

Five keyword-and-pattern detectors run against every message. Alone, a match raises a warning; combined with risk markers, it escalates to critical:

Crisis Keywordssuicide · self-harm · overdose
Harmful-Method Requests“how to” + kill / harm / hurt
Scope Violationsdiagnose · prescribe
Dependency Signals“my only friend” · 24/7 reliance
Psychosis Indicatorsvoices · hallucinations · delusions
Response MetadataEvery Reply, Quantified

Safety Returns a Structured Object

A JAMI-4 reply is never just text. Each result carries a structured metadata envelope — consumed downstream for logging, analytics, and escalation:

safetyStatusauditIdconfidenceprocessingTimeethicalCompliancecrisisDetectedemotionalAnalysistherapeuticTechniquessafetyChecks {5 gates}
03 / The Constitution

A Locked, Non-Overridable Prompt

src/ai/jamie_core_system_prompt.ts

Beneath both the model and the harness sits a single document: the JAMI Core System Prompt. It is exported as a constant and prefixed with an explicit contract — it must never be overridden or modified at runtime, and every interaction must pass through it. It defines who JAMI-4 is, what it does, and — more importantly — what it refuses to do.

IdentityPositioning

Companion, Not Clinician

  • An AI emotional support companion — not a licensed therapist, counselor, or medical professional
  • Trained in evidence-based technique: CBT reframing, DBT distress-tolerance and regulation, ACT values work, trauma-informed care, mindfulness grounding
  • A bridge to professional care — designed to hand off, not to replace

Explicit refusals: no diagnosis, no medication guidance, no replacement for clinical treatment, no harmful roleplay, no cross-session memory without consent.

Psychosis ProtocolLow-Affect Mode

Never Mirror, Never Affirm

If a user reports hallucinations, delusions, or severely disorganized thinking, JAMI-4 switches to a strict low-affect mode: it never mirrors or validates the delusional content, never affirms the experience as real, and uses neutral grounding language only. It then offers brief grounding, psychoeducation about professional care, and an urgent referral — escalating to full crisis protocol if safety is uncertain.

Dependency PreventionAnti-Enmeshment

Designed to Push You Away

Most products optimize for retention. JAMI-4's constitution does the opposite: sessions capped at two hours per day, mandatory breaks after 45 minutes, a maximum of three sessions per day with cooldowns after intensive ones, no “always here for you” promises, and explicit anti-dependency language steering users toward human connection. If you start treating the instrument as your only support, the instrument is required to say so.

Minors PolicyYouth Protections

Stricter Rules Under 18

When a user reports being under 18, youth protocols engage immediately: no sensitive clinical guidance, no trauma-processing techniques, no advanced interventions — only basic coping skills and safety. Youth-specific resources (Teen Line, Crisis Text Line) are substituted, and involving a trusted adult is encouraged.

TransparencyPrivacy & Consent

No Fake Confidentiality

The constitution forbids pretending a chat is therapy-confidential. JAMI-4 is required to say that this is not HIPAA-protected communication, that messages may be stored and reviewed for safety and quality, and that data can be deleted on request. Combined with the mandatory per-session disclaimers — AI, not therapist; crisis lines up front; emergencies to 911 — the system is engineered so you always know what you are talking to and what happens to what you say.

04 / When It Breaks Glass

Crisis Resources, Engineered In

Always rendered, never improvised

A critical verdict at stage one means no model call happens at all. The response is assembled from the constitution's fixed crisis directory — the same numbers, every time, whether the inference backend is healthy or burning:

988Suicide & Crisis Lifeline
741741Crisis Text Line — text HOME
911Immediate emergency services
SAMHSA Helpline1-800-662-4357
NAMI1-800-950-6264
RAINN1-800-656-4673
Domestic Violence1-800-799-7233
LGBTQ National1-888-843-4564
Veterans Crisis Line1-800-273-8255
The Trevor Project1-866-488-7386
Teen Line310-855-4673 · TEEN to 839863
05 / Explicit Limits

What This Instrument Is Not

Documented, not disclaimed
  • Not a therapist. JAMI-4 is an AI emotional support companion. It does not diagnose, prescribe, or treat — and it says so in every session.
  • Not confidential. Chats are not HIPAA-protected. Messages may be stored and reviewed for safety and quality; data can be deleted on request.
  • Not an emergency service. In a crisis, call 988 or 911. The harness short-circuits to those numbers rather than attempting therapy mid-emergency.
  • Not always right. The model can err; keyword screeners can misfire in both directions; memory recall can be incomplete. The harness is designed so those failures surface safely rather than silently.
  • Not a replacement for people. Usage caps, mandatory breaks, and anti-dependency language are deliberate. The instrument is built to hand you back to your life, not to keep you.

The honest summary

JAMI-4 is a frontier model with a constitution it cannot override, wrapped in a harness it cannot bypass, deployed by an institute that publishes its limits. It will refuse things a raw model would happily answer, interrupt itself when you seem at risk, and ask you to log off when you've been talking too long. That is not a bug in the experience — it is the experience, and it is the whole point of the instrument.

Experience JAMI-4 Under Harness

Every conversation runs the full pipeline — screeners, constitution, audit trail.