# visweshkudipudi/ai_study_planner architecture

> Architecture diagram of the GitHub repository visweshkudipudi/ai_study_planner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/visweshkudipudi/ai_study_planner
- Repository: https://github.com/visweshkudipudi/ai_study_planner

## Overview

AI Study Planner is a single-file Streamlit app for turning subject difficulty and exam dates into a weighted study plan. A student enters inputs and requests generation; the app prompts Gemini, parses the response, and displays a timetable and study tips. Students can rebalance a plan after missed study hours and export its schedule as an iCalendar file. The app keeps plans in Streamlit session state. The source excerpt establishes these flows; omitted portions limit detail about the exact prompt and input controls.

Main entry points: [`app.py`](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py) (Plan Session State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Planning Inputs"]
  node_inputs["Study Inputs<br/>[app.py]"]
  node_priority["Priority Weights<br/>[app.py]"]
  node_priority_view["Priority Display<br/>[app.py]"]
end

subgraph group_generation["AI Planning"]
  node_generate["Schedule Request<br/>[app.py]"]
  node_prompt["Schedule Prompt<br/>[app.py]"]
  node_parse["Response Parser<br/>[app.py]"]
  node_session["Plan Session State<br/>[app.py]"]
  node_rebalancer["Plan Rebalancer<br/>[app.py]"]
end

subgraph group_outputs["Plan Outputs"]
  node_timetable["Timetable Display<br/>[app.py]"]
  node_tips["Study Tips<br/>[app.py]"]
  node_calendar["Calendar Export<br/>[app.py]"]
end

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

node_student -->|"enters subjects"| node_inputs
node_inputs -->|"calculates weights"| node_priority
node_priority -->|"displays weights"| node_priority_view
node_student -->|"requests schedule"| node_generate
node_generate -->|"builds prompt"| node_prompt
node_prompt -->|"requests generation"| node_gemini
node_gemini -->|"returns response"| node_parse
node_parse -->|"stores plan"| node_session
node_session -->|"renders schedule"| node_timetable
node_session -->|"renders tips"| node_tips
node_session -->|"exports schedule"| node_calendar
node_student -->|"reports missed hours"| node_rebalancer
node_rebalancer -->|"requests rebalance"| node_gemini
node_gemini -->|"returns revised plan"| node_parse
node_parse -->|"updates plan"| node_session

click node_inputs "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_priority "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_priority_view "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_generate "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_prompt "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_parse "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_session "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_timetable "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_rebalancer "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_tips "https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py"
click node_calendar "https://github.com/visweshkudipudi/ai_study_planner/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_inputs,node_priority,node_priority_view toneBlue
class node_generate,node_prompt,node_parse,node_session,node_rebalancer toneAmber
class node_timetable,node_tips,node_calendar,node_gemini toneMint
class node_student toneIndigo
```

## Components

### Planning Inputs

- [Study Inputs](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`
- [Priority Weights](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`
- [Priority Display](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`

### AI Planning

- [Schedule Request](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`
- [Schedule Prompt](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`
- [Response Parser](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`
- [Plan Session State](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`
- [Plan Rebalancer](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`

### Plan Outputs

- [Timetable Display](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`
- [Study Tips](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`
- [Calendar Export](https://github.com/visweshkudipudi/ai_study_planner/blob/main/app.py): `app.py`

### Other components

- **Student**
- **Gemini API**

## Connections

- Student → Study Inputs: enters subjects (evidence: `app.py`)
- Study Inputs → Priority Weights: calculates weights (evidence: `app.py`)
- Priority Weights → Priority Display: displays weights (evidence: `app.py`)
- Student → Schedule Request: requests schedule (evidence: `app.py`)
- Schedule Request → Schedule Prompt: builds prompt (evidence: `app.py`)
- Schedule Prompt → Gemini API: requests generation (evidence: `app.py`)
- Gemini API → Response Parser: returns response (evidence: `app.py`)
- Response Parser → Plan Session State: stores plan (evidence: `app.py`)
- Plan Session State → Timetable Display: renders schedule (evidence: `app.py`)
- Plan Session State → Study Tips: renders tips (evidence: `app.py`)
- Plan Session State → Calendar Export: exports schedule (evidence: `app.py`)
- Student → Plan Rebalancer: reports missed hours (evidence: `app.py`)
- Plan Rebalancer → Gemini API: requests rebalance (evidence: `app.py`)
- Gemini API → Response Parser: returns revised plan (evidence: `app.py`)
- Response Parser → Plan Session State: updates plan (evidence: `app.py`)
