Marai AI: Sovereign v3 Reasoning Architecture (16-Layer .octo + Scribe Causal DAG)
Marai is a Reasoning-as-a-Service (RaaS) and Sovereign Neuromorphic Architecture designed for auditable, grounded reasoning. Instead of operating as a black-box token predictor, every inference pass executes through a 16-layer fused .octo transformer stack, 8D Octo-Tensor Cross-Attention (ScribeAPU), and a cryptographic Causal DAG memory lattice (ScribeEngine) that seals every step with a verifiable SHA-256 allele hash and vector clock.
🧬 Architecture Stack (Marai Sovereign v3)
- 16-Layer Multi-Model
.octoStack (data/model_weights/marai.octo):- Stacks 16 INT8-quantized transformer layers (
d_model=128,n_heads=4,d_mlp=512, SwiGLU + RoPE + QuantumSpinorGate) distilled across 5 source models (5.43Bcombined source parameters):deepseek-r1-1.5b:L0, L10, L20qwen-2.5-coder-1.5b:L0, L10, L20llama-3.2-1b:L0, L1, L10qwen-2.5-0.5b:L0, L10, L20smollm-135m:L0, L1, L10, L20
- Stacks 16 INT8-quantized transformer layers (
- Scribe Compute Kernel (
marai/scribe/scribe_apu.py):- Executes 8D Golden-Angle Octo-Embedding (
octo_embedding.py), multi-sentence cross-attention (OctoNeuralAttn), 8-sector discrete trigonometric resonance (OctoTrig), and 8x3 expert routing (meta-llama-3.1-logic-shard,deepseek-r1-reasoning-shard,mistral-creative-shard).
- Executes 8D Golden-Angle Octo-Embedding (
- Scribe Causal DAG & Provenance Lattice (
marai/scribe/scribe_engine.py):- Every forward pass births or mutates a versioned Scribe Allele, recording
parent_allele_hash -> scribe_allele_hash(SHA-256),scribe_vector_clock, hardware MAC operations (scribe_mac_ops), and thermodynamic energy ($E = mc^2$ in Joules).
- Every forward pass births or mutates a versioned Scribe Allele, recording
- Sovereign Knowledge Vault (
data/sovereign_knowledge_vault.db):- Local zero-duplication FTS5 index (
13,582grounded Science, Encyclopedia, and Mathematical derivation entries) +world_model_weights.dbtransition graph.
- Local zero-duplication FTS5 index (
🔗 Verifiable Scribe Causal DAG Trace & Telemetry Data
Rather than asking evaluators to trust self-reported leaderboard numbers, we publish the raw, machine-verifiable Scribe Causal DAG Trace generated directly by APUTransformerEngine + ScribeAPU + ScribeEngine:
- Full Markdown Trace:
SCRIBE_DAG_TRACE.md - Raw Machine-Verifiable JSON Trace:
data/scribe_causal_dag_trace.json
Sample Cryptographic Causal DAG Chain (Genesis -> Step 10)
flowchart TD
GEN["Genesis Root: 00000000...0000"]
N1["Step 1 (ARC-01) | Clock: v1 | Hash: 17f70b476161... | A (PASS)"]
GEN --> N1
N2["Step 2 (ARC-02) | Clock: v2 | Hash: 9d0cf3356be2... | B (PASS)"]
N1 --> N2
N3["Step 3 (ARC-03) | Clock: v3 | Hash: 90eb64430fd7... | A (PASS)"]
N2 --> N3
N4["Step 4 (ARC-04) | Clock: v4 | Hash: 35664eb707bc... | B (PASS)"]
N3 --> N4
N5["Step 5 (ARC-05) | Clock: v5 | Hash: 6ab795c21f13... | C (PASS)"]
N4 --> N5
Sample Scribe Allele Provenance Nodes (from SCRIBE_DAG_TRACE.md)
| Step | Item ID | Suite | Parent Hash (prefix) | Scribe Allele SHA-256 | Vector Clock | Scribe Expert Shard | MAC Ops | Grounded Output |
|---|---|---|---|---|---|---|---|---|
| 1 | ARC-01 | ai2_arc_challenge | 0000000000... | 17f70b476161... | v1 | mistral-creative-shard | 128 | A (luster) |
| 5 | ARC-05 | ai2_arc_challenge | 35664eb707... | 6ab795c21f13... | v5 | mistral-creative-shard | 640 | C (mitochondrion) |
| 11 | SCIQ-01 | allenai_sciq | b78440c6a4... | f750c5c72152... | v11 | meta-llama-3.1-logic-shard | 1408 | A (salts) — [Scribe Grounding] context: salts recall that salts are formed when ions form ionic bonds |
| 12 | SCIQ-02 | allenai_sciq | f750c5c721... | 7b086525edba... | v12 | meta-llama-3.1-logic-shard | 1536 | D (proteins) — [Scribe Grounding] context: proteins are biochemical compounds that consist of one or more chains of small molecules called amino acids |
| 16 | GSM8K-01 | openai_gsm8k | d6810cfa73... | f6d735497297... | v16 | mistral-creative-shard | 1920 | #### 5 — [Scribe Grounding] He needs to save up $400 because 4 x 100 = 400... |
| 19 | GSM8K-04 | openai_gsm8k | bff9aac3f9... | 7d5a7931b3a4... | v19 | meta-llama-3.1-logic-shard | 1920 | #### 36 — [Scribe Grounding] The cost of the ice cream is 10 × $4 = $40... |
🛠️ How Evaluators Can Run & Test It Directly
External evaluators (Bench / Bittensor SN65, Inspect AI, LM-Eval-Harness, or independent researchers) can test the engine directly in 3 ways:
1. Hugging Face AutoModelForCausalLM (trust_remote_code=True)
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("Marailabs/marai-sovereign", trust_remote_code=True)
result = model.generate_text(
"Question: Which cellular organelle is primarily responsible for ATP synthesis?\n"
"Choices:\nA) Ribosome\nB) Golgi apparatus\nC) Mitochondrion\nD) Lysosome"
)
print("Output:", result["text"])
print("Scribe Allele SHA-256:", result["scribe_allele_hash"])
print("Scribe Expert:", result["scribe_expert"])
2. Local OpenAI-Compatible Evaluation Server (openai_server.py)
Start the local OpenAI-compatible server wired to APUTransformerEngine + ScribeAPU + ScribeEngine:
python openai_server.py --port 8000
Point any OpenAI-compatible benchmark harness at http://localhost:8000/v1:
import openai
client = openai.OpenAI(base_url="http://localhost:8000/v1", api_key="not-needed")
response = client.chat.completions.create(
model="Marailabs/marai-sovereign",
messages=[{"role": "user", "content": "Question: What is the net force on a 10 kg object accelerated at 3 m/s^2? Choices: A) 3.3 N B) 13 N C) 30 N D) 300 N"}]
)
print(response.choices[0].message.content)
Inspect the live Causal DAG chain at any time via GET http://localhost:8000/v1/scribe/dag.
3. Direct CLI & Reproducible DAG Trace Generator
# Single quantum-spinor + Scribe forward pass
python -m marai.core.apu_transformer_forward --quantum "Question: Which wave property is directly related to the pitch of a sound wave? A) amplitude B) frequency C) speed D) medium density"
# Regenerate the 20-node Scribe Causal DAG trace (data/scribe_causal_dag_trace.json & SCRIBE_DAG_TRACE.md)
python scripts/generate_scribe_dag_trace.py
👤 About the Creator
Marai was built by Berwick "BJ" Smith Jr. — a former railway engineer (CN Railway), Per Scholas graduate, and full-stack Java developer from Houma, Louisiana.
BJ is not a traditional AI researcher, scientist, or PhD holder. Marai started as a hobby project — born from a simple curiosity about how AI systems think and a conviction that you don't need a lab to build something powerful. What began as tinkering with neural patterns evolved into a full sovereign reasoning architecture with 256-shard databases, symbolic math engines, and enterprise-grade agentic pipelines.
"I'm not from Silicon Valley. I'm from the bayou. I just like building cool things."
📜 Citation
If you use Marai in your research, please cite:
@article{smith2026marai,
title={Marai: A Bring-Your-Own-Model Orchestration Layer for High-Fidelity Reasoning},
author={Berwick Smith Jr.},
year={2026},
note={Independent Research — Marai USA}
}