Graph & Training

Pure-Rust CLI & Offline Training

Fine-tune System 1 (both the SIVU quality gate and SICU 5-archetype classifier) locally on standard laptop CPUs in milliseconds using sulcus train. Zero Python virtualenvs, zero external ML scripts, and zero data leaving air-gapped environments.

Pure-Rust Wide-and-Deep MLPBGE-small-en-v1.5 (384-d)Zero Python / Zero GPUAir-Gap Ready
01 · Neural Architecture

How Pure-Rust System 1 Training Works

System 1 shares the exact 384-dimensional BGE-small-en-v1.5 embeddings already computed by Sulcus for vector search, training a dual-head Wide-and-Deep MLP with temperature calibration.
Shared Backbone

384-d BGE + Structural Features

Combines dense semantic embeddings with structural wide features (length, code/command markers, imperative directives, question density) so terse chat noise and rich architectural specs separate cleanly.

Joint Dual Heads

SIVU Gate + SICU Router

Trains both the binary store/reject head (SIVU) and the 5-class archetype head (episodic, semantic, preference, procedural, fact) in a single optimization pass.

Safety Gates

Anchor Replay & Macro-F1 Gate

Mixes compiled-in anchor examples into every run to prevent catastrophic forgetting, evaluates held-out validation splits, calibrates logit temperatures, and rejects degraded checkpoints automatically.

02 · End-to-End Workflow

Training & Promoting Weights with sulcus train

Train against signals stored in your local PostgreSQL database, pass an explicit JSONL corpus via --file, or combine both.
bashsulcus train CLI Commands
# 1. Inspect active System 1 weights, validation F1 scores, and signal counts
sulcus train status

# 2. Export accumulated local training signals to JSONL for inspection or version control
sulcus train export --output ./domain-signals.jsonl

# 3. Fine-tune System 1 (joint SIVU quality gate + SICU 5-archetype router) on CPU in pure Rust
sulcus train run --file ./domain-signals.jsonl --namespace payments-rails --epochs 40

# 4. Smoke-test your newly trained classifier directly from the terminal
sulcus train test "Reject webhook requests when Stripe-Signature timestamp drift exceeds 300s" \
  --namespace payments-rails

# 5. Optional: push validated weights to your Sulcus Cloud or Private VPC tenant
sulcus train run --file ./domain-signals.jsonl --namespace payments-rails --push
jsonJSONL Training Corpus Schema
{"text": "Always use ActiveSupport::SecurityUtils.secure_compare for HMAC digests", "quality": "store", "corrected_type": "procedural"}
{"text": "sounds good thanks!", "quality": "reject"}
{"text": "PostgreSQL 17 embedded sidecar listens on 127.0.0.1:4201 by default", "quality": "store", "corrected_type": "fact"}
{"text": "Prefer explicit timeout wrappers around every integration test suite", "quality": "store", "corrected_type": "preference"}
Flags & Rollback Controls
Pass --from-scratch to initialize fresh weights instead of warm-starting from the built-in System 1 baseline, or --override-gate during offline experimentation when testing small synthetic corpora. Promoted weights persist in PostgreSQL (system1_models) and can be reverted to the built-in baseline at any time:
bashInstant Baseline Rollback
# Revert a namespace (or tenant global model) back to the compiled-in System 1 baseline
curl -X DELETE "https://api.sulcus.ca/api/v1/siu/models?namespace=payments-rails" \
  -H "Authorization: Bearer $SULCUS_API_KEY"