A background Mac app and a local AI server, cooperating over one loopback port. Two models, two jobs, zero data leaving the machine. Here's the whole shape on one page.
Swift + SwiftUI/AppKit appPython FastAPI serveron-device Ā· no cloudloopback :8765
01
The two-process map
The thing you see (the š§ menu-bar icon) is a lightweight app. The brains live in a separate, always-on server. The app never holds a model ā it just sends text and draws the answer. Keeping them apart means the app can rebuild or crash without ever reloading a multi-gigabyte model.
Appš§ Menu-bar agentbackground
CaptureāB hotkey ā grabs your highlighted text (via a silent copy)
Guardsskip secrets, blanks, and overlapping scans
Overlaythe floating verdict card + mini brain
MenuDeep-scan Ā· Capture Region Ā· Pause Ā· Quit
POST /classifyāāāā¶āāāāverdict JSON
POST /brainmapāāāā¶āāāābrain profile
ServerLocal AI servicelaunchd Ā· 24/7
DetectorLlama-3.2-3B (4-bit) ā names the tactic + confidence
TRIBE v2Meta fMRI model ā predicts the cortical response
Baseline"normal" brain reference to compare against
Atlasgroups the response into readable brain systems
Two OS processes Ā· one JSON conversation over 127.0.0.1 Ā· nothing else on the network
02
What happens when you use it
Two paths. The fast one runs on every āB. The slow one is opt-in from the menu, because rendering a brain map is heavy.
āBDetect ā the everyday path~0.6s
1Highlight text, press āBā¶2Gate: manipulation at all?ā¶3if no ā "no manipulation ā"ā¶4if yes ā name the tacticā¶5Card pops up with confidence
š§ Deep-scan ā where it lands in cortex~15sā2min
1Pick Deep-scan from menuā¶2Send to /brainmapā¶3TRIBE predicts cortexā¶4Compare vs normalā¶5Brain systems light up on the card
03
Two models, two jobs
The core design decision: the detector is the judge, the brain model is the illustrator. They're never swapped ā proven by experiment that the text model detects better, and the brain model can only show, not decide.
The Detector
Judge Ā· always resident
Model
Llama-3.2-3B Instruct (4-bit)
Job
Names the persuasion tactic + a real confidence
Size
~2 GB, stays loaded for speed
Speed
~2ā3s per verdict
Why
The better detector ā text beats the brain map
TRIBE v2
Illustrator Ā· loaded on demand
Model
Meta's fMRI foundation model
Job
Predicts where in cortex the words land
Size
~7 GB, loaded & freed per scan
Speed
~15s warm, ~2min cold
Why
Never a detector ā visceral picture only
The honesty rule baked into the wiring
TRIBE only sees the cortex, not deep structures like the amygdala. So the UI says "engages your value / language-evaluation cortex," never "fires your fear center." The architecture is built to never overclaim.
04
Where each piece lives
The codebase, at a glance ā what each part is responsible for.
App Ā· Swift (Sources/)
App/AppDelegate
The orchestrator ā menu bar, permissions, āB handling, the shared guard gate.
Capture/PasteboardCapture
Grabs your selection with a silent copy, then restores your clipboard.
Capture/Region Ā· OCR
Screenshot a region and read its text (the deferred path).
Hotkey/HotkeyMonitor
The global āB listener that doesn't steal the keystroke.
Classifier/RemoteClassifier
Talks to the server ā the seam between app and AI.
Overlay/OverlayController
The floating verdict card + brain glow, and its timing.
Taxonomy/Taxonomy
The tactic names + plain-English mechanisms (no anatomy).
Support/SensitiveText
Screens out passwords, keys, and card numbers before analysis.
Server Ā· Python (server/)
server.py
The FastAPI service ā both endpoints, the scoring, the brain pipeline.
tribe_events.py
Feeds text to TRIBE without audio, and the anti-deadlock hardening.
build_baseline.py
Builds the "normal brain" reference from 30 neutral sentences.
apply_patches.py
Makes TRIBE run on Apple Silicon and kills the Google-upload leak.
experiments/
The A1āA7 research scripts that proved the whole approach.
Measured honestly, then fixed ā twice. On self-authored data it looked ~80% accurate; on 300 external, never-tuned-on examples it's 61% ā up from 38% two sprints ago. Two fixes got it there, and they target different stages. First the gate: a diagnostic (gate_diag.py) traced a recall miss to e-commerce dark patterns the gate read as plain facts (fake social-proof nudges, scarcity, countdown timers, clickbait); teaching the gate each family ā guarded so neutral stats/clocks/news stay benign ā lifted gate recall 0.56 ā 0.78 with no precision cost (PR-AUC 0.93). Then the technique label: stage-2 was collapsing everything into false-urgency, so it now routes by the primary lever ā limited supply ā FOMO, a deadline clock ā false-urgency, other people's activity ā social-proof, a reward or curiosity hook ā dopamine, a name/credential ā authority ā which took accuracy 44 ā 61% (macro-F1 0.18 ā 0.37) with the gate untouched. Confidence can be Platt-calibrated (ECE ā 0.10) but ships off so the % reads assertively ā a deliberate choice. The taxonomy spans 14 vectors in two families: broadcast persuasion + an interpersonal family (guilt-tripping, love-bombing, blame-shifting/DARVO, gaslighting) ā validated at 88% on a curated behavioral set. Two further levers on the 3B ā few-shot exemplars and a LoRA fine-tune ā both landed at the same ~62% (statistically tied): that was the small 4-bit model's ceiling, not the method's. Scaling the on-device model proved it ā 3B 62% ā 8B 69% ā 14B 79%, and the 14B with few-shot reaches 82.3% (an opt-in high-accuracy mode; the fast 3B stays the default). Self-consistency voting looked like a win but was a confound (+0 once the test labels were cleaned), and the fine-tune never beat prompting. And since manipulation is usually two techniques at once, scored as top-2 the number is ~73% on the 3B and near 90% on the 14B ā the honest question is "did we name it," not "which single label."
Litmus Ā· architecture overview Ā· detection = local Llama-3.2-3B Ā· interpretation = TRIBE v2 Ā· everything on-device, zero telemetry.
Companion to the full field manual (origins, experiments, and pivots). Repo: github.com/devansh-gr/Litmus. Updated 2026-08-07.