# udayreddy-s/ai-study architecture

> Architecture diagram of the GitHub repository udayreddy-s/ai-study, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/udayreddy-s/ai-study
- Repository: https://github.com/udayreddy-s/ai-study

## Overview

AI Study Companion is a Streamlit app for studying uploaded PDF and DOCX notes. A student uploads notes, the app extracts their text and keeps it in session state, then offers summary and translation, quiz generation, flashcards, and a notes-grounded tutor chat. Each generation feature calls Gemini and displays its result; summaries can also be downloaded. The runtime is concentrated in app.py, so the components below represent responsibilities within that file, not separate services. Evidence for the interactions is the app.py excerpt.

Main entry points: [`app.py`](https://github.com/udayreddy-s/ai-study/blob/main/app.py) (Streamlit interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Student interaction"]
  node_interface["Streamlit interface<br/>[app.py]"]
  node_session[("Session state<br/>[app.py]")]
end

subgraph group_notes["Notes handling"]
  node_extract["Document extraction<br/>[app.py]"]
end

subgraph group_study["Study features"]
  node_summary["Summary and translation<br/>[app.py]"]
  node_quiz["Quiz generation<br/>[app.py]"]
  node_flashcards["Flashcard generation<br/>[app.py]"]
  node_tutor["Tutor chat<br/>[app.py]"]
  node_download["Summary download<br/>[app.py]"]
end

node_student(("Student"))
node_gemini["Gemini model"]

node_student -->|"uploads and asks"| node_interface
node_interface -->|"extracts notes"| node_extract
node_interface -->|"stores notes"| node_session
node_summary -->|"reads notes"| node_session
node_quiz -->|"reads notes"| node_session
node_flashcards -->|"reads notes"| node_session
node_tutor -->|"reads notes"| node_session
node_summary -->|"generates summary"| node_gemini
node_quiz -->|"generates quiz"| node_gemini
node_flashcards -->|"generates cards"| node_gemini
node_tutor -->|"answers question"| node_gemini
node_summary -->|"displays result"| node_interface
node_quiz -->|"displays result"| node_interface
node_flashcards -->|"displays result"| node_interface
node_tutor -->|"displays reply"| node_interface
node_summary -->|"provides text"| node_download
node_download -->|"downloads summary"| node_student

click node_interface "https://github.com/udayreddy-s/ai-study/blob/main/app.py"
click node_session "https://github.com/udayreddy-s/ai-study/blob/main/app.py"
click node_extract "https://github.com/udayreddy-s/ai-study/blob/main/app.py"
click node_summary "https://github.com/udayreddy-s/ai-study/blob/main/app.py"
click node_quiz "https://github.com/udayreddy-s/ai-study/blob/main/app.py"
click node_flashcards "https://github.com/udayreddy-s/ai-study/blob/main/app.py"
click node_tutor "https://github.com/udayreddy-s/ai-study/blob/main/app.py"
click node_download "https://github.com/udayreddy-s/ai-study/blob/main/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_interface,node_session toneBlue
class node_extract toneAmber
class node_summary,node_quiz,node_flashcards,node_tutor,node_download toneMint
class node_student,node_gemini toneIndigo
```

## Components

### Student interaction

- [Streamlit interface](https://github.com/udayreddy-s/ai-study/blob/main/app.py): `app.py`
- [Session state](https://github.com/udayreddy-s/ai-study/blob/main/app.py): `app.py`

### Notes handling

- [Document extraction](https://github.com/udayreddy-s/ai-study/blob/main/app.py): `app.py`

### Study features

- [Summary and translation](https://github.com/udayreddy-s/ai-study/blob/main/app.py): `app.py`
- [Quiz generation](https://github.com/udayreddy-s/ai-study/blob/main/app.py): `app.py`
- [Flashcard generation](https://github.com/udayreddy-s/ai-study/blob/main/app.py): `app.py`
- [Tutor chat](https://github.com/udayreddy-s/ai-study/blob/main/app.py): `app.py`
- [Summary download](https://github.com/udayreddy-s/ai-study/blob/main/app.py): `app.py`

### Other components

- **Student**
- **Gemini model**

## Connections

- Student → Streamlit interface: uploads and asks (evidence: `app.py`)
- Streamlit interface → Document extraction: extracts notes (evidence: `app.py`)
- Streamlit interface → Session state: stores notes (evidence: `app.py`)
- Summary and translation → Session state: reads notes (evidence: `app.py`)
- Quiz generation → Session state: reads notes (evidence: `app.py`)
- Flashcard generation → Session state: reads notes (evidence: `app.py`)
- Tutor chat → Session state: reads notes (evidence: `app.py`)
- Summary and translation → Gemini model: generates summary (evidence: `app.py`)
- Quiz generation → Gemini model: generates quiz (evidence: `app.py`)
- Flashcard generation → Gemini model: generates cards (evidence: `app.py`)
- Tutor chat → Gemini model: answers question (evidence: `app.py`)
- Summary and translation → Streamlit interface: displays result (evidence: `app.py`)
- Quiz generation → Streamlit interface: displays result (evidence: `app.py`)
- Flashcard generation → Streamlit interface: displays result (evidence: `app.py`)
- Tutor chat → Streamlit interface: displays reply (evidence: `app.py`)
- Summary and translation → Summary download: provides text (evidence: `app.py`)
- Summary download → Student: downloads summary (evidence: `app.py`)
