hazwan.
← Back to portfolio Case study · agent orchestration · 2025 — now

One manager.
A dozen workers.
Zero babysitting.

Every week a Malay–English podcast drops a 90-minute episode. Within hours, with no one at the keyboard, a pipeline of LLM agents and deterministic scripts has transcribed it, corrected it, translated it and asked me to listen to the few words it isn't sure about. This page is about how that's orchestrated.

A 3D diorama of the pipeline: a sound wave enters, a black manager tower sends orange lines to a row of small worker robots, their output passes a glass gate that sets rejects aside, two stacks of subtitles come out, a pair of orange headphones sits beside them, and an orange arrow loops back to the manager.
  1. Audio ina new episode is detected
  2. Managerplans and dispatches the waves
  3. Workers~12 run in parallel, one per chunk
  4. Gatescripts verify and reject bad edits
  5. Subtitles outMalay and English
  6. Ear-checkI listen to flagged words only
  7. Retro loopeach run improves the next
264 h
171 episodes of code-switched audio
11
pipeline steps, detect → retro
4 → 9
/10 named-entity fidelity vs WhisperX
01Architecture

Agents decide.
Scripts do the arithmetic.

LLMs are good at judgement: is this a name, a garble or a stutter? They're bad at timecodes, budgets and file integrity. So every agent writes a small, typed list of edits, and deterministic tools apply, verify and gate them.

Trigger
Detectorscheduled RSS / YouTube check
→
Single-slot queueone pipeline at a time
→
Launcherpicks harness, model, provider
Orchestrate
Manager agentruns the 11 steps
⇄
Watchdogevery 5 min: nudge → relaunch → park
Fan out
Fix wave~12 workers, one per chunk
Split wavereadable subtitle blocks
Merge-shortscript → LLM → script
TranslateMalay → English
Shared state
Glossary DBlookup → claim → search → register
Wave ledgerconcurrency-safe spawn log
Prompt cachebyte-identical shared prefix
Gate
apply_editsops → SRT + generated report
→
verifyblock floor, drift, rewrite ratio
→
combinerefuses any open [?flag?]
Close the loop
Owner ear-checkclips of flagged words only
→
Verdict sessionsmall deterministic brief
→
Retro + fix agentpipeline improves itself
LLM agent deterministic gate script / state human
02The run

Eleven steps,
every week.

1Ingest
  1. Download & transcribeElevenLabs Scribe v2. The raw response is cached immutably, so re-chunking is free.
2Correct
  1. Benchmark chunkOne worker fixes chunk 1 first and leaves notes that seed the wave.
  2. Garble sweepConditional, show-specific clean-up of known mis-heard terms.
  3. Fix waveWorkers correct words per chunk against a diagnostics punch list.~12 in parallel
3Shape
  1. Split waveWorkers reshape long blocks into readable subtitles.parallel
  2. CombineChunks stitched; any unresolved flag blocks the build.script only
  3. Merge-short + clean-upLLM judges fragments; stutters, numbers and capitalisation are deterministic.
4Check & ship
  1. QA & review listGlossary cross-check; only uncertain spans reach a human.
  2. TranslateAdaptive splitting into English, with an advisory coverage check.
  3. AnnouncePush notification and audio clips of every flagged word. Upload waits for my ear-check.I listen
5Learn
  1. RetroThe manager writes an evidence-backed post-mortem with decision checkboxes.
03Design decisions

What makes it
hold together.

A small robot feeds one orange card into a black machine that prints a clean sheet 01

Workers emit edits, scripts own the file

A worker's only deliverable is an append-only edits.jsonl: replace, punct, insert, split, delete, flag or noop. A script builds the SRT and the report from it.

Whole-file rewrites caused silent truncation and timecode drift, and output tokens dominated cost. The ops file also makes a crashed worker resumable.

A row of metal cubes on a rail, led by one orange cube 02

Cache-ordered prompts, leader-first spawns

Every worker reads the same spec, context and glossary slice in the same byte order, with the one per-worker file last. The prompt has zero per-worker bytes.

One leader per provider cohort spawns first and warms the cache, and the followers start 75 s later. A simultaneous burst would just race the cache write.

A stream of cubes forks: some drop into a capped orange tray, the rest continue 03

Routing as a budget control

The first four fix workers ride a fixed-cost subscription, and every retry falls over to pay-per-token. That bounds subscription spend by construction.

Providers are re-picked per episode for health, real cost and cache-hit rate. fp8 is the quantisation floor, and providers billing ~10× list price are hard-banned.

Metal cubes around a black card drawer, one pulling out an orange index card 04

A shared glossary, not shared context

Before searching, a worker looks the term up. On a miss, it claims the ASR spelling so no other worker duplicates the search, then registers the canonical form plus every garble it saw.

Free search runs first, and metered search only after a miss. Workers get an episode-relevant slice, not the 95 KB master file: that change saved ~28k tokens × 10 workers.

A small lighthouse shining an orange beam on a black tower 05

A babysitter, not a router

A watchdog checks the manager every five minutes: nudge once, relaunch once on the retained session, then park and notify me. It enforces a budget ($1.50 warn, $3.00 park).

It never changes model or provider. Recovery and routing are separate jobs, so a stuck run can't quietly become an expensive one.

Orange headphones on a stand beside a row of cubes, one with an orange flag 06

Humans only where ears matter

The run holds its upload until I've listened to short clips of the flagged words. My verdicts go to a fresh session with a small deterministic brief, not to the manager's huge cold context.

The handoff is cheaper and more reliable, and the manager stays available as the fallback.

04Memory

A pipeline that
writes its own retro.

Each run ends with a structural post-mortem. The agent that reports never applies a fix, and the agent that fixes never runs mid-episode. Only the next episode can mark a fix as verified.

Manager writes retroevidence + untouched do / don't / monitor boxes
Carry-over checkdid last week's fixes hold?
Owner ticks boxesone human decision per finding
Fresh fix agentworks only the [x] do items, one commit each
Write-backissue files + component dossiers + regression tests

29 tracked issues · 8 component dossiers · regression suites built from real episodes

05Tried and rejected

What didn't work.

← More work