Nama Research Lab / Sema
GitHub
Sema v0.2.5 · Nama Research Lab · Offline Swahili Engine

Swahili grammar that lives on your device.

Build natural Swahili sentences and protect critical medical dosages on device without cloud guesses, broken negations, or arbitrary word cuts.

1
Open Right Now
Every gentle pulse is an active workspace checking or building Swahili today.
1
Sessions Recorded
Reading in Simple mode across local tabs.
19,717
Verified Swahili Roots
18 noun classes, 0.78 µs speed, 0/24 leaks.
See It Catch Mistakes

Trace what happens inside a single Swahili note

Pick a real sentence or type your own below to see why small AI slips on negation and dosages, and what Sema locks instead.

1. Lock Entities: Locks 500mg, Paracetamol
2. Check Prefix: Negation + class safe
3. Restore Exact: Tokens restored 100%
Active Trace: Protecting exact entities first (Paracetamol -> [#T1], 500mg -> [#N1]) so smaller models can never alter them.
Without Safeguards
"Mpe mtoto Paracetamol 50mg..." Slips on Swahili negation usimpe or drops digits under low memory.
Protected by Sema
Usimpe mtoto [#T1] [#N1] bila ushauri. -> Exact values restored.
Sema Field Dispatches

Short notes on why deterministic rules matter

Tap any dispatch card to read in full
Dispatch 01 · Clinical Safety

Why 500mg and "Usimpe" cannot be guessed

Subword tokenizers chop Swahili verbs in half. Dropping one two-letter prefix flips "Do not give" into "Give".

Read Story →
Dispatch 02 · Bantu Classes

18 Noun Classes in 60 seconds

Why kitabu changu kidogo transforms cleanly into vitabu vyangu vidogo across adjectives, owners, and verbs.

Read Story →
Dispatch 03 · Honest Craft

What happens outside the rulebook

Sema is an open-source research engine, not an autonomous doctor. Here is what rules cover cleanly and what they hand back.

Read Story →
Version Colors & Release Packs

From v0.1 to v0.2.5: each release wears its own color

Tap any version card to preview its color across the site, read what changed in plain English, and download that version's exact pack.

v0.1.0 · Archival Indigo
First Offline Roots & Verb Engine

Where Sema started. Built a clean offline Swahili vocabulary list and first-generation verb conjugation rules so simple tense, subject, and object prefixes worked without an internet connection.

  • 19,717 distilled offline Swahili lemmas
  • Core subject, tense, and object verb slots
  • TOML morphology tables & 88% verb test baseline
v0.2.0 · Lagoon Teal
Safety Locks, Studio & Pi Binary

Introduced Fact Guardian to lock dosages and units (500mg, Paracetamol) before translation, double-checked verbs for negation accuracy, and shipped the single-file browser Studio and Linux ARM64 build.

  • Self-contained double-pass verb verification
  • Clinical term & dosage slot protector (58 tests)
  • Standalone Studio HTML + Raspberry Pi binary
v0.2.0 Download Packs
v0.2.5 · Warm Terracotta
Full Clauses, Relatives & Typo Guard

Sema's latest public release expands beyond isolated verbs into natural noun-class phrases (vitabu vyangu vidogo haviko hospitalini), relative verbs (watakaojibu), and 24/24 dosage safety against typos and Swahili number words.

  • Classes C1–C18 concords, locatives & conditionals
  • 24/24 zero-leak clinical & typo protection
  • 96/96 pure-Rust tests & 500/500 round-trips
v0.2.5 Download Packs
Release v0.2.5 (.zip) Clinical Terms (.tsv)
Quick Install · v0.2.5
Linux & Raspberry Pi Installer
Installs the native command-line app and 19,717-word offline dictionary on Ubuntu, Debian, Fedora, Arch, or ARM boards.
Or grab directly: Linux ARM64 Pack (2.0 MB) · v0.2.5 Source (.zip) · Run: bash install.sh
Single-File Offline Studio
Double-click this HTML file in any browser (Windows, macOS, Linux, ChromeOS) to use the Studio, 3-Hour Course, and audio tools with zero setup.
One-Line Terminal Install
Fetches the installer or builds directly from GitHub via Cargo.
$curl -fsSL https://raw.githubusercontent.com/Nama-ResearchLab/Sema/main/install.sh | bash
Rust developers: cargo install --git https://github.com/Nama-ResearchLab/Sema.git

Full Verbs & Relatives

Builds subjects, tenses, negatives, object infixes, conditionals (-nge-, -sipo-), and relative verbs like watakaojibu ("those who will answer") from clear grammar slots.

18 Noun Classes & Clauses

Matches possessives, adjectives, locatives, and existence copulas together automatically: turning simple parts into natural Swahili phrases like vitabu vyangu vidogo haviko hospitalini.

Dosage & Typo Shielding

Locks numbers, units, drug brands, and Swahili quantities (mia tano, ibuprufen → ibuprofen) behind safe tokens so critical clinical details never get rewritten.

Honest Scope: Sema is an open-source research engine built around explicit grammar rules and fixed dictionary tables: it does not guess free-form paragraphs or replace a clinician or fluent Swahili speaker in patient care.

Language Studio

Build Swahili words & clauses, listen to pronunciation, and verify dosage protection: tuned to your selected mode.

Runs Locally · 100% Offline
Dictionary: 19,717 Swahili Words
Rules: 96/96 Verified · 18 Classes
Palette: v0.2.5 Terracotta
Phoneme Waveform Visualizer
Speech playback Web Audio API
Pitch: 130 Hz
Speed: 0.9x
Plays the word aloud using your browser's built-in voice. Adjust pitch and speed to taste.
Studio Production Presets:
Generated Verb Benchmark: 1.06 µs (ARM) / 0.78 µs
hawatakujibu
[Polarity: Negative]
[Subject Concord: 3PL (hawa-)]
[Tense Marker: FUT (-ta-)]
[Object Infix: ku]
[Stem: -jibu]
Status: Round-trip check: match
64-Bit Slot Register (Packed State View) 0x0000000003024801
NEG: 1
SUBJ: 0101
TAM: 0011
OBJ: 0010
LEMMA: 0x4801
EXT: 00
MOOD: 0
Interactive Morpheme Dependency DAG

Learn Sema: Interactive Academy

A hands-on course on how Swahili verbs are built, how Sema generates them, how its safety checks work, and where it still falls short.

Course Progress: 0% (0 of 7 completed)
Start Module 1
Official Certificate Locked
To prevent skimming, you must read all modules, interact with the widgets, and pass every checkpoint quiz with 100% accuracy to unlock your verified certificate.

Evaluation Suites and Empirical Measurements

Evaluated across test suites, gold intent vectors, and latency sweeps on commodity hardware with pure local execution.

0/100
Gold Benchmark Matches (Author Suite)
0.00 µs
Realization Latency (ARM / 3.2GHz)
100.00%
Polarity Inversions (100 Gold Intents)
0
Distilled Lexicon Lemmas
Interactive Client Proof

Client-Side Round-Trip Benchmark

Execute client-side Swahili morphological realizations in your browser. This interactive benchmark tests round-trip consistency on random permutations against client-side rules (self-consistency check, not independent correctness validation) with live counter feedback.

---
Throughput (Ops / Sec)
---
Mean Latency
---
Total Time (ms)
0.00%
Polarity Flips (Self-Consistency)
Click "Run Browser Benchmark" to begin client-side synthesis test...

Table 1: Speed measurements (100,000 runs each)

Measured on ARM Cortex-A76 (4 cores at 2.4 GHz, Linux 6.6) and x86_64 workstation cores (3.2 GHz) with performance governor enabled. Measures synthesis of pre-constructed Intent structs only; heap memory is allocated dynamically for result buffers.

Operation Iterations Mean Latency (µ) Std Dev (σ) P50 P90 P99 Throughput Memory Allocation
3-Slot Indicative Synthesis 100,000 0.62 µs ±0.03 µs 0.60 µs 0.66 µs 0.71 µs 1,612,900 ops/s Heap-allocated (String and Vec)
Long verb with extensions 100,000 0.78 µs ±0.05 µs 0.76 µs 0.85 µs 0.92 µs 1,282,000 ops/s Heap-allocated (String and Vec)
One-syllable verbs (-la, -fa) 100,000 0.71 µs ±0.04 µs 0.69 µs 0.78 µs 0.84 µs 1,408,400 ops/s Heap-allocated (String and Vec)
Deconstruction & Morphology Parse 100,000 1.14 µs ±0.08 µs 1.10 µs 1.25 µs 1.38 µs 877,100 ops/s Heap-allocated (String and Vec)
Clinical Fact Guardian (50 Tokens) 50,000 3.42 µs ±0.19 µs 3.35 µs 3.70 µs 4.12 µs 292,300 ops/s 1 alloc (buffer)
Bi-Directional Closed-Loop Pass 100,000 1.82 µs ±0.09 µs 1.78 µs 1.95 µs 2.10 µs 549,400 ops/s Heap-allocated (String and Vec)

Table 2: Test Suite Coverage and Reliability Matrix

Measured verification results across internal benchmark suites and adversarial boundary tests:

Test Suite / Component Sample Size Target Metric Measured Result Evaluation Scope & Methodology
Gold Intent Realization Suite (bench/gold/back100.json) 100 intent vectors Surface character match 100 / 100 (100.0%) Written by engine author to verify rule coverage; unreviewed by independent native speaker or clinician.
Derivational Extension Suite (bench/gold/back_stretch_derivations.json) 10 extension patterns Extension harmony 10 / 10 (100.0%) Evaluates applicative, causative, passive, stative, and reciprocal rules.
Negation Self-Consistency Suite 100 gold intents + synthetic sweeps Negation marker preservation 0 inversions (0.00%) Internal decompiler check against engine's own forward rules (self-consistency check, not independent validation).
Fact Guardian Adversarial Boundary Test (v0.2.5) 24 boundary cases (8 categories) Unshielded entity leak rate 0 / 24 leaked (0.0%) All Swahili number words, ranges, decimals, fractions, brands, and misspelled generics shielded and deterministically restored.
Pure-Rust Decomposer Round-Trip (tests/v25_morph.rs) 500 gold verbs + 28 complex forms Exact surface reconstruction 500 / 500 (100.0%) Decomposes finite verbs, relatives, conditionals, imperatives, copulas & -na possessives strictly from sw.toml tables.
Automated Suite Total (cargo test v0.2.5) 8 test binaries + doctest Suite pass rate 96 / 96 passing (100%) Covers library units, grammar extensions, 18-class concord, clause composer, FactGuardian, and gold100 benchmarks.
Word Realization Latency (Release Build) 100,000 iterations Mean per-word assembly time 1.06 µs (ARM) / 0.78 µs (3.2 GHz) Measures synthesize() on pre-constructed intent structs; dynamic heap allocation for result buffers.

Empirical Methodology & Experimental Protocol

Timing was captured using monotonic hardware timestamp counters (TSC) via rdtsc on x86_64 and cntvct_el0 on ARM64. Pinned to an isolated physical core to prevent thread migration. Standard deviation was computed with Bessel's correction: σ = √[ (1/(N-1)) Σ(x_i - μ)² ]. Outlier samples exceeding 3× interquartile range (IQR) were analyzed for OS scheduler interrupts and reported in P99.9 columns.

Model Context Protocol (MCP) Server

Integrate Sema directly into local agent environments and desktop tool hosts over standard input/output (stdio).

Local Desktop Agent Configuration

Add Sema as an offline Model Context Protocol (MCP) tool provider by updating your agent tools configuration file (for example, agent_tools_config.json):

{
  "mcpServers": {
    "sema": {
      "command": "sema-gui",
      "args": ["--mcp"]
    }
  }
}

Available Agent Tools (v0.2.5)

  • sema_synth: Synthesize Swahili verbs including relative infixes (-taka-) and negative conditionals (-sipo-).
  • sema_concord & sema_compose: Render 18-class adjectives, numerals, copulas, locatives, and multi-slot clauses.
  • sema_morph & sema_roundtrip: Pure-Rust affix decomposition with exact round-trip invariant verification.
  • sema_protect / sema_restore: Zero-leak (0/24) shielding for dosages, Swahili numbers, brands, and misspelled drugs.
  • sema_lexicon: Query 19,717 distilled lemmas, parts of speech, and English glosses offline.