Skip to content

ukimsanov/lectureflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LectureFlow

AI-Powered Lecture Notes Generator with Multi-Agent Orchestration

Transform any YouTube lecture into comprehensive notes, flashcards, quizzes, and podcast discussions.

CI Next.js FastAPI LangGraph License

Live Demo · API Docs


Features

Feature Description
Real-Time Streaming ChatGPT-style SSE streaming shows notes generating live
Multi-Agent AI LangGraph orchestrates 3 agents running in parallel
Smart Caching 99% cost reduction on repeat videos (7-day cache)
Study Tools Auto-generated flashcards and quizzes
Audio Podcast NotebookLM-style two-host discussions
PDF Export Download professional markdown-formatted notes

Tech Stack

Frontend

  • Next.js 15 with App Router and Server Components
  • React 19 with Streaming SSR
  • Tailwind CSS v4 with OKLCH colors
  • shadcn/ui + Magic UI for animations

Backend

  • FastAPI with async/await
  • LangGraph 1.0 multi-agent orchestration
  • Gemini 2.5 Flash for summarization
  • GPT-4o-mini for concept extraction
  • ElevenLabs for podcast TTS

Infrastructure

  • PostgreSQL with SQLAlchemy 2.0 async
  • Docker + Cloudflare Tunnel for backend API
  • Cloudflare Workers for frontend hosting

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    Frontend (Next.js 15)                     │
│  EventSource SSE → Real-time streaming UI                   │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                    Backend (FastAPI)                         │
│  ┌─────────────────────────────────────────────────────┐    │
│  │              LangGraph StateGraph                    │    │
│  │                                                      │    │
│  │    Agent 1: Transcript Extractor                    │    │
│  │         │                                            │    │
│  │         ├────────────┬────────────┐                 │    │
│  │         ▼            ▼            ▼                 │    │
│  │    Agent 2:     Agent 3:     Agent 4:              │    │
│  │    Notes Gen    Concepts     Study Tools           │    │
│  │    (Gemini)     (GPT-4o)     (GPT-4o)              │    │
│  │    [PARALLEL]   [PARALLEL]   [ON-DEMAND]           │    │
│  │         │            │            │                 │    │
│  │         └────────────┴────────────┘                 │    │
│  │                      │                               │    │
│  │                      ▼                               │    │
│  │              Save to PostgreSQL                      │    │
│  └─────────────────────────────────────────────────────┘    │
└─────────────────────────────────────────────────────────────┘

Quick Start

Prerequisites

Backend

cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env  # Add your API keys
alembic upgrade head
uvicorn app.main:app --reload

Frontend

cd frontend
npm install
npm run dev

Open http://localhost:3000


API Endpoints

Method Endpoint Description
GET /api/process/stream SSE streaming processing
POST /api/study-materials/generate Generate flashcards & quiz
POST /api/podcast/generate Generate audio podcast
GET /api/history List processing history
GET /api/presets Demo video presets

Full API docs: http://localhost:8000/docs


Deployment

Backend (Docker + Cloudflare Tunnel)

cd backend
cp .env.example .env.docker  # Add your API keys + tunnel token
docker compose --env-file .env.docker up -d
docker compose exec api alembic upgrade head

See docker-compose.yml for infrastructure configuration.

Frontend (Cloudflare Workers)

cd frontend
npm install
npm run deploy

Environment variables are configured in wrangler.toml.


Project Structure

lectureflow/
├── frontend/                 # Next.js 15 application
│   ├── src/app/             # App Router pages
│   ├── src/components/      # React components
│   └── wrangler.toml        # Cloudflare Workers config
└── backend/                  # FastAPI application
    ├── app/
    │   ├── main.py          # FastAPI app & endpoints
    │   ├── models.py        # Pydantic models
    │   ├── agents/          # LangGraph orchestration
    │   ├── tools/           # AI processing tools
    │   └── database/        # SQLAlchemy models
    ├── docker-compose.yml   # Docker orchestration
    └── Dockerfile           # Container build

Performance

Metric Value
Fresh processing 15-30 seconds
Cached processing < 1 second
Cost savings 99% on repeat videos

License

MIT License - see LICENSE for details.


Built with LangGraph · FastAPI · Next.js

About

AI-Powered Lecture Notes Generator with Multi-Agent Orchestration. Transform any YouTube lecture into comprehensive notes, flashcards, quizzes, and podcast discussions.

Topics

Resources

License

Stars

Watchers

Forks

Contributors