An AI-powered interactive notebook application that helps you create, organize, and analyze content from various sources. SourcebookLM combines document processing, AI-generated insights, and interactive learning tools to transform your documents, URLs, and YouTube videos into structured knowledge.
-
Multi-Source Content Ingestion
- Upload and extract text from PDF, DOCX, DOC, TXT, MD, CSV, and LOG files
- Extract content from web URLs
- Download and process YouTube video transcripts
-
AI-Powered Tools
- Chat: Interactive AI assistant with context awareness
- Mind Maps: Generate hierarchical mind maps from your content
- Reports: Create structured reports with executive summaries and findings
- Flashcards: Generate educational flashcards for studying
- Quiz: Create multiple-choice quizzes with explanations
- Slides: Generate presentation slide decks
-
Notebook Management
- Create and organize multiple notebooks
- Save and load notebook states
- Persistent storage with MongoDB
- Track sources and conversation history
- Python 3.8 or higher
- MongoDB database (local or cloud-based like MongoDB Atlas)
- Google Gemini API key
-
Clone the repository
git clone https://github.com/truepushkar/SourcebookLM.git cd SourcebookLM -
Create a virtual environment (recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
Create a
.envfile in the root directory based onsample.env:cp sample.env .env
Edit
.envand add your credentials:MONGO_URI=mongodb://localhost:27017/ # Or your MongoDB Atlas connection string GEMINI_API_KEY=your_gemini_api_key_here
- Local MongoDB: Install MongoDB locally and use
mongodb://localhost:27017/ - MongoDB Atlas: Create a free cluster at mongodb.com/cloud/atlas and use the provided connection string
- Visit Google AI Studio
- Create a new API key
- Add it to your
.envfile
-
Start the application
python app.py
-
Access the application
Open your web browser and navigate to:
http://localhost:5000 -
Create a notebook
- Click "New Notebook" from the dashboard
- Add sources by uploading files, entering URLs, or YouTube video links
- Use the AI tools to analyze and transform your content
-
Interact with your content
- Chat with the AI about your sources
- Generate mind maps to visualize concepts
- Create reports and summaries
- Build flashcards for study sessions
- Generate quizzes to test your knowledge
SourcebookLM/
├── app.py # Main Flask application
├── generative.py # AI/Gemini integration
├── upload_text.py # Document and content extraction
├── requirements.txt # Python dependencies
├── sample.env # Environment variables template
├── templates/ # HTML templates
│ ├── dashboard.html # Main dashboard
│ └── notebook.html # Notebook interface
└── static/ # Static assets
├── styles.css # Stylesheets
├── app.js # Main application logic
├── dashboard.js # Dashboard functionality
├── mindmap.js # Mind map visualization
├── report.js # Report generation
├── flashcards.js # Flashcard interface
└── quiz.js # Quiz functionality
GET /api/notebooks- List all notebooksPOST /api/notebooks- Create or update a notebookGET /api/notebooks/<id>- Load a specific notebookDELETE /api/notebooks/<id>- Delete a notebook
POST /api/upload- Upload and extract text from filesPOST /api/extract_url- Extract content from a URLPOST /api/extract_youtube- Extract YouTube video transcript
POST /api/chat- Chat with AI assistantPOST /api/tool_action- Generate content with AI tools (mindmap, reports, flashcards, quiz, slides)
- Backend: Flask (Python web framework)
- Database: MongoDB (document storage)
- AI: Google Gemini API (generative AI)
- Document Processing: PyMuPDF, python-docx, mammoth
- Web Scraping: BeautifulSoup4, requests
- YouTube: youtube-transcript-api
- Frontend: HTML, CSS, JavaScript
This project is licensed under the MIT License. See the LICENSE file for details.
Pushkar Singh
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on the GitHub repository.
- Google Gemini API for AI capabilities
- MongoDB for database solutions
- The open-source community for the excellent libraries used in this project