
Arabic & Darija Voice Agent
Speech-to-speech for Moroccan Darija: dialect-tuned ASR, intent routing with a human-handoff threshold, and local TTS inside a conversational latency budget.
The lab
Smaller than the production work and labelled as what it is. Protocol implementations, retrieval pipelines, training runs and the field notes behind them.

Speech-to-speech for Moroccan Darija: dialect-tuned ASR, intent routing with a human-handoff threshold, and local TTS inside a conversational latency budget.

A Model Context Protocol server exposing real tools, with a matching client and a test suite — connected to a desktop LLM host.

Agent-to-Agent protocol demo: an orchestrator discovering a worker through its agent card and delegating a task across the wire.

Five runnable agent patterns with diagrams: prompt chaining, routing, parallelization, the agent loop, and structured output.

Retrieval service with query rewriting, reranking, self-correction and an eval harness that scores retrieval separately from generation.

An end-to-end alignment pipeline: data prep, SFT with TRL, evaluation, then preference optimization with DPO and GRPO.

Local-vs-API routing, semantic cache hit rate, GPU memory headroom, and the batch-size / latency trade-off made visible.
Field notes on building production AI systems — collected, verified and synthesized from real deployments and post-mortems. These are lessons and patterns, not project write-ups.

The eight failure modes that repeat in every agent system, and the fix for each.
Read the note →
80–90% of production scenarios succeed with an orchestrated workflow. Most teams reach for multi-agent anyway.
Read the note →
The model is the easy part. Observability, error handling and evaluation are where agents live or die.
Read the note →
Cutting 88% of the bill by bringing the model in-house — and fine-tuning it to actually use tools.
Read the note →
One missing termination condition, six hours of two agents talking to each other, and an $847 invoice.
Read the note →
Stop using an LLM for tasks that are pattern matching. Measure every step before optimizing any of them.
Read the note →
High API cost and data privacy look like two problems. They are usually the same problem with the same fix.
Read the note →
20–30 query patterns cover 80% of use cases. Context management, not model choice, is the real bottleneck.
Read the note →
A six-question decision framework, and why 2,000 clean examples beat 10,000 noisy ones.
Read the note →
Raising batch size from 8 to 32 gained 40% throughput and tripled latency. LLM inference is memory-bound, not compute-bound.
Read the note →
The protocol is solid. LLM behaviour around it is the bottleneck.
Read the note →
Everything an LLM sees is input and everything it emits is untrusted. Authorization has to live in code the model cannot reach.
Read the note →
Transcribe and categorize 500 calls before writing a line of code. The distribution tells you your ROI ceiling.
Read the note →
Resolving 88% of calls without a human. What actually took the time, and why it wasn't the model.
Read the note →The systems these lessons came out of are written up in full.
See the production work →
MAJID
“Innovation distinguishes between a leader and a follower.”
Need an AI system that holds up in production? Tell me what breaks today and I'll tell you what I'd build.