This project creates short AI-powered video courses from a topic prompt.
- Generates a course layout (chapters + subtopics)
- Generates slide content and narration
- Generates audio (TTS) for each slide
- Stores courses/slides in Postgres with strict user ownership
- Supports multiple AI providers/models
- Includes two chatbot modes:
- Course chat (ask questions about the current course)
- Home topic chat (query previous records by topic, upload PDF if no records exist)
- Uses Pinecone RAG + local Ollama embeddings for retrieval
- Uses Clerk for authentication across the app and API routes
- Next.js (App Router)
- TypeScript
- Drizzle ORM + Neon/Postgres
- Ollama (local LLM + embeddings)
- Pinecone (RAG vector store)
- Optional providers for slide generation:
- Kimi (Moonshot)
- Gemini
- OpenAI
- Install dependencies
npm install- Configure environment variables in
.env(or.env.local)
Minimum local setup:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=replace_me
CLERK_SECRET_KEY=replace_me
AUDIO_STORAGE=local
OLLAMA_BASE_URL=http://127.0.0.1:11434
OLLAMA_MODEL=mistral:latest
OLLAMA_EMBED_MODEL=nomic-embed-text
OLLAMA_REQUEST_TIMEOUT_MS=1800000
PINECONE_API_KEY=replace_me
PINECONE_INDEX_HOST=replace_me
PINECONE_NAMESPACE_PREFIX=courseOptional model keys:
MOONSHOT_API_KEY=
MOONSHOT_BASE_URL=https://api.moonshot.ai/v1
MOONSHOT_MODEL=kimi-k2.5
GEMINI_API_KEY=
GEMINI_API_KEYS=
OPENAI_API_KEY=
OPENAI_BASE_URL=https://api.openai.com/v1- Start Ollama and pull required models
ollama serve
ollama pull mistral:latest
ollama pull nomic-embed-text- Start app
npm run dev- Open app
http://localhost:3000
- Course layout generation uses selected provider mode (
local-ai/global-ai) - Slide generation uses selected Slide Model from UI:
ollama:mistral:latestollama:llama3.1:8bkimi:kimi-k2.5gemini:gemini-2.5-flashopenai:gpt-4o-mini
- If selected slide model fails, system falls back to local Ollama
- Course and slide records are indexed by topic namespace in Pinecone
- Home chat queries previous topic records
- If topic records do not exist, home chat asks user to upload a PDF
- Uploaded PDF text is indexed into Pinecone for later reuse
- Chat answers are generated by local Ollama
POST /api/generate-course-layoutPOST /api/generate-video-contentGET /api/course?courseId=...POST /api/course-chatPOST /api/home-chatPOST /api/rag-upload-pdf
- Route files are canonical under
app/api/*and all protected routes enforce Clerk auth plus user-scoped authorization. - Keep secrets out of git and rotate any key that was ever exposed.