// HOW IT WORKS

Seven algorithms. One question. Genuine understanding.

Episteme doesn't rely on prompt engineering to be Socratic. It runs a research-backed algorithmic pipeline on every turn — then feeds the structured output into Claude.

// THE CORE LOOP

What happens on every message.

User sends a message

Raw text arrives at the Next.js API route. The turn counter increments and the session context is loaded from Supabase.

RDSE extracts quality signals

No LLM call — under 1ms. Six deterministic signals are measured and collapsed into a single quality score between 0 and 1.

SDSM determines next Socratic state

The 7-state machine reads RDSE score, SUV accuracy from the prior turn, confusion signal count, and turn number — then emits a precise instruction block.

SUV verifies semantic accuracy

An async Claude call checks factual accuracy (0–1) and detects specific misconceptions. This runs in parallel and does not block the streaming response.

CBKT-CS updates Bayesian knowledge state

Four BKT parameters — P(knows), P(learn), P(slip), P(guess) — are updated using the RDSE score as a soft correctness signal. Mastery probability becomes the clarity score.

Enriched system prompt sent to Claude

SDSM state, CBKT clarity, BGDC depth level, detected misconceptions, and prerequisite gaps are injected into the system prompt — structured signals, not vibes.

Response streamed to user

Claude (Sonnet 4.6) generates a Socratic response guided by the enriched prompt. Tokens stream via SSE directly to the browser.

DB updated, clarity score surfaced

The turn, clarity score, CPGAB graph update, and EGP forgetting-curve state are persisted to Supabase. The UI reflects the new mastery state instantly.

// THE 7 ALGORITHMS

Research-backed. Deterministic. Fast.

Each algorithm is grounded in published educational-technology research. Most run without any LLM call — the intelligence is structural.

RDSE

Response Depth Signal Extractor

SocraticAI (arXiv 2512.03501)

Converts raw user text into a multi-feature quality score (0–1) using 6 deterministic signals: reasoning connectives, response length, uncertainty level, technical term density, question-back ratio, and structure score. Runs in under 1ms with no LLM call — purely algorithmic. This score drives both the state machine and BKT updater every turn.

BGDC

Bloom-Grounded Depth Classifier

Bloom's Taxonomy NLP Classification (arXiv 2511.10903, Nov 2025)

Classifies each user question into Bloom's cognitive levels (Remember → Create), mapped to Episteme's four depth levels: SURFACE, CONCEPTUAL, ANALYTICAL, SYNTHESIS. Uses 3-signal fusion: fast keyword pattern matching, LLM zero-shot classification, and confidence weighting. The fused result determines how Episteme structures its opening probe.

SDSM

Socratic Dialogue State Machine

SocraticLLM (CIKM 2024) — REVIEW→HEURISTIC→RECTIFY→SUMMARIZE structure

A formal 7-state machine (PROBE, DEEPEN, REDIRECT, SCAFFOLD, RECTIFY, CONSOLIDATE, COMPLETE) that determines the exact Socratic strategy for each turn. State transitions are deterministic, based on RDSE quality score, SUV semantic accuracy, confusion signal count, and turn number. Each state injects a precise instruction block into the system prompt.

CBKT-CS

Conversational BKT Clarity Scorer

Bayesian Knowledge Tracing (Corbett & Anderson, 1994) + DKT (Piech et al., Stanford)

Adapts classic Bayesian Knowledge Tracing — designed for binary quiz outcomes — to work with continuous conversational quality signals. Maintains four parameters per concept: P(knows), P(learn), P(slip), P(guess). Updated after each turn using the RDSE quality score as a soft correctness signal. The resulting mastery probability (0–1) is scaled to the 0–100 clarity score shown in the UI.

SUV

Semantic Understanding Verifier

Reference-aided evaluation (JEDM 2025)

After each user response, a lightweight Claude call evaluates semantic accuracy (0–1) and detects specific misconceptions. This runs asynchronously — it does not block the streaming response. The detected misconception, if any, is stored and fed into the next turn's system prompt, triggering the RECTIFY state.

CPGAB

Concept Prerequisite Graph Auto-Builder

ACE Methodology (JEDM 2025) + Graphusion (ACL 2024)

On each new concept encountered, Claude extracts its direct prerequisites and adjacent concepts, building a directed acyclic graph (DAG) per session. This graph powers the knowledge map UI and gap detection. "You explored overfitting without touching bias-variance tradeoff" is a CPGAB output.

EGP

Ebbinghaus Gap Prioritizer

Ebbinghaus Forgetting Curve (1885) + SM-2 spaced repetition algorithm

Uses the forgetting curve (R = e^(−t/S)) to rank unvisited gap concepts by urgency. Memory stability S is calibrated to clarity score and times explored. Concepts with low clarity and high elapsed time since last visit are surfaced first in the knowledge map and next-session recommendations.

// ARCHITECTURE

The full system at a glance.

A single Next.js edge function orchestrates the entire pipeline on each turn — deterministic algorithms first, then a single Claude call with the enriched prompt.

BrowserReact + SSENext.js / VercelApp Router · API RoutesClaude APISonnet 4.6SupabasePostgreSQLPIPELINE (per turn)RDSE → BGDC → SDSM → SUV → CBKT-CS → EGP → CPGABSSE streaming
Amber — primary data flow / algorithm pipeline
Green — persistence layer (Supabase)

// RESEARCH FOUNDATION

Grounded in 10 published works.

Every algorithm in Episteme traces directly to peer-reviewed or preprint research in educational technology, cognitive science, and NLP.

  1. 01SocraticAI: Scaffolding Human Reasoning via Socratic Dialogue (arXiv 2512.03501)
  2. 02Bloom's Taxonomy NLP Classification via Multi-Signal Fusion (arXiv 2511.10903, Nov 2025)
  3. 03SocraticLLM: Structured Dialogue for Tutoring Systems (CIKM 2024)
  4. 04Bayesian Knowledge Tracing — Corbett & Anderson (1994)
  5. 05Deep Knowledge Tracing — Piech et al., Stanford (NeurIPS 2015)
  6. 06Reference-aided Conversational Evaluation for Tutoring (JEDM 2025)
  7. 07ACE: Automatic Concept Extraction for Knowledge Graph Construction (JEDM 2025)
  8. 08Graphusion: LLM-based Knowledge Graph Construction from Text (ACL 2024)
  9. 09Ebbinghaus Forgetting Curve and Memory Decay (1885)
  10. 10SM-2 Spaced Repetition Algorithm — Wozniak (SuperMemo, 1987)

24-hour Hackathon · CBC Spring 2026 · Track 3: Economic Empowerment

Back to Episteme