Learn-KuchBhi

Inspiration

We learn best when concepts are explained visually and reinforced through practice. We wanted a way to turn any topic into bite-sized study assets like animated explanations, organized flashcards, and a quick multiplayer quiz, so that students can go from curiosity to understanding in minutes.

Access Credentials

Go to https://kuch-bhi.built.systems/login and use the below credentials to login to the platform.

  • Email: main@built.systems
  • Password: main@built.systems

To see the already generated outputs, navigate to the My Topics and My Videos sections.

What it does

  • AI-powered Manim videos: Type a prompt, get a clean, educational animation. The system upgrades prompts, generates Manim code, lint-fixes it, and renders an MP4 you can stream instantly.
  • Smart flashcards with outlines: It first designs a topic/subtopic outline, then generates high-quality flashcard sets for each subtopic. Progress streams live via Server-Sent Events (SSE).
  • Real-time quiz (two-player or solo): Play a fast multiple-choice quiz on an AI-generated topic set or math mode. WebSockets power low-latency gameplay and score updates.
  • Accounts and persistence: Authenticated users can trigger generations; all runs, videos, and flashcards are stored and queryable.
  • Hosted demo: Live at https://kuch-bhi.built.systems

How we built it

  • Backend: FastAPI app with modular services for video generation, flashcards, and quiz. Uvicorn runs the ASGI server.
  • Video pipeline: Prompt upgrader (Gemini) → Manim code generator (Gemini 2.5 Pro via pydantic-ai) → Ruff lint/auto-fix → preflight → render with Manim/MoviePy → store and serve under /videos.
  • Flashcards: Outline agent + per-subtopic flashcard agents (pydantic-ai). Stores runs and sets in PostgreSQL, streams run status and new sets via SSE.
  • Quiz: In-memory manager with REST + WebSocket endpoints; supports topic-AI or math modes, two players max, auto-start when all players are ready.
  • Data & auth: SQLAlchemy models + Alembic migrations on PostgreSQL; FastAPI-Users for auth with JWT (jwcrypto/pyjwt). Redis for sessions/caching.
  • Ops: uv for Python envs, Docker Compose for local Postgres/Redis, Nginx for TLS, SSE and WS proxying. Context7 integration to fetch docs for the codegen agent.

Challenges we ran into

  • Making LLM-generated Manim code reliably lint-clean and runnable; added iterative lint/runtime fix loops and fallbacks.
  • Containing dependencies per-session for rendering while keeping runs fast and deterministic.
  • Designing an outline-first flashcard flow that scales across many subtopics with live progress via SSE.
  • Building a simple but robust WebSocket quiz loop with fair scoring, timeouts, and auto-start while handling disconnects.
  • Schema evolution and status tracking for long-running jobs across DB tables.

Accomplishments that we're proud of

  • A full end-to-end video pipeline that self-corrects (lint/runtime) and produces clean animations from plain prompts.
  • Multi-agent flashcard generation with persistent runs, per-subtopic sets, and real-time progress streaming.
  • A snappy two-player quiz with both AI-topic and math modes over WebSockets.
  • Production-ready touches: JWT auth, DB migrations, static video serving, Nginx WS/SSE proxying, and environment-based provider selection.

What we learned

  • How to steer LLMs for deterministic, lint-clean code generation with feedback loops.
  • Practical patterns for SSE and WebSockets on FastAPI behind Nginx.
  • Schema design for content generation pipelines and incremental result surfacing.

What's next for Learn-KuchBhi

  • Rich frontend for creation, review, and study flows; shareable links and classrooms.
  • Editable timelines for videos and flashcard curation; export to Anki/CSV.
  • More quiz modes (buzz-in, timed rounds), leaderboards, and persistence.
  • Caching, deduplication, and reuse of assets; cost/latency optimizations.
  • More providers and guardrails; better observability and retry logic.

Built With

  • Python with Pydantic and FastAPI, Uvicorn
  • PostgreSQL, Redis, SQLAlchemy, Alembic, asyncpg
  • Manim, MoviePy
  • pydantic-ai and Google Gemini (google-genai)
  • Server-Sent Events (SSE), WebSockets
  • Nginx (TLS, reverse proxy for SSE/WS)
  • Docker, Docker Compose
  • uv (Python package manager)
  • Context7 API integration for latest docs

Built With

+ 33 more
Share this project:

Updates