Delivered remotely for a business based in Helsinki, Finland. Names withheld by agreement.
Project Overview
Fixed-sequence e-learning portals treat every learner as a blank slate. A senior cloud engineer onboarding onto an internal compliance track sits through the same introductory modules as a recent graduate, while a struggling trainee gets pushed forward simply because a video player reached the end of a playlist. For workforce upskilling teams operating out of Helsinki, that mismatch creates low completion discipline and weak retention on technical assessments.
We engineered an adaptive AI online learning platform built with Next.js, Python, and PostgreSQL. Rather than replacing instructional design with unguided chat boxes, the system encodes each curriculum as an explicit directed acyclic graph of competencies, pairs continuous diagnostic telemetry with Bayesian mastery updates in Python, and uses pgvector semantic matching to surface pinpoint remediation only where skill gaps actually appear.
Instructional Bottlenecks
Corporate training providers and technical academies brought four structural failures from legacy LMS deployments:
- Static linear lockstep: Mandatory sequential click-through frustrated advanced staff who could have tested out of foundational modules in minutes.
- Shallow completion metrics: Tracking page views and video watch time hid comprehension deficits until practical project reviews failed.
- Manual remediation overhead: Instructors spent hours reviewing open-ended lab submissions and pointing learners back to specific handbook sections.
- Catalog fragmentation: Separating quizzes, video transcripts, and enterprise HRIS rosters across multiple tools broke audit trails for regulated training tracks.
Architectural Strategy
Our engineering blueprint separated authoritative curriculum structure from probabilistic learner modeling. Instructional designers retain full control over learning outcomes, compliance gates, and passing thresholds inside a versioned skill graph in PostgreSQL. Meanwhile, Python microservices observe every quiz response, hint request, and interactive exercise submission to maintain live mastery probabilities per concept.
Next.js serves as the unified frontend and BFF edge layer, streaming server-rendered course overviews and managing low-latency practice sessions. Whenever a learner misses an applied concept, Python queries pgvector embeddings scoped strictly to approved course materials, surfacing a targeted micro-explanation or prerequisite refresher before advancing the learner along the path.
Core Capabilities
- Adaptive Diagnostic Onboarding: Initial placement probes evaluate prerequisite readiness in minutes and grant verified mastery credits for already-known topics.
- Interactive Multi-Modal Practice: Next.js lesson players combine timed scenarios, structured code or query sandboxes, branching case prompts, and synchronized video transcripts.
- Rubric-Grounded AI Feedback: Python workers evaluate short-answer justifications against instructor rubrics, highlighting specific missing reasoning steps rather than issuing opaque scores.
- Semantic Misconception Remediation: Vector similarity over curated lesson chunks retrieves exact refresher clips and worked examples when learners repeat an error pattern.
- Enterprise Cohort & LTI Governance: Managers monitor team skill-gap heatmaps while LTI 1.3 and SAML connectors integrate cleanly with corporate identity providers and HR portals.
Technical Architecture
Next.js App Router handles authentication cookies, tenant theming, and interactive learner workspaces, communicating over typed REST and server-sent event endpoints with a Python FastAPI core. FastAPI delegates latency-insensitive mastery updates, embedding indexing, and AI rubric evaluations to Redis-backed worker pools, keeping interactive lesson transitions crisp.
Flow: Next.js Course Player → FastAPI Submission Gateway → Redis Streams Event Buffer → Python Mastery & Rubric Engine → PostgreSQL + pgvector Skill State → SSE Feedback Stream to Learner UI
All learner responses land in an append-only event log in PostgreSQL before any summary mastery score updates. If an instructional team recalibrates question difficulty weights mid-quarter, Python can replay historical response logs deterministically against the updated model parameters without losing auditability.
Technology Stack
| Category | Technology detail |
|---|---|
| Frontend Workspace | Next.js App Router with React Server Components and TypeScript course player |
| Adaptive Backend | Python FastAPI hosting competency estimation, sequencing, and rubric pipelines |
| Primary Database | PostgreSQL managing tenant isolation, skill DAGs, and append-only attempt logs |
| Semantic Retrieval | pgvector HNSW indexes matching learner misconceptions to targeted micro-lessons |
| Queue & Caching | Redis Streams buffering telemetry bursts and orchestrating async lab grading |
| UI Design System | Tailwind CSS component library with accessible keyboard-first code and quiz blocks |
| Enterprise Interop | LTI 1.3, SCORM 2004, and SAML 2.0 connectors syncing rosters and completion states |
| Media Delivery | HLS adaptive video streaming with time-coded transcript search and signed URLs |
| Observability | OpenTelemetry traces correlating Next.js route latency with Python scoring workers |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Pure AI path generation skipped mandatory compliance modules | Restricted adaptive routing to edges inside an explicit PostgreSQL prerequisite DAG; requires upfront graph authoring by designers in exchange for guaranteed regulatory coverage. |
| Running a dedicated vector store duplicated tenant and catalog permissions | Co-located embeddings in PostgreSQL via pgvector with composite tenant/catalog filters, trading standalone vector cluster sharding for atomic transactional consistency. |
| Synchronous LLM rubric scoring stalled page transitions for slow completions | Streamed immediate objective checks first and dispatched generative rubric commentary over Redis Streams + SSE, adding minor client state complexity to keep UI interactions responsive. |
| Mid-cohort content edits broke in-progress learner progress calculations | Versioned immutable course snapshots in PostgreSQL so active enrollments finish on their starting curriculum revision while new cohorts receive updated modules cleanly. |
Security & Tenant Isolation
Corporate upskilling tenants store proprietary engineering playbooks, internal SOP videos, and employee skill evaluations. PostgreSQL enforces Row-Level Security policies keyed to organization ID on every enrollment, attempt, and embedding table, guaranteeing that semantic retrieval never leaks proprietary training snippets across customer boundaries.
Authentication integrates SAML 2.0 and OIDC single sign-on alongside scoped API tokens for HRIS roster syncs. Video assets and downloadable workbooks reside in private object storage accessed strictly through short-lived signed URLs minted per verified Next.js session, while AI evaluation prompts strip employee names and emails before external model inference.
Performance & Scale
Cohort launch days create sharp read/write spikes as hundreds of employees authenticate and launch diagnostic assessments simultaneously. Next.js caches published catalog metadata and static lesson shells at the edge, isolating PostgreSQL from repetitive syllabus reads.
On the write path, high-frequency heartbeat telemetry and step attempts enter Redis Streams for micro-batched persistence. Indexing curriculum embeddings by tenant partition keeps pgvector HNSW scans predictable, and Python scoring workers scale horizontally on queue depth without starving interactive API endpoints.
Operational Outcomes
Consolidating adaptive diagnostics, verified skill graphs, and enterprise reporting into one cohesive platform reshaped how organizations run technical onboarding and continuous learning:
- Focused study time: Experienced learners bypass redundant basics through verified diagnostics, concentrating effort strictly on genuine competency gaps.
- Actionable cohort visibility: L&D leads inspect real skill-node mastery distributions rather than misleading video-completion percentages.
- Consistent instructor leverage: Rubric-assisted feedback handles routine formative explanations so human mentors spend time on nuanced project reviews.
- Audit-ready compliance trails: Immutable attempt histories and versioned curriculum snapshots satisfy internal governance and external accreditation checks without manual spreadsheet reconciliation.