Inspiration
First-year university students (for example, first-year students at TUM CIT in Grundlagen: Algorithmen und Datenstrukturen, IN0007) face a tough gap every week of the semester: studying lecture PDFs alone feels boring and unmotivating, students arrive from different coding backgrounds, dense slides often explain poorly and lack practical examples, and large lecture halls make class participation intimidating—especially for non-native speakers. Passive reading builds no active reflection process skills. Worse, when students ask normal AI chatbots for help, the AI is overly empathetic: even when we are wrong, AI still says we are right. We asked: what if we turned weekly slides into an adventure game where students learn deeper by teaching a confident-but-flawed AI classmate backed by real Python execution?
What it does
PeerQuest is built around active semester learning (Slides -> Missions), turning boring solo review into a co-op Cosmic Vault Escape against The Off-by-One Glitch Hound (by teaching someone, we learn better).
- Team Up with AI Peer Alex (Running on Amazon Bedrock): Students step through sequential weekly Vault Wings (Week 6: Priority Queues & Binary Heaps, Week 7: Search Trees, Week 8: Hashing & Linear Probing), or drop their own weekly
.pdf,.txt, or.mdlecture slides to generate custom missions right after class. - 3 Sequential Doors per Wing (Turning Slides into Active Reflection):
- Door 1 (Warmup Check): Replace abstract formulas with practical examples validated by 3 Python checks.
- Door 2 (Catch Alex's Bug): Drop a Red Pin on the suspicious line, trigger a deterministic Python Code Verifier guardrail (passing inputs never convince Alex—only a real breaking counterexample works), use the 3-step Hint Ladder if stuck, and resist Alex's confident excuse to patch the code to
v2. - Door 3 (Teach Alex & Run Dreamer): Teach Alex why the invariant works in plain English (designed clearly for non-native speakers) and run Dreamer, a 4-stage offline consolidation step (
Orient -> Gather Signal -> Prune & Resolve Contradictions -> Synthesize Next Chapter Blueprint).
- Dreamer Feature & Adaptive Outcomes:
- 0 mistakes: Unlocks next week's Vault Wing cleanly.
- Mistakes in 1 door: Spawns Door 4, where Alex writes a brand-new bug targeting that exact logged weakness, complete with a "Don't Give In" alert if the student folds to pushback.
- Mistakes in 2+ doors (even after passing): Prompts "Repeat This Week" (Round 2) and regenerates all 3 doors around the student's logged gaps.
- Safety & Rescue Nets: 3 mistakes in a door reveal a plain-English solution summary so learners never stall; hitting
0mon the Chase HUD launches a Glitch Hound ambush escape challenge to win back a35mlead.
- Performance Monitor & Auditability: Tracks skill mastery deltas, persistent weakness counts (kept even after passing), Dreamer logs, and searchable S3 lecture notes—helping first-year students enjoy learning more, foster critical thinking, strengthen active reflection skills, raise course evaluation feedback, and earn better grades—with a live Agent Trace drawer auditing every guardrail and tool call.
How we built it
- Frontend: Next.js 15, React 19, TypeScript, custom obsidian-violet cosmic CSS (
frontend/app/globals.css), Chase HUD (ChaseHud.tsx), sequential Door views (WarmupMission.tsx,BugHuntMission.tsx,DreamerMission.tsx), escape/reward modals (MonsterCaughtModal.tsx,RewardOverlay.tsx), PDF slide uploader (UploadSlidesModal.tsx), and live Agent Trace drawer (AppShell.tsx). - Backend & Agent Orchestrator: Python FastAPI (
backend/main.py) with aplan -> act -> observeorchestrator (backend/orchestrator.py,step_budget=6), tool registry (search_notes,run_tests,grade_answer,generate_exercise,schedule_review), andpypdfGerman LaTeX-aware slide parser (backend/parser.py). - Deterministic Verifier & Guardrails: Real Python execution engine (
backend/verifier.py,step_budget=64) and centralized guardrails (backend/guardrails.py) enforcing prompt-injection blocking, strict Pydantic v2 schema validation (extra="forbid", strict=True), path-ID safety, CORS origin allowlisting, and non-concession rules (enforce_peer_output()). - AI & AWS Cloud Stack (
eu-central-1):Amazon Bedrock(eu.amazon.nova-pro-v1:0andeu.amazon.nova-lite-v1:0) with automatic failover to OpenRouter (openai/gpt-4o-mini) and deterministic localdemo_fallback, backed byAmazon DynamoDB(team11-peerquest-memory) andAmazon S3(team11-peerquest-notes) with automatic in-memory fallback.
Challenges we ran into
- Preventing LLM Sycophancy & Soft-Locks: Even with careful prompting, LLMs want to be polite and agree early—or converse forever. Pairing
can_peer_concede()inbackend/verifier.pywithenforce_peer_output()guarantees Alex only concedes after a verified Python failure, while limiting pushback to 1 structured defense. - Persistent Weaknesses Without Frustrating Learners: Resetting mistakes when a learner eventually passed erased valuable Dreamer signal; failing endlessly trapped beginners. Keeping permanent mistake logs per week (
WeaknessLogEntrySchema), revealing a plain-English solution at 3 mistakes, adding Door 4 for 1-door gaps, and regenerating Round 2 on 2+ door gaps solved both. - Arbitrary Lecture Slide Ingestion: Real German university slides (TUM
IN0007) mix broken LaTeX umlauts and non-matching topics. We added deterministic umlaut normalization plus dynamic LLM-backed custom Warmup and Teach generation (CustomWarmupSchema,CustomTeachSpecSchema), chronological week locking (Week 5unlocks before openWeek 6;Week 9stays locked afterWeek 8), and deterministic procedural PNG wing art (backend/story_art.py) so uploaded wings never reuse artwork.
Accomplishments that we're proud of
- End-to-end working full-stack application with zero fake UI mocks: real Python execution, live Amazon Bedrock Nova Pro/Lite structured outputs, live DynamoDB persistence across server restarts, and live S3 note storage.
- True multi-outcome Dreamer adaptation verified across automated backend tests (
test_core.py,test_content_and_prompts.py,test_security_and_agent.py,test_storage.py,test_dreamer_weakness.py) and TypeScript/Next.js builds (tsc --noEmit,next build). - Polished UX that explains every failure in plain English and surfaces a judge-ready Agent Trace drawer without cluttering student screens.
What we learned
- Combining a deterministic code verifier + strict
Pydantic v2schema boundary makes small fast models (Nova LiteandNova Pro) feel rock-solid and pedagogically honest. - Recording mistake frequencies separately from pass/fail completion (
passed_mission+cycle_count) is essential for genuine spaced adaptation rather than one-shot quizzing.
What's next for PeerQuest
- Instructor & TA cohort dashboards aggregating anonymized class-wide blind spots (such as tombstone skips or off-by-one loop bounds) from DynamoDB.
- Expanded sandboxed Verifier tracks for graph algorithms (BFS/DFS cycles), dynamic programming recurrences, and multi-language C++/Java snippets.
Built With
- ai-agents
- amazon-bedrock
- amazon-dynamodb
- amazon-nova
- amazon-web-services
- edtech
- fastapi
- guardrails
- nextjs
- pydantic
- pypdf
- python
- rag
- react
- typescript
- uvicorn