Engineering Brief

An AI-native architecture, not a chatbot on top of a textbook.

Every PrepX feature is backed by a deliberate architectural choice. Below is a transparent engineering brief — the layers, the trade-offs, the AWS migration plan, and how we ship video lectures, 3D notes, and real interview panels reliably at scale.

01 · Executive Cognition

Hermes — institutional executive cognition

Hermes is not an "AI agent runtime." It's the executive layer of an institution. It orchestrates a fleet of specialized faculty desks (Polity, Current Affairs, Ethics, CSAT, Interview), routes queries to the right authority, resolves conflicts when faculties disagree, and refuses to fabricate certainty when evidence is ambiguous.

Internally we call them faculties, desks, and councils — never "agents" or "workers." The naming shapes the architecture. Hermes is the head of an autonomous university, not a task scheduler.

02 · Reliability

5-tier AI provider router with circuit breakers

Every LLM call cascades through five tiers: 9router (primary edge proxy), Ollama (self-hosted on-prem), Groq (7 round-robin keys), Kilo (4 keys × 5 models), and NVIDIA NIM (failsafe). Each tier opens its own circuit breaker after 3 failures and cools down for 60 seconds before retry.

Result: when one provider has an outage, PrepX doesn't. We've been live through three major LLM-provider outages without dropping a single tutoring session.

03 · Knowledge

Living Corpus — pgvector, nightly refresh

The corpus is the knowledge layer. PostgreSQL with the pgvector extension stores embeddings for every UPSC topic, judgment, government scheme, and PYQ. Every night, faculty desks ingest fresh sources (PIB, Yojana, Kurukshetra, EPW, leading dailies), summarize through a 4-stage pipeline (Crawl4AI → readability → AI processor → topic synthesis), and write back to the corpus.

By 6 AM, the aspirant's study plan reflects yesterday's news.

04 · Generation

Cinematic Engine — Manim + LatentSync + IndicF5

Lectures are not pre-recorded. They're generated. The Cinematic Engine combines three open-source models, all GPU-hosted: Manim for mathematical and structural board visuals, LatentSync 1.6 for lip-synced teacher avatars, and IndicF5 for Devanagari-grade Hindi-English bilingual TTS.

The engine is layered (L1 board → L2 teacher → L3 narration → L4 perspective → L5 audio mix → L6 subtitles → L7 packaging) so each layer can be improved or swapped without breaking the others. Subject-agnostic by design — Polity today, JEE Physics tomorrow.

05 · Distribution

Multi-tenant white-label — institution-grade

The platform runs as a multi-tenant SaaS. A subdomain (e.g., drishti.varunshuniversity.live) maps to a tenant's branding (primary color, logo, faculty avatars, coach name). Existing coaching institutes can plug in without losing their identity.

Tenant data is row-level-isolated via Supabase RLS policies — Postgres-enforced, not app-enforced. White-label deployments share the engine but never share content or learner data.

06 · Trust

Epistemic honesty — evidence → belief → translation

We don't let the AI fabricate certainty. Every claim PrepX surfaces sits in a 3-layer cognition stack: evidence (immutable observed facts), belief (revisable estimates with versioning and provenance weighting), and translation (the human phrase the learner sees).

When faculty desks disagree — and they do — we surface institutional dissent in linguistic form ("competing pedagogical signals"), never collapsed into a false consensus answer. This is what makes PrepX a trustworthy mentor, not a confident bullshit generator.

07 · Infrastructure

AWS-ready · Kiro-accelerated

The platform runs today on AWS-compatible infrastructure (Linux/Docker, Postgres-managed, S3-API-compatible object storage). The architectural decision was made early to keep migration cost-free.

Planned 2026 migration: primary compute moves to AWS EC2 (GPU) for the cinematic engine, AWS RDS for the corpus, AWS S3 for video and lecture artifact storage, and AWS Lambda for event-driven faculty-task dispatch. CloudFront for global delivery once we cross 100 K learners.

We're applying to use Kiro Pro+ to accelerate spec authoring and API design as we expand the engine from one product (PrepX UPSC) to seven domains (JEE, NEET, Law, CA, Medical, K-12, International). Kiro's spec-driven workflow fits our engineering posture: domain plugins must conform to a stable engine contract — Kiro helps formalize that contract once and reuse it everywhere.

EC2 GPU
Cinematic engine
RDS Postgres
Living corpus
S3
Lecture artifacts
Lambda
Faculty dispatch
Engineering Principles

How we build.

Vertical slices first

One feature end-to-end (generation → render → quiz → DB persist → CHECKPOINT) before fanning out. No half-built abstractions.

Pedagogy as data, not code

Subject curriculum flows through the engine as data via the scene-graph. Zero subject-locked types in core.

Run features after every build

TypeScript green ≠ feature works. We exercise the route, render the video, persist the row before claiming done.

Test the full user journey

Login → action → relogin → DB verify. Automated gates aren't enough; manual walkthrough every sprint.

No agent fabrication

Faculty agents never write user-facing content directly. They route, summarize, or surface dissent — never invent.

Institution, not app

Every architectural decision evaluated against "coaching institute vs ChatGPT wrapper." The answer is always institute.

Want the deeper engineering deep-dive?

We share private architecture briefings for serious investors, EdTech operators, and engineering hires. Email the founder with your context.