An end-to-end Production-Level AI Study Assistant built using LangChain, Google Gemini, and Streamlit. The application generates comprehensive study notes, creates interview/exam questions and answers using RunnableParallel, analyzes user feedback through Sentiment Analysis, and responds intelligently using RunnableBranch (Conditional Chains).
AI Study Assistant is an intelligent learning platform that helps students generate structured study material on any topic using Google's Gemini model through LangChain.
The application demonstrates modern LLM Application Development concepts including:
- Prompt Engineering
- LangChain Chains
- RunnableParallel
- RunnableBranch
- Output Parsing
- Pipeline Architecture
- Production-Level Project Structure
- Exception Handling
- Logging
- Streamlit Deployment
Generate detailed notes on any topic.
Each generated note includes:
- Introduction
- Explanation
- Important Concepts
- Examples
- Advantages
- Disadvantages
- Applications
- Summary
After generating notes, the application simultaneously creates:
- ✅ 5 Interview / Exam Questions
- ✅ Short Answers
using LangChain's
- RunnableParallel
Users can provide feedback after reading the notes.
Example:
These notes were amazing!
or
I didn't understand the explanation.
The feedback is automatically classified into:
- Positive
- Negative
- Neutral
using
- LangChain
- Gemini
- Pydantic Output Parser
Depending on the detected sentiment, the application generates an intelligent response.
Positive →
Thank the user.
Negative →
Apologize and offer better explanations.
Neutral →
Appreciate the feedback professionally.
The application logs:
- Application Start
- Topic Entered
- Notes Generated
- Questions Generated
- Answers Generated
- Feedback Received
- Sentiment Detected
- Errors
Logs are stored inside
logs/app.log
Custom exception handling is implemented across the project.
The application gracefully handles
- Invalid API Keys
- Empty Inputs
- API Errors
- Runtime Exceptions
without crashing.
User
│
▼
Streamlit Interface
│
▼
Notes Generation Chain
│
▼
Generated Study Notes
│
▼
RunnableParallel
┌────────────┴────────────┐
▼ ▼
Question Chain Answer Chain
│ │
└────────────┬────────────┘
▼
Display Results
│
▼
User Feedback
│
▼
Sentiment Analysis Chain
│
▼
Positive / Negative / Neutral
│
▼
RunnableBranch
┌────────┬────────┬────────┐
▼ ▼ ▼
Positive Negative Neutral
│ │ │
└────────┴────────┘
▼
AI Response
AI_Study_Assistant/
│
├── app.py
│
├── requirements.txt
├── setup.py
├── README.md
├── LICENSE
├── .gitignore
├── .env
│
├── assets/
│ └── screenshots
│
├── logs/
│ └── app.log
│
├── config/
│ ├── __init__.py
| └── config.py
├── Dockerfile
|
├──.dockerignore
│
├── src/
│
│ ├── constants.py
│ ├── prompt.py
│ ├── parser.py
│ ├── llm.py
│ ├── chains.py
│ ├── logger.py
│ ├── utils.py
│ ├── exception.py
│ │
│ └── pipeline/
│ ├── notes_pipeline.py
│ ├── parallel_pipeline.py
│ ├── sentiment_pipeline.py
│ └── conditional_pipeline.py
│
└── templates/
| Technology | Purpose |
|---|---|
| Python | Programming Language |
| LangChain | LLM Orchestration |
| Google Gemini 2.5 Flash | Large Language Model |
| Streamlit | Frontend |
| Pydantic | Structured Output Parsing |
| python-dotenv | Environment Variables |
| Logging | Application Monitoring |
| pathlib | File Management |
| setuptools | Packaging |
This project demonstrates multiple LangChain concepts.
Used for
- Notes Generation
- Question Generation
- Answer Generation
- Sentiment Analysis
- AI Responses
Used for
Generating
- Questions
- Answers
simultaneously.
Used for
Conditional AI Responses
based on
- Positive
- Negative
- Neutral
sentiment.
- StrOutputParser
- PydanticOutputParser
Every prompt is stored separately inside
src/prompt.py
making the project modular.
git clone https://github.com/Shravan4598/AI-Study-Assistant-using-LangChain.git
cd AI-Study=Assistant-using-Langchainpython -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a file named
.env
Add
GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY
MODEL_NAME=gemini-2.5-flash
TEMPERATURE=0.3
MAX_OUTPUT_TOKENS=2048streamlit run app.pyUser enters Topic
│
▼
Generate Notes
│
▼
RunnableParallel
│
┌──────┴────────┐
▼ ▼
Questions Answers
│
▼
Display
│
▼
Feedback
│
▼
Sentiment Analysis
│
▼
RunnableBranch
│
▼
AI Response
- PDF Export
- Voice-based Learning
- Flashcard Generation
- Quiz Evaluation
- Chat with Notes
- Retrieval-Augmented Generation (RAG)
- Multi-language Support
- Authentication
- Study History
- Database Integration
- Dark Mode
- Docker Deployment
- CI/CD Pipeline
- Cloud Deployment (AWS, Azure, GCP)
This project demonstrates knowledge of
- Prompt Engineering
- LangChain
- RunnableParallel
- RunnableBranch
- Output Parsers
- LLM Integration
- Google Gemini API
- Streamlit
- Modular Python Development
- Logging
- Exception Handling
- Production-Level Project Architecture
Contributions are welcome!
-
Fork the repository
-
Create a feature branch
git checkout -b feature-name- Commit your changes
git commit -m "Added new feature"- Push to GitHub
git push origin feature-name- Create a Pull Request
This project is licensed under the MIT License.
Shravan Kumar Pandey
B.Tech (Hons.) Data Science
GitHub: https://github.com/Shravan4598
LinkedIn: https://www.linkedin.com/in/shravan-kumar-pandey-309786309/
Email: shravankumarpandey825412@gmail.com
Please consider giving this repository a ⭐ on GitHub!
It motivates further development and helps others discover the project.




