Skip to content

mayur-rane024/IBEX

 
 

Repository files navigation

AI Video Course Generator

This project creates short AI-powered video courses from a topic prompt.

What this system does

  • 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

Tech stack

  • 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

Run locally

  1. Install dependencies
npm install
  1. 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=course

Optional 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
  1. Start Ollama and pull required models
ollama serve
ollama pull mistral:latest
ollama pull nomic-embed-text
  1. Start app
npm run dev
  1. Open app

http://localhost:3000

AI model behavior

  • Course layout generation uses selected provider mode (local-ai / global-ai)
  • Slide generation uses selected Slide Model from UI:
    • ollama:mistral:latest
    • ollama:llama3.1:8b
    • kimi:kimi-k2.5
    • gemini:gemini-2.5-flash
    • openai:gpt-4o-mini
  • If selected slide model fails, system falls back to local Ollama

RAG + chatbot behavior

  • 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

Main API routes

  • POST /api/generate-course-layout
  • POST /api/generate-video-content
  • GET /api/course?courseId=...
  • POST /api/course-chat
  • POST /api/home-chat
  • POST /api/rag-upload-pdf

Notes

  • 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 98.6%
  • Other 1.4%