StudyLens AI is an AI-powered study assistant that helps students understand study material, simplify complex concepts, prepare exam-oriented answers, and analyze question papers using Google Gemini.
- Overview
- Problem Statement
- Solution
- Key Features
- How It Works
- Exam-Oriented Learning
- Question Paper Analysis
- Multilingual Support
- Screenshots
- Tech Stack
- Project Structure
- Getting Started
- Configuration
- Scope and Limitations
- Future Enhancements
- Documentation
- License
StudyLens AI is a Streamlit web application that turns photographed study material into an interactive study session.
Students commonly work with material such as:
- textbook pages
- handwritten and classroom notes
- diagrams and labelled figures
- technical study material
- question papers
- previous-year papers
Instead of reading through everything manually, a student can photograph the material and study it conversationally. The student uploads an image of the material, and StudyLens AI reads the visible text, headings, questions, formulas, diagrams, labels, and captions in that image. The uploaded image and the conversation are then sent to a Google Gemini multimodal model, which responds with explanations, summaries, important points, or exam-oriented answers depending on what the student asks for.
Because the app keeps a single Gemini chat session alive for the study session, follow-up questions such as "explain this in 5 marks" or "give the important points" continue from the study material already uploaded β the student does not need to upload the same page again.
StudyLens AI is intentionally built as a focused single-purpose tool: image-based study understanding with a conversational follow-up loop.
Students routinely face the following difficulties while preparing for exams:
- Lengthy material β a single textbook page or chapter can contain more information than a student can process in one reading.
- Technical concepts β definitions, architectures, and processes are often written in dense academic language that is hard to convert into a simple understanding.
- Identifying what matters β students struggle to separate the important points from supporting detail.
- Answer length for marks β the same topic needs a short answer for 2 marks and a structured answer for 16 marks, and this restructuring takes effort.
- Repeated questions β students want to know which questions repeat across the question papers they have collected, but comparing many papers manually is slow.
These are everyday study-workflow problems, not exotic ones β and they are exactly the problems a multimodal study assistant can reduce.
StudyLens AI provides an image-based conversational learning workflow built on Gemini's multimodal capabilities. The student photographs the material, and the assistant reads it and explains it in the way the student asks for.
Upload study material
β
AI analyzes the content
β
Understand the topic
β
Get summary / important points
β
Ask follow-up questions
β
Prepare exam-oriented answers
The study material in the image is treated as the primary source. The assistant's instructions require it to use the terminology, formulas, questions, and structure that are actually present in the uploaded material, to say when something is not supported by the material, and to label any general knowledge separately. Answers are never lengthened with invented information.
| Feature | Description |
|---|---|
| π· Image-based Study Analysis | Upload a photo of a textbook page, notes, question paper, question bank, diagram, or previous-year paper and have it read and analyzed |
| π Simple Explanations | Complex or densely written concepts are re-explained in student-friendly language |
| π Summaries | Uploaded material is converted into an easy, concise summary |
| β Important Points | Key concepts, definitions, formulas, and processes supported by the material are listed out |
| π’ Step-by-Step Explanation | Processes, work flows, and "working" questions are explained as numbered steps in the order of the material |
| βοΈ Exam Answers | Answers are generated according to the requested marks (2, 5, 10, 13, 15, or 16 marks) |
| π¬ Follow-up Questions | The conversation remembers the chat context and re-attaches the uploaded study image, so follow-ups such as "explain this", "step 7", or "give me a 5-mark answer" work without re-uploading the image |
| π Related Question Suggestions | After each image-based answer, 3-4 topic-specific follow-up questions are offered as one-click buttons |
| π Question Paper Analysis | Uploaded question papers are analyzed for repeated, similar, and concept-level recurring questions |
| π Repeated Questions | Exact repeats, differently worded questions, and same-concept questions are reported separately with frequency evidence |
| π Multilingual Interaction | Ask in English, Tamil, or Tanglish and the assistant answers in the matching language style |
| πΌοΈ Multimodal Input | A single message can contain an image, text, or both (JPG, JPEG, PNG, WEBP) |
| π§ Session-scoped Context | A new study session can be started at any time, which clears the chat and starts a fresh conversation |
| π‘οΈ Safe Answering Rules | The system prompt forbids invented sources, invented exam predictions, and unsupported technical details |
| β» Transient-error Recovery | Failed model calls caused by temporary service errors are retried automatically before showing a friendly message |
Student
β
Student Details
β
StudyLens AI Interface
β
Upload Study Material
β
Image + Text Processing
β
Prompt + Conversation Context
β
Google Gemini Multimodal AI
β
Structured Study Response
β
Student
- Student opens the app and sees the onboarding screen.
- Student details β name and phone number are entered and validated, then kept only in the Streamlit session state.
- StudyLens AI interface β the study workspace opens with a sidebar containing "What you can ask", a New Session button, and the study chat.
- Upload study material β the student attaches an image (and/or types a question) in the chat input.
- Image + text processing β the upload is validated (JPG / JPEG / PNG / WEBP), the image is displayed in the conversation, and the bytes are converted into a multimodal part for the model.
- Prompt + conversation context β the matching prompt is applied: the full image analysis prompt for an image-only upload, or the student's own question when text is supplied. Every follow-up re-attaches the stored study image together with the follow-up prompt, so the answer stays grounded in the same material, and a system prompt defines the assistant's rules for the whole conversation.
- Google Gemini multimodal AI β the Gemini chat session receives the parts.
- Structured study response β the reply is rendered as Markdown (topic, summary, important points, steps, exam focus, question bank analysis, and so on). The suggestion block requested from the model is parsed out and presented as Related questions buttons below the latest answer.
- Student reads the answer and continues with follow-up questions.
Detailed diagrams are available in docs/ARCHITECTURE.md.
Answer length and depth are controlled by the marks the student asks for. The mark value is passed to the assistant together with the question, and the answer structure changes accordingly.
| Requested marks | Expected answer style |
|---|---|
| 2 Marks | Short and focused β a definition plus one or two essential points, with no long introduction or unnecessary examples |
| 5 Marks | Moderately detailed β definition or introduction, the main explanation, and important points or an example when the material supports it |
| 10 / 13 / 15 / 16 Marks | Structured long-form answer β introduction, definition, main concept, components, working or step-by-step process, advantages, limitations, applications, and conclusion, but only for the parts the material supports |
Answers are designed to remain grounded in the uploaded study material and the conversation context. When the material does not contain enough information for the requested depth, the assistant is instructed to say so instead of filling the gap with unsupported textbook content.
StudyLens AI does not predict examination questions. It restructures and explains the material the student provides.
When a question paper, question bank, or previous-year paper is uploaded, the assistant extracts the visible questions and reports:
- exact repeated questions β the same question appearing more than once
- similarly worded questions β the same intent expressed with different wording
- recurring concepts β different questions that test the same underlying topic
- frequency within the supplied question set β how often a question or concept appears across the papers that were provided
The assistant is explicitly instructed to separate exact repeat, similar question, and same concept instead of treating them as duplicates, and to phrase findings as evidence, for example "appears in 3 provided papers".
Question importance analysis is based on the question papers provided by the user and does not guarantee future examination questions.
StudyLens AI can be used in the language a student is most comfortable thinking in:
| Language | How it is handled |
|---|---|
| English | Questions asked in English are answered in clear English |
| Tamil | Questions asked in Tamil are answered in simple Tamil |
| Tanglish | Tamil typed in English letters is understood, and the answer is given naturally in simple Tamil / Tanglish |
Important technical terms are kept in English when that improves clarity β so a definition can be explained in Tamil while the technical keyword itself stays recognizable for the exam answer.
Language selection is automatic: there is no language toggle to configure, the student simply types in the language they prefer.
The application has two main screens: the student onboarding screen and the study workspace. Both are documented in this repository's asset folder.
Asset note: screenshot files are stored in
assets/screenshots/. The expected file names, captions, and capture guidance are documented in assets/screenshots/README.md. Once the image files are present, uncomment the image tags below to render them here.
Students enter their basic details before starting a study session.
Students can upload study material and interact with StudyLens AI.
Repeated, similar, and concept-level recurring questions identified from the uploaded question papers.
| Layer | Technology | Purpose |
|---|---|---|
| Language | Python | Application logic and prompt configuration |
| Web UI | Streamlit | Onboarding form, chat interface, image upload, sidebar, Markdown rendering |
| AI SDK | google-genai (Google Gen AI SDK) |
Gemini client, multimodal chat sessions, content configuration |
| AI Model | Google Gemini multimodal model (MODEL_NAME in app.py) |
Reads the uploaded image and text, generates the study response |
| Input Formats | JPG, JPEG, PNG, WEBP | Uploaded study material |
| Prompt Layer | prompts.py |
System prompt rules, welcome message, image analysis prompt, follow-up prompt |
There is no database, no user account system, and no separate frontend build step β the whole application is two Python modules plus the Streamlit runtime.
StudyLens_AI/
β
βββ app.py
βββ prompts.py
βββ requirements.txt
βββ README.md
βββ LICENSE
βββ .gitignore
β
βββ .streamlit/
β βββ secrets.toml.example
β
βββ assets/
β βββ screenshots/
β β βββ onboarding.png
β β βββ study-session.png
β β βββ analysis.png
β β
β βββ architecture/
β βββ architecture.svg
β
βββ docs/
βββ ARCHITECTURE.md
βββ PROJECT_OVERVIEW.md
| File | Description |
|---|---|
app.py |
Streamlit application: onboarding, study workspace, session state, Gemini client, request handling, error handling |
prompts.py |
All prompt text: system prompt, welcome message, image analysis prompt, follow-up prompt |
requirements.txt |
Runtime dependencies |
.streamlit/secrets.toml.example |
Template showing the expected secrets file format (the real secrets.toml is never committed) |
assets/architecture/architecture.svg |
High-level architecture diagram |
docs/ARCHITECTURE.md |
Detailed architecture documentation with Mermaid diagrams |
docs/PROJECT_OVERVIEW.md |
Project overview, user journey, scope, and roadmap |
- Python 3.x
- A Google Gemini API key from Google AI Studio
- Internet access (all AI processing happens through the Gemini API)
git clone https://github.com/abinesh-0/StudyLens_AI.git
cd StudyLens_AIpython -m venv venv# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activatepip install -r requirements.txtCopy the template and fill in your own key:
# Windows
copy .streamlit\secrets.toml.example .streamlit\secrets.toml
# macOS / Linux
cp .streamlit/secrets.toml.example .streamlit/secrets.toml.streamlit/secrets.toml:
GEMINI_API_KEY = "your-google-ai-studio-api-key".streamlit/secrets.toml is listed in .gitignore and must never be committed.
streamlit run app.pyThe app opens in your browser. Enter a name and phone number, click Let's Study π, then upload a study image and start asking questions.
| Setting | Where it is defined | Current value |
|---|---|---|
| Gemini API key | .streamlit/secrets.toml β GEMINI_API_KEY |
Supplied by the user locally |
| Gemini model | MODEL_NAME in app.py |
gemini-3.5-flash-lite |
| Accepted upload formats | st.chat_input(file_type=[...]) in app.py |
jpg, jpeg, png, webp |
| Validated MIME types | ALLOWED_IMAGE_TYPES in app.py |
image/jpeg, image/png, image/webp |
| Retry delays for transient errors | RETRY_DELAYS_SECONDS in app.py |
(1, 2, 4) seconds |
| Assistant behaviour | SYSTEM_PROMPT in prompts.py |
Source-first, mark-aware, honesty-constrained study assistant |
Deployment note: on a hosted platform such as Streamlit Community Cloud, provide the same key through that platform's secrets editor instead of committing a local file.
StudyLens AI is deliberately honest about what it does and does not do. The current implementation is:
| Not implemented | What that means in practice |
|---|---|
| β Live web search | No Google Search, no web browsing, and no online verification is performed. The assistant is instructed not to claim that it searched the web |
| β YouTube search or YouTube API | No video lookup or video-based analysis |
| β Database / user accounts | No sign-up, login, cloud database, or stored study history. Everything lives in the Streamlit session and is lost when the session ends |
| β Progress analytics | No dashboards, streaks, or performance tracking |
| β WhatsApp / Twilio messaging | The phone number entered during onboarding is kept only in the session state β it is never transmitted and no message is sent |
| β PDF or document processing | Study material must be uploaded as an image (JPG, JPEG, PNG, WEBP) |
| β AI image or diagram generation | Diagram requests are answered with text-based diagrams. The system prompt explicitly forbids claiming that an image was generated |
| β Voice input | Interaction is text and image only |
| β Exam question prediction | Question importance analysis is based only on the question papers supplied by the student |
Additional practical notes:
- One image can be attached per message; multiple pages require multiple messages.
- An active internet connection and a valid Gemini API key are required.
- AI output can be inaccurate or incomplete. Answers should always be verified against the original material before being relied on for exams.
Planned directions, none of which are part of the current implementation:
- π Grounded web and video references β optional grounding tools so that external verification is actually performed and reported, with the sources shown in the answer
- πΌοΈ Native diagram generation β rendered architecture, flow, and process diagrams instead of text-based diagrams
- π PDF and multi-page document support β chapter-level and full-paper analysis
- π Grouped study sets β upload several question papers as one set for richer frequency analysis and comparison charts
- ποΈ Persistent study history β database-backed saved sessions and revision notes
- π€ User accounts β authentication so study history follows the student across devices
- π Progress analytics β topic coverage and revision tracking dashboards
- π Voice-based interaction β spoken questions and audio explanations
- π± WhatsApp / Twilio study reminders β scheduled revision nudges (would require a messaging integration and consent flow)
- π§Ύ Export options β download generated notes and answers as PDF or Markdown
| Document | Contents |
|---|---|
| README.md | Project overview, features, setup, configuration |
| docs/ARCHITECTURE.md | High-level architecture, request flow, component responsibilities, error handling, security notes |
| docs/PROJECT_OVERVIEW.md | Problem, solution, user journey, scope, roadmap, and suggested repository metadata |
| assets/architecture/architecture.svg | Architecture diagram |
| assets/screenshots/README.md | Screenshot asset naming and capture guidance |
Released under the MIT License.
Abinesh S β github.com/abinesh-0
Built as an AI-assisted learning tool for students preparing for examinations.