An AI-powered learning assistant for textbooks, lecture notes, and educational documents using Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG).
The system automatically extracts educational content, generates hierarchical summaries, builds a searchable vector database, creates AI-generated flashcards for active recall, and enables question answering over uploaded learning materials through an interactive Streamlit interface.
output_video.mp4
- 📚 Automatic textbook and document extraction
- 📝 Hierarchical chapter and section summarization
- 💬 RAG-based Question Answering
- 🧠 AI-generated flashcards for active recall
- 📊 Figure and table caption extraction
- 📖 Interactive learning library
- 🌐 Streamlit-based user interface
Educational Documents (PDF)
│
▼
Content Extraction
(Text, Figures, Tables)
│
▼
Section Detection
│
▼
Hierarchical Summarization
│
┌───────┴────────┐
▼ ▼
Vector Database Flashcard
(ChromaDB) Generation (LLM)
│
▼
RAG Question Answering
Large documents are automatically divided into logical sections. Each section is summarized individually before producing an overall document summary, preserving the structure and key concepts of the learning material.
The assistant generates question-answer flashcards directly from each major section of the document. The generated flashcards are designed to promote active recall and improve long-term retention.
Users can ask natural language questions about any uploaded document. Relevant passages are retrieved from the vector database and combined with an LLM to generate accurate, context-aware answers.
- Python
- Streamlit
- LangChain
- Google Gemini
- Ollama
- ChromaDB
- Hugging Face
- Poetry
git clone https://github.com/Hosein541/ai-learning-assistant.git
cd ai-learning-assistantpip install poetry
poetry installMake sure Ollama is installed and running.
ollama pull embeddinggemmaStart the Ollama server:
ollama servepoetry run streamlit run app.pyBefore starting a session, provide:
- Google Gemini API Key
- Hugging Face Access Token
These credentials are entered through the application interface and are used only during the current session.
extractor/ # PDF extraction pipeline
summarize/ # Hierarchical summarization
flashcards/ # Flashcard generation
qa_chain/ # RAG question answering
vector_db/ # Chroma vector database
pages/ # Streamlit pages
inputs/ # Uploaded documents
outputs/ # Generated artifacts
pipeline.py # Main processing pipeline
app.py # Streamlit application
-
Upload one or more educational documents.
-
Configure the required API keys.
-
Start a processing session.
-
The system automatically:
- extracts document contents,
- detects document sections,
- generates hierarchical summaries,
- builds the vector database,
- creates AI-generated flashcards.
-
Explore the processed documents through:
- Library
- Question Answering
- Flashcards
This project is intended for educational and learning purposes.