Skip to content
Engineering Deep Dive

How Fahan Was Built

Most translation apps wrap a single API in a simple interface. Fahan orchestrates six specialized AI systems into a single, real-time voice pipeline — engineered from scratch for a language the tech industry forgot.

6-Layer Pipeline
Sub-Second Latency
Quality Validated
Intelligent Cache

Why Existing Tools Fail Somali Speakers

When we started building Fahan, we tested every major translation platform with Somali audio. The results were disastrous. Speech recognition engines consistently misidentified Somali as Arabic. Translation models hallucinated words that didn't exist. Text-to-speech output sounded nothing like a native Somali speaker. The entire industry had been built around high-resource languages — English, Spanish, Mandarin — and Somali wasn't even an afterthought. It was invisible.

Misclassification

Speech engines classified Somali audio as Arabic in over 60% of test cases

Hallucination

Translation models invented words and phrases that don't exist in Somali

Robotic Output

Voice synthesis sounded mechanical and unrecognizable to native speakers

Fatal Latency

Processing delays of 8-15 seconds destroyed any sense of natural conversation

Six Systems, One Voice

Every conversation turn in Fahan passes through a six-layer pipeline. Each layer is a specialized system, purpose-built for its role. Here's what happens in the milliseconds between when you speak and when the other person hears the translation.

01

Authentication & Session Guard

Before any audio processing begins, Fahan validates the device, checks subscription status, and retrieves or creates a conversation session. The session remembers which languages are active, what direction translation is flowing, and whether real speech has been detected. This isn't security theater — it's a stateful conversation manager that prevents ghost sessions and ensures every turn knows its context.

Device fingerprinting Subscription enforcement Session state hydration
02

Speech Recognition & Transcription

Raw audio is fed into a neural speech recognition system specifically tuned for Somali phonetics. This isn't the same engine used for English — Somali has unique vowel harmonies, retroflex consonants, and tonal patterns that generic models butcher. The transcription engine also handles code-switching, where a Somali speaker drops English words mid-sentence — something that happens constantly in diaspora speech and that most systems choke on.

Somali-tuned ASR Code-switch handling Noise label stripping
03

Dual-Rail Language Detection

This is where Fahan diverges from every competitor. Instead of assuming a fixed translation direction, Fahan detects WHICH language is being spoken on every single utterance and dynamically routes the translation. If a Somali speaker talks, it translates to English. If the English speaker responds, it flips. This dual-rail system means two people can have a natural back-and-forth conversation without ever touching a button or switching a mode.

Per-utterance detection Binary classifier Automatic direction routing
04

Contextual Translation

The transcribed text is translated by a model selected specifically for the detected language pair. But translation alone isn't enough — Fahan runs every output through a quality validation pipeline. Empty results are caught. Repetitive garbage patterns are detected and rejected. A quality score is calculated for every translation. If a translation fails validation, the system gracefully falls back to echoing the original text rather than serving garbage to the user.

Quality scoring (0–0.95) Repetition detection Graceful fallback
05

Dual-Engine Voice Synthesis

The translated text needs to be spoken aloud — but not by a generic robot voice. Fahan routes to different voice synthesis engines depending on the target language. Somali output goes to a specialized engine trained on natural Somali speech cadences. All other languages route to a separate high-fidelity engine. The result sounds like a real person speaking, not a machine reading text.

Language-specific routing Specialized Somali TTS Natural cadence preservation
06

Intelligent Response Cache

Every successful, quality-validated translation is cached using a composite key that encodes the translation direction, the voice engine used, and a normalized version of the input text. If the same phrase is spoken again — even by a different user — the cached audio is served instantly, cutting latency to near zero. The cache also strips background noise labels, normalizes whitespace, and deduplicates requests to prevent double-processing from network retries.

Composite cache keys Noise normalization Request deduplication

Why Caching Changes Everything

In a live conversation, speed is everything. A 3-second delay feels like an eternity. A 10-second delay ends the conversation. Fahan's caching layer is the reason the app feels instant after the first exchange.

The system builds a composite cache key from three components: the translation direction (Somali→English vs English→Somali), the voice engine being used, and a cleaned, normalized version of the spoken text. Background noise annotations are stripped. Whitespace is collapsed. The result is a deterministic key that maps identical inputs to identical outputs — even across different sessions and users.

Every request also passes through a deduplication layer. If a network retry sends the same audio twice — which happens frequently on mobile networks — the system recognizes the duplicate request ID and returns the cached response without re-processing. This prevents double-billing, double-counting, and audio stutter.

Direction
Engine
Normalized Text
Cache Key
Instant Audio Response
Composite cache key construction

Not Every Translation Ships

Most translation apps serve whatever output the model produces — even if it's garbage. Fahan doesn't. Every translation passes through a quality validation gate before it reaches the user.

Empty Output Rejection

If the translation model returns nothing — or only whitespace — the system catches it immediately and falls back to the original text.

Repetition Pattern Detection

Regex-based scanning catches translations that contain repeated garbage strings — a known failure mode of neural translation models under stress.

Quality Scoring

Every valid translation receives a score from 0 to 0.95 based on length ratios, character analysis, and linguistic markers. Only scored translations are cached. Failed translations are never stored — preventing pollution of the cache with bad data.

What "Somali-First" Actually Means

Every architectural decision in Fahan was made with Somali as the primary language, not as an afterthought bolted onto an English-centric system.

Dedicated Speech Recognition

Somali audio is processed by a recognition engine specifically trained on Somali phonetics, vowel patterns, and dialectal variation. This isn't a "Somali language pack" added to a generic system — it's a purpose-selected engine.

Specialized Voice Synthesis

When the translation target is Somali, audio output routes to a dedicated Somali voice engine. Every other language uses a separate general-purpose engine. This dual-engine architecture means Somali output always sounds natural.

Native-Language Fallbacks

When no speech is detected, the system generates a friendly prompt in the USER'S native language — not English by default. If a Somali speaker's audio is too quiet, they hear a gentle Somali prompt asking them to try again. This respect for the user's language extends to every edge case.

By the Numbers

0
Specialized AI layers in every conversation turn
<1s
Target latency for cached translations
0
Languages supported with Somali-first architecture
0
Garbage translations served to users (quality gate catches them all)

Want to experience the engineering yourself?

Download Fahan and start a real-time Somali-English conversation.