How rudr-automates/horizon-prototype works
Horizon is a timestamp-aware learning assistant: a learner watches a lesson, pauses at a playhead, asks a question, and receives cited claims drawn only from eligible evidence—or a refusal. The learning studio also exposes transcript, materials, notes, progress, and system status; the home page offers course discovery and resume. The graph combines sampled source relationships with README-documented product behavior. Some subsystems, including retrieval backends and several studio panels, were not excerpted, so their internal wiring is not inferred.
Main entry points: learning-studio.tsx Learning studio · pipeline.ts Answer pipeline · index.ts Evidence retrieval · route.ts Question endpoint
Components 24
Learner experience
- Home and course entry
src/components/home/home-experience.tsx - Learning studio
src/components/learning-studio.tsx - Question assistant
src/components/lesson/assistant-panel.tsx - Notes and progress
src/components/personal/notes-panel.tsx - System status
src/components/status/status-panel.tsx
Lesson and materials
- Lesson video
src/components/lesson-video.tsx - Transcript pane
src/components/lesson/transcript-panel.tsx - Materials library
src/components/materials/materials-panel.tsx
Grounded answers
- Answer pipeline
src/lib/answer/pipeline.ts - Position eligibility
src/lib/eligibility/predicate.ts - Evidence retrieval
src/lib/retrieval/index.ts - Model providers
src/lib/answer/providers.ts
Application APIs
- Video endpoint
src/app/api/v1/lesson/video/route.ts - Transcript endpoint
src/app/api/v1/courses/[courseId]/transcript/route.ts - Resource endpoints
src/app/api/v1/courses/[courseId]/resources/route.ts - Question endpoint
src/app/api/v1/courses/[courseId]/questions/route.ts - Health endpoints
src/app/api/v1/health/route.ts
Runtime and storage
- Request context
src/lib/server/context.ts - Evidence database
src/lib/retrieval/supabase-store.ts - Learner local data
src/lib/personal/local-store.ts
Other components
- Learner
- AI provider services
- YouTube player
- Supabase
Connections 29
- Learner → Home and course entry: opens
- Learner → Learning studio: studies in
- Home and course entry → Learning studio: continues lesson
- Learning studio → Lesson video: shows player
src/components/learning-studio.tsx - Learning studio → Question assistant: shows assistant
src/components/learning-studio.tsx - Learning studio → Transcript pane: shows transcript
src/components/learning-studio.tsx - Learning studio → Materials library: shows library
src/components/learning-studio.tsx - Learning studio → Notes and progress: shows panels
src/components/learning-studio.tsx - Learning studio → System status: shows status
src/components/learning-studio.tsx - Question assistant → Question endpoint: submits question
- Question endpoint → Request context: builds dependencies
src/app/api/v1/courses/[courseId]/questions/route.ts - Question endpoint → Answer pipeline: calls
src/app/api/v1/courses/[courseId]/questions/route.ts - Answer pipeline → Position eligibility: filters by position
src/lib/answer/pipeline.ts - Answer pipeline → Evidence retrieval: retrieves evidence
src/lib/answer/pipeline.ts - Answer pipeline → Model providers: generates and verifies
src/lib/answer/pipeline.ts - Model providers → AI provider services: calls models
src/lib/answer/providers.ts - Evidence retrieval → Evidence database: reads evidence
- Answer pipeline → Question assistant: returns cited answer
- Lesson video → Video endpoint: requests local video
- Video endpoint → YouTube player: falls back to embed
- Transcript pane → Transcript endpoint: requests passages
- Transcript endpoint → Evidence retrieval: reads eligible captions
src/app/api/v1/courses/[courseId]/transcript/route.ts - Materials library → Resource endpoints: requests resources
- Notes and progress → Learner local data: reads and writes
- System status → Health endpoints: requests health
- Health endpoints → Supabase: probes database
- Request context → Model providers: creates providers
src/lib/server/context.ts - Request context → Evidence retrieval: resolves store
src/lib/server/context.ts - Evidence database → Supabase: queries