← Back to all projects

TKMG Academy

TKMG Academy LMS

A full-stack, bilingual Learning Management System with SCORM support and an AI knowledge-retrieval layer.

Role
Full-stack engineer (primary contributor)
Timeframe
Nov 2024 — Present
Status
Active
Team Size
6
Domain
Education / E-learning (LMS)
TKMG Academy LMS cover

TKMG Academy LMS is a full-stack, bilingual (English/Spanish) learning platform for a professional training provider. Learners move through versioned courses, video lessons, exams, and SCORM content, earning Credly badges and generated certificates, while purchases and enrollments sync automatically from WooCommerce.

Its standout layer is an AI 'Knowledge Teacher' I designed — a retrieval-augmented system that ingests lesson transcripts and documents, embeds them with pgvector, and answers questions with citation-grounded, persona-driven responses. I built it directly on the existing PostgreSQL stack, adding hybrid semantic/keyword search, guardrails, an evaluation harness, and a token-cost ledger without provisioning any extra infrastructure.

Full-stack engineer (primary contributor)

  • Course / module / lesson structure with content versioning and publishing
  • Exams and quizzes with answer retention and migrated-response handling
  • Vimeo-hosted video lessons with progress tracking
  • SCORM 1.2 packaging and playback via a custom SCORM tunnel
  • SCORM Cloud and self-hosted SCORM dispatch integration
  • Credly digital badges plus generated PDF/DOCX certificates
  • WooCommerce-driven course purchase and enrollment sync
  • Bilingual (English/Spanish) content and UI via i18next
  • Admin panel for courses, content authoring, users, news, and handouts
  • AI knowledge layer: transcript/document ingestion, hybrid RAG retrieval, and an admin playground
  • Versioned AI persona prompts with guardrails, eval harness, and cost tracking
  • Free-trial and full-library subscriber access gating

Problem

No vector search capability existed; PostgreSQL ran plain with only pg_trgm/unaccent enabled.

Solution

Enabled the pgvector extension and built hybrid semantic + keyword retrieval with score boosting.

Problem

No queue/Redis infrastructure existed for asynchronous ingestion and embedding work.

Solution

Adopted pg-boss, reusing the existing Postgres connection instead of provisioning new infrastructure.

Problem

Videos are Vimeo-hosted with no stored transcripts to index.

Solution

Built an admin SRT/VTT upload (single and batch) ingestion path as the primary flow, with Vimeo fetch and Whisper ASR as optional feature-flagged fallbacks.

Problem

Citations and retrieval must respect bilingual content (en/es language variants).

Solution

Tagged every knowledge chunk with a language code and applied language-aware filtering with a defined fallback.

Languages

TypeScriptJavaScriptSQLNixBash

Frameworks

React 18tRPCTanStack RouterTanStack QueryTanStack TableExpressPrismaKyselyTailwind CSSshadcn/uiRadix UIReact Hook FormZodTipTapi18nextRechartsFramer MotionPassport.jsViteStorybook

Databases

PostgreSQL 17pgvectorpg_trgm

Tools

pnpmdevenv (Nix)ESLintPrettierVitestJestPlaywrightMSWDockernginxsupervisorGitHub ActionsMinIOpg-boss

Infrastructure

Deployment
Docker container (nginx + supervisor)
Cloud
AWS (S3)
CI/CD
GitHub Actions
Containers
Docker
Other
devenv (Nix) reproducible dev environment, pg-boss Postgres-backed job queue, MinIO (local S3-compatible storage)

Vimeo

Hosting and playback of lesson videos (and optional transcript fetch)

Credly

Issuing digital badges and credentials

SendGrid

Transactional email

SCORM Cloud

SCORM content hosting and self-hosted dispatch (incl. legacy Litmos migration reporting)

WooCommerce

Course purchase / enrollment synchronization

AWS S3 / MinIO

File and media storage

OpenAI

LLM generation and embeddings for the AI knowledge layer

Sentry

Error monitoring (frontend and backend)

PostHog

Product analytics

Gotenberg / Chromiumly

Server-side PDF/document generation (certificates)

An 'AI Teacher / Knowledge Layer' that performs retrieval-augmented generation over course transcripts and knowledge documents. A provider-agnostic LLM gateway (OpenAI) powers hybrid semantic + keyword search (pgvector + pg_trgm) with citation-first, persona-driven answers, plus an ingestion pipeline, guardrails, versioned prompts, an eval harness, and a token-cost ledger with a daily spend cap.

Use Cases

RAG retrieval over lesson transcripts and knowledge documentsHybrid semantic + keyword (vector + trigram) searchCitation-first answer summarizationQuery rewriting and condensingSnippet extractionPersona-based assistants (Indexing / Coaching / Teaching)Optional reranking (feature-flagged)

Providers

OpenAI

Models

gpt-5.4-nano, gpt-4.1-mini, text-embedding-3-small

  • Built a full-stack, type-safe LMS as a pnpm monorepo using React, TanStack, and an end-to-end tRPC API over PostgreSQL (Prisma + Kysely).
  • Designed and implemented an AI knowledge layer with retrieval-augmented generation, combining pgvector embeddings and trigram search for citation-grounded answers over course transcripts and documents.
  • Engineered a content ingestion pipeline (SRT/VTT transcripts and PDF/DOCX docs) running on a pg-boss Postgres-backed job queue, avoiding additional infrastructure.
  • Integrated SCORM 1.2 delivery via a custom SCORM tunnel plus SCORM Cloud and self-hosted dispatch, including reporting for migration off a legacy provider.
  • Wired up third-party services including Vimeo, Credly, SendGrid, WooCommerce, AWS S3/MinIO, Sentry, and PostHog.
  • Established a reproducible Nix/devenv development environment with pre-commit linting, formatting, and type-checking, plus a Docker-based deployment image.

Have a project in mind?

Let’s talk about what you’re building and how Montgomery Labs can help ship it.

Start a project