Architecture Protocol•AI Integration

Edge-Resilient Audio Ingestion for AI Speech Evaluation

N

Naveen

Systems Engineer

2026-10-08

8 min read

Spoken English assessment software built for engineering campuses faces a constraint most AI product teams ignore: the network is not reliable. A naive implementation that streams audio directly to the server fails silently when campus Wi-Fi drops for three seconds mid-recording. The student loses their assessment. The institution loses trust in the platform. Our answer was not a better streaming protocol — it was eliminating streaming entirely from the critical path.

1The Constraint

Campus networks in Tier-2/3 Indian colleges have packet loss and bandwidth fluctuations that break naive audio upload implementations. Students lose recordings mid-assessment when the network drops.

Hard Constraints

  • Network unreliability is structural — it cannot be fixed by the product
  • Lost recordings break the entire evaluation flow for a student
  • Evaluation must not require constant connectivity during recording
  • Upload must eventually succeed even after browser refresh or tab crash

What would fail:Live audio streaming (WebRTC or direct chunked upload without local persistence) fails catastrophically when bandwidth fluctuates. A 30-second outage during a 5-minute assessment means the student starts over.

2Architectural Decision

MediaRecorder → IndexedDB local cache → exponential backoff upload queue → signed storage → evaluation pipeline. Recording and upload are decoupled: the student records against local storage, not against the network.

Why

Local-first persistence means the recording exists on the device regardless of network state. Upload is a background retry operation, not a blocking step. The student cannot lose their work to a network event during recording.

Trade-off

Higher complexity in the client layer — chunk reconciliation, storage quota management, and retry state machine must all be implemented and tested. The trade-off is explicit: client complexity in exchange for upload reliability.

System Layers

Client Audio Capture

MediaRecorder API / Web Audio

Low-latency browser recording with local chunk validation

Durable Edge Cache

IndexedDB

Local-first storage before any network transmission

Resilient Ingestion Queue

Background Sync / Presigned Storage

Exponential backoff retry queues with signed upload credentials

Speech Evaluation Pipeline

FastAPI / Acoustic Evaluation Models

Phonetic scoring and communication rubrics after successful upload

3Decision Log

Local IndexedDB cache before any network upload

Why

Students on campus Wi-Fi experience packet loss. Recordings must never be lost mid-assessment due to network events that the product cannot control.

Trade-off

Requires complex client-side chunk reconciliation and storage quota management.

Asynchronous backoff queues over live streaming

Why

Live audio streaming fails catastrophically under edge bandwidth fluctuations. Decoupling recording from upload eliminates the network from the critical path.

Trade-off

Introduces evaluation latency (upload must complete before scoring begins) in exchange for 100% upload delivery under normal retry conditions.

Presigned credentials with 5-minute expiry instead of permanent upload tokens

Why

Permanent upload credentials become a liability if client storage is compromised. Short-lived credentials limit the exposure window.

Trade-off

Requires the client to request a new credential if a previous one expires during a retry sequence.

Boring retry architecture (HTTP queues) over complex WebRTC mesh

Why

Reliability in Tier-2/3 campuses requires deterministic HTTP queues. WebRTC peer mesh adds complexity that fails unpredictably under firewall and NAT restrictions common in institutional networks.

Trade-off

Higher backend object storage IOPS compared to direct peer connections.

4Integration Boundaries

Systems: Browser MediaRecorder API ↔ IndexedDB local store ↔ Presigned cloud storage ↔ FastAPI evaluation backend

Boundaries: The client-storage boundary is explicit: no audio leaves the device until it is fully captured and locally persisted. The upload boundary uses time-limited presigned credentials (5-minute expiry) — the backend issues a URL, not a permanent credential.

Auth Model: Temporary presigned upload credentials with 5-minute expiry. Audio chunk MIME-type validation before upload. Isolated storage buckets per campus cohort.

5Evaluation

Method: Retry/backoff behavior verified against simulated packet loss. IndexedDB persistence verified against tab crash scenarios. Upload success rate tested under degraded network conditions.

Regression Gate: Upload delivery must succeed after up to 5 retry attempts. Any failure mode that loses a recording is a P0 regression.

6Production Ops

Observability: Upload queue depth, retry counts, and backoff intervals logged per session. Evaluation pipeline latency monitored separately from upload latency.

Human Gate: Speech scoring output reviewed by educators before high-stakes results are finalized. [VERIFY — confirm review gate exists in production workflow]

Rollback: IndexedDB data is retained on the device if the evaluation pipeline is unavailable. Students can retry submission without re-recording.

Verified Technical Signals

Retry attempts per upload

Up to 5 with exponential backoff and jitter

Configured in the upload queue. Jitter prevents thundering herd on reconnect.

Credential window

5-minute presigned URL expiry

Backend issues per-session upload credential, not a permanent storage token.

Local persistence

IndexedDB survives tab crash and browser refresh

Verified in TalkBetter engineering notes.

Audio validation

MIME-type and bitrate validation before evaluation pipeline

Speech scoring model enforces strict bitrate limits.

7Engineering Takeaways

  • Network reality is a product architecture constraint, not an ops problem. Design for the worst-case network you will actually encounter.
  • Decoupling recording from upload is the highest-leverage architectural decision for unreliable network environments.
  • Boring retry queues with exponential backoff and jitter outperform complex streaming protocols in constrained institutional network environments.
  • AI features need reliable infrastructure underneath. The speech evaluation pipeline is only as good as the audio that reaches it.
  • Short-lived credentials at the upload boundary limit blast radius if client storage is compromised.

8What a CTO Should Verify

Honest questions for due diligence when evaluating similar systems:

Q1. What is the measured upload success rate after retry exhaustion in production?
Q2. What happens to a recording if the device runs out of IndexedDB storage quota mid-assessment?
Q3. Is there a human review gate on speech scores before high-stakes results are shown to students?
Q4. What is the maximum cohort size the evaluation pipeline has processed in a single session?
Q5. How are IndexedDB chunks cleaned up after successful upload?

Discuss an AI Engineering Engagement

Vasiva builds production AI systems and software products for organizations globally. Evaluate an opportunity with us.

Start a Conversation