An AI-powered study assistant — your personal NotebookLM clone built with Next.js and FastAPI.
StudyFlow lets you create research notebooks, ingest sources (PDFs, URLs, YouTube transcripts), and chat with your material using Google Gemini. It also generates study guides, flashcards, and mind maps from your notes via an AI Studio panel.
- 📓 Notebooks — Organize study material into separate notebooks
- 📥 Source Ingestion — Add PDFs, web pages, and YouTube videos as sources
- 💬 AI Chat — Ask questions about your sources using RAG (Retrieval-Augmented Generation)
- 🗒️ Notes — Take inline notes linked to notebooks
- 🎓 Study Studio — Generate study guides, flashcards, and mind maps powered by Gemini
- 🔍 Semantic Search — Local embeddings via
sentence-transformersfor fast, private search - 🗄️ Persistent Storage — PostgreSQL + ChromaDB vector store
| Layer | Technology |
|---|---|
| Frontend | Next.js 14, TypeScript, Tailwind CSS, Tiptap, ReactFlow |
| Backend | FastAPI, Python 3.11+, Uvicorn |
| Database | PostgreSQL (via SQLAlchemy + asyncpg + Alembic) |
| Vector Store | ChromaDB |
| Embeddings | sentence-transformers (local, no API cost) |
| LLM | Google Gemini (via google-generativeai) |
| PDF Parsing | PyMuPDF |
| Web Scraping | BeautifulSoup4 + httpx |
| YouTube | youtube-transcript-api |
- Node.js 18+ and npm
- Python 3.11+
- PostgreSQL (running locally or via Docker)
- A Google Gemini API key — get one at ai.google.dev
git clone https://github.com/Sridattasai18/StudyFlow.git
cd StudyFlowcd backend
# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt
# Configure environment variables
copy .env.example .env # Windows
# cp .env.example .env # macOS/LinuxEdit backend/.env and fill in your values:
GEMINI_API_KEY=your_gemini_api_key_here
DATABASE_URL=postgresql+asyncpg://postgres:yourpassword@localhost:5432/studyflow
CHROMA_PERSIST_PATH=./chroma_store
UPLOAD_DIR=./storage/uploads
CORS_ORIGINS=http://localhost:3000Run database migrations:
alembic upgrade headStart the backend server:
uvicorn main:app --reload --port 8000Backend will be live at http://localhost:8000. API docs at http://localhost:8000/docs.
# From the project root
npm install
# Configure environment variables
copy .env.local.example .env.local # if providedCreate .env.local in the project root:
NEXT_PUBLIC_API_URL=http://localhost:8000Start the development server:
npm run devFrontend will be live at http://localhost:3000.
studyflow/
├── backend/
│ ├── api/ # FastAPI route handlers (notebooks, sources, chat, studio, notes)
│ ├── db/ # SQLAlchemy models & database engine
│ ├── services/ # Core logic: embeddings, RAG, LLM, ingestion, chunker
│ ├── alembic/ # Database migrations
│ ├── storage/ # Uploaded file storage
│ ├── chroma_store/ # ChromaDB vector data (auto-generated)
│ ├── main.py # FastAPI app entry point
│ ├── config.py # Settings via pydantic-settings
│ └── requirements.txt
│
├── src/
│ ├── app/ # Next.js app router pages
│ ├── components/ # UI components (chat, notes, sources, studio, layout)
│ ├── context/ # React context providers
│ ├── lib/ # API client utilities
│ └── types/ # TypeScript types
│
├── package.json
├── tailwind.config.ts
└── next.config.mjs
| Variable | Description | Required |
|---|---|---|
GEMINI_API_KEY |
Google Gemini API key | ✅ Yes |
DATABASE_URL |
PostgreSQL connection string | ✅ Yes |
CHROMA_PERSIST_PATH |
Path for ChromaDB persistence | ✅ Yes |
UPLOAD_DIR |
Directory for uploaded files | ✅ Yes |
CORS_ORIGINS |
Allowed origins (comma-separated) | ✅ Yes |
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_API_URL |
Backend API base URL | ✅ Yes |
This project is licensed under the MIT License — see LICENSE for details.
Kaligotla Sri Datta Sai Vithal
GitHub: @Sridattasai18