https://github.com/ginga1402/studybuddy-open-source-rag-notebooklm
StudyBuddy is an open source, RAG-based AI assistant that lets you query, summarize, and interact with your documentsโbuilt as a developer-friendly alternative to Google NotebookLM.
https://github.com/ginga1402/studybuddy-open-source-rag-notebooklm
generative-ai langchain llm python rag streamlit
Last synced: 10 months ago
JSON representation
StudyBuddy is an open source, RAG-based AI assistant that lets you query, summarize, and interact with your documentsโbuilt as a developer-friendly alternative to Google NotebookLM.
- Host: GitHub
- URL: https://github.com/ginga1402/studybuddy-open-source-rag-notebooklm
- Owner: Ginga1402
- License: mit
- Created: 2025-07-23T17:54:56.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-20T17:56:22.000Z (10 months ago)
- Last Synced: 2025-08-20T19:43:53.203Z (10 months ago)
- Topics: generative-ai, langchain, llm, python, rag, streamlit
- Language: Python
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ StudyBuddy โ Open Source RAG-Based AI Notebook and Google NotebookLM Alternative
**StudyBuddy is a free, open source alternative to Google NotebookLM that lets you chat with your documents, generate smart summaries, and organize knowledge with AIโall securely on your terms.**
## ๐ฏ Project Description
StudyBuddy is a comprehensive Retrieval-Augmented Generation (RAG) system that transforms static PDF documents into interactive learning experiences. Built with FastAPI and Streamlit, it leverages advanced AI technologies including HuggingFace embeddings, FAISS vector databases, and Large Language Models to create an intelligent document analysis platform.
### Technical Architecture
- **RAG Pipeline**: Implements state-of-the-art retrieval-augmented generation for accurate, context-aware responses
- **Vector Database**: Uses FAISS for efficient similarity search and document retrieval
- **Document Processing**: Converts PDFs to structured markdown using Docling for optimal text extraction
- **Embeddings**: Utilizes BGE-small-en-v1.5 embeddings with CUDA acceleration for fast processing
- **LLM Integration**: Powered by Gemma3:12b-it-q4_K_M via Ollama for high-quality text generation
- **Topic Modeling**: Implements LDA (Latent Dirichlet Allocation) for intelligent topic discovery
### Key Features
- **Document Ingestion**: Upload and process multiple PDFs into searchable knowledge bases
- **Interactive Q&A**: Chat with your documents using natural language queries
- **Smart Summaries**: Generate student-friendly summaries with key concepts and formulas
- **Visual Diagrams**: Create ASCII flowcharts and concept maps
- **Quiz Generation**: Automatically generate multiple-choice questions for self-assessment
- **FAQ Creation**: Extract frequently asked questions from document content
- **Topic Extraction**: Discover and organize important themes using AI-powered analysis
- **Analytics Dashboard**: Monitor usage patterns and system performance
## ๐ Project Structure
```
StudyBuddy/
โโโ configuration.py # System configuration and model setup
โโโ FastAPI.py # Main API server with all endpoints
โโโ streamlit_ui_fixed.py # Enhanced web interface
โโโ ingestion.py # PDF processing and vector store creation
โโโ QA_Rag.py # Question-answering RAG implementation
โโโ create_summary.py # Document summarization module
โโโ create_diagram.py # ASCII diagram generation
โโโ create_quiz.py # Quiz generation system
โโโ create_faq.py # FAQ extraction module
โโโ create_topics.py # Topic modeling and extraction
โโโ Sample_outputs/ # Example outputs and demonstrations
โโโ Data/ # PDF document storage directory
โโโ vector_store/ # FAISS vector database storage
```
## ๐ Use Cases
### ๐ **Education & Learning**
- **Students**: Convert textbooks into interactive study materials with summaries, quizzes, and Q&A
- **Teachers**: Create educational content and assessments from curriculum documents
- **Researchers**: Analyze academic papers and extract key insights quickly
### ๐ผ **Professional & Business**
- **Knowledge Management**: Transform company documents into searchable knowledge bases
- **Training Materials**: Create interactive training modules from policy documents
- **Research & Development**: Analyze technical documentation and generate insights
### ๐ฅ **Specialized Domains**
- **Medical Education**: Process medical textbooks for case studies and exam preparation
- **Legal Research**: Analyze legal documents and extract relevant precedents
- **Technical Documentation**: Create interactive guides from complex technical manuals
---
## ๐ฌ Demo Video
See StudyBuddy in action! Watch our comprehensive demo showcasing all features:
[](link-to-your-video-file.mp4)
### ๐น What's Covered in the Demo:
- **PDF Upload & Vector Store Creation**: See how easy it is to upload documents
- **Interactive Q&A**: Real-time question answering with source references
- **Content Generation**: Summaries, quizzes, diagrams, and FAQs in action
- **Analytics Dashboard**: Comprehensive usage tracking and metrics
- **User Interface**: Complete walkthrough of the enhanced Streamlit UI
---
## ๐ ๏ธ Installation Instructions
### Prerequisites
- Python 3.9+
- CUDA-compatible GPU (optional, for faster processing)
- 8GB+ RAM recommended
### Step 1: Clone Repository
```bash
git clone https://github.com/Ginga1402/StudyBuddyโOpenSource-NotebookLM-RAG-Based-AI.git
cd studybuddy
```
### Step 2: Install Dependencies
```bash
pip install -r requirements.txt
```
### Step 3: Set Up Ollama (LLM Backend)
```bash
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull the required model
ollama pull gemma3:12b-it-q4_K_M
```
### Step 4: Configure Paths
Update the paths in `configuration.py` to match your system:
```python
DIRECTORY_PATH = "your/path/to/Data"
VECTORSORE_PATH = "your/path/to/vector_store"
```
## ๐ Usage
### Starting the Application
1. **Start the FastAPI Server**:
```bash
python FastAPI.py
```
The API will be available at `http://localhost:9000`
2. **Launch the Streamlit Interface**:
```bash
streamlit run streamlit_app.py
```
The web interface will open at `http://localhost:8501`
### Basic Workflow
1. **Create Vector Store**: Upload PDF files and create a searchable knowledge base
2. **Generate Content**: Use various features to create summaries, quizzes, diagrams, and FAQs
3. **Interactive Q&A**: Ask questions about your documents and get contextual answers
4. **Download Results**: Save generated content as text files for offline use
5. **Monitor Analytics**: Track usage patterns and system performance
### API Endpoints
- `POST /create-vectorstore/` - Create vector store from PDFs
- `POST /QA-Guide/` - Question-answering with RAG
- `POST /generate-summary/` - Generate document summaries
- `POST /generate-diagram/` - Create ASCII diagrams
- `POST /generate-quiz/` - Generate multiple-choice quizzes
- `POST /generate-FAQ/` - Create frequently asked questions
- `POST /generate-important-topics/` - Extract key topics
- `GET /heartbeat` - Health check endpoint
- `GET /metrics` - System usage metrics
## ๐ง Technologies Used
| Technology | Description | Link |
|------------|-------------|------|
| **FastAPI** | High-performance web framework for building APIs | [fastapi.tiangolo.com](https://fastapi.tiangolo.com/) |
| **Streamlit** | Framework for creating interactive web applications | [streamlit.io](https://streamlit.io/) |
| **LangChain** | Framework for developing LLM-powered applications | [langchain.com](https://www.langchain.com/) |
| **FAISS** | Library for efficient similarity search and clustering | [github.com/facebookresearch/faiss](https://github.com/facebookresearch/faiss) |
| **HuggingFace Transformers** | State-of-the-art ML models and embeddings | [huggingface.co](https://huggingface.co/) |
| **Ollama** | Local LLM runtime for running language models | [ollama.ai](https://ollama.ai/) |
| **Docling** | Advanced document processing and conversion | [github.com/DS4SD/docling](https://github.com/DS4SD/docling) |
| **NLTK** | Natural language processing toolkit | [nltk.org](https://www.nltk.org/) |
| **Gensim** | Topic modeling and document similarity analysis | [radimrehurek.com/gensim](https://radimrehurek.com/gensim/) |
| **PyTorch** | Deep learning framework with CUDA support | [pytorch.org](https://pytorch.org/) |
| **Pandas** | Data manipulation and analysis library | [pandas.pydata.org](https://pandas.pydata.org/) |
| **Pydantic** | Data validation using Python type annotations | [pydantic.dev](https://pydantic.dev/) |
## ๐ค Contributing
Contributions to this project are welcome! If you have ideas for improvements, bug fixes, or new features, feel free to open an issue or submit a pull request.
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## ๐ Star History
If you find StudyBuddy useful, please consider giving it a star โญ on GitHub!