Skip to content

Architecture

The whole system on one screen. Read this before anything else.

Kwilo system architecture

The big idea: one product, two audiences

Kwilo is B2B2C. The same backend and the same product app serve two very different buyers:

  • B2B: institutions. Colleges, universities, corporates. They onboard as an org, set up an academic structure, and their faculty and learners join under it. See the B2B flow.
  • B2C: individuals. A single learner, trainer, or parent who signs up off the street, uses a free tier, and upgrades to Pro. See the B2C flow.

Everything below the users is shared. The two audiences differ in how they get in and what they pay for, not in the engine that serves them.

The moving parts

Part Where What it does
Marketing site kwilo.ai · apps/site Public, SEO-friendly pages. No auth. This is where B2C visitors land.
Product app app.kwilo.ai · apps/web The actual app: dashboard, AI tutor, courses, admin. Auth required. Both audiences live here.
Mobile app apps/mobile (Expo) Native companion; talks to the same backend.
Backend API api.kwilo.ai · apps/backend FastAPI on Cloud Run. The brain. Every client talks to it.
AI layer inside backend Gemini primary, Claude / GPT-4o as fallback. Powers tutoring, generation, grading.
RAG service apps/rag Curriculum knowledge retrieval over pgvector.
Postgres Cloud SQL + pgvector The main database.
Memory + question bank kwiloai_memory, knowledge_base_status Learner mastery + the exam question corpus (feeds the Study Plan).
Razorpay external B2C subscription billing.
GCS external Media storage.

Why the marketing site and product app are split

Anything public and crawlable lives in apps/site (kwilo.ai). Anything auth-protected lives in apps/web (app.kwilo.ai). They share the @kwilo/ui design system but nothing else. A pricing page is marketing; a dashboard is product.

How a request flows

  1. A user lands on the marketing site or opens the product app.
  2. The product app (or mobile) calls the backend API.
  3. The backend reaches the AI layer, Postgres, RAG, or the memory/question bank as needed.
  4. For B2C, billing events go through Razorpay; media lands in GCS.

The backend is the only thing that talks to AI, the database, and billing. Clients never do.

Where to go next