# gahyun0121/jeongcheogi-agent architecture

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

- Interactive diagram: https://gitdiagram.com/gahyun0121/jeongcheogi-agent
- Repository: https://github.com/gahyun0121/jeongcheogi-agent

## Overview

This is a Streamlit and terminal-based study agent for the Korean Information Processing Engineer practical exam. Its main workflow selects weak topics from Notion wrong-answer records, generates questions grounded in concept notes, reviews them (executing code questions), collects and grades answers, and saves wrong answers for future sessions. LangGraph owns the branching and retry loop; the main internal layer is the quiz-node implementation. The README documents concept browsing and exam information as additional UI capabilities. Some web source is excerpted only partially, so its finer internal wiring is not represented.

Main entry points: [`app/graph.py`](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/graph.py) (Quiz graph), [`app/web.py`](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/web.py) (Study web app), [`app/rag.py`](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/rag.py) (Concept retrieval), [`app/nodes.py`](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py) (Question generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_terminal["Terminal runner<br/>[main.py]"]
  node_web["Study web app<br/>[web.py]"]
  node_exam["Exam information<br/>[exam_info.py]"]
end

subgraph group_workflow["Quiz workflow"]
  node_graph["Quiz graph<br/>[graph.py]"]
  node_weakness["Weakness analysis<br/>[nodes.py]"]
  node_generation["Question generation<br/>[nodes.py]"]
  node_review["Question review<br/>[nodes.py]"]
  node_answer["Answer prompt<br/>[nodes.py]"]
  node_grading["Answer grading<br/>[nodes.py]"]
  node_confirmation["Meaning confirmation<br/>[nodes.py]"]
  node_savewrong["Wrong-answer save<br/>[nodes.py]"]
end

subgraph group_knowledge["Question knowledge"]
  node_concepts["Concept notes"]
  node_rag["Concept retrieval<br/>[rag.py]"]
  node_vector[("Chroma index<br/>[rag.py]")]
  node_code["Code runner<br/>[tools.py]"]
end

subgraph group_integrations["External services"]
  node_notion_adapter["Notion MCP adapter<br/>[notion.py]"]
  node_notion[("Notion wrong-answer store")]
  node_llm["OpenAI models"]
end

node_learner(("Learner"))

node_learner -->|"answers via"| node_terminal
node_learner -.->|"uses"| node_web
node_terminal -->|"builds and invokes"| node_graph
node_web -->|"builds and resumes"| node_graph
node_web -->|"displays"| node_exam
node_web -->|"browses concepts"| node_rag
node_graph -->|"dispatches"| node_weakness
node_graph -->|"dispatches"| node_generation
node_graph -->|"dispatches"| node_review
node_graph -->|"dispatches"| node_answer
node_graph -->|"dispatches"| node_grading
node_graph -->|"dispatches"| node_confirmation
node_graph -->|"dispatches"| node_savewrong
node_weakness -->|"reads wrong records"| node_notion_adapter
node_generation -->|"retrieves concepts"| node_rag
node_generation -->|"generates questions"| node_llm
node_review -->|"reviews theory"| node_llm
node_review -->|"executes code"| node_code
node_answer -->|"requests answer"| node_learner
node_confirmation -->|"asks judgment"| node_learner
node_savewrong -->|"saves wrong answer"| node_notion_adapter
node_rag -->|"loads notes"| node_concepts
node_rag -->|"builds and searches"| node_vector
node_notion_adapter -->|"queries and writes"| node_notion

click node_terminal "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/main.py"
click node_web "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/web.py"
click node_exam "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/exam_info.py"
click node_graph "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/graph.py"
click node_weakness "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py"
click node_generation "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py"
click node_review "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py"
click node_answer "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py"
click node_grading "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py"
click node_confirmation "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py"
click node_savewrong "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py"
click node_concepts "https://github.com/gahyun0121/jeongcheogi-agent/tree/main/data/concepts"
click node_rag "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/rag.py"
click node_vector "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/rag.py"
click node_code "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/tools.py"
click node_notion_adapter "https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/notion.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_terminal,node_web,node_exam toneBlue
class node_graph,node_weakness,node_generation,node_review,node_answer,node_grading,node_confirmation,node_savewrong toneAmber
class node_concepts,node_rag,node_vector,node_code toneMint
class node_notion_adapter,node_notion,node_llm toneRose
class node_learner toneIndigo
```

## Components

### User interfaces

- [Terminal runner](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/main.py): `app/main.py`
- [Study web app](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/web.py): `app/web.py`
- [Exam information](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/exam_info.py): `app/exam_info.py`

### Quiz workflow

- [Quiz graph](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/graph.py): `app/graph.py`
- [Weakness analysis](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py): `app/nodes.py`
- [Question generation](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py): `app/nodes.py`
- [Question review](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py): `app/nodes.py`
- [Answer prompt](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py): `app/nodes.py`
- [Answer grading](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py): `app/nodes.py`
- [Meaning confirmation](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py): `app/nodes.py`
- [Wrong-answer save](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/nodes.py): `app/nodes.py`

### Question knowledge

- [Concept notes](https://github.com/gahyun0121/jeongcheogi-agent/tree/main/data/concepts): `data/concepts`
- [Concept retrieval](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/rag.py): `app/rag.py`
- [Chroma index](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/rag.py): `app/rag.py`
- [Code runner](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/tools.py): `app/tools.py`

### External services

- [Notion MCP adapter](https://github.com/gahyun0121/jeongcheogi-agent/blob/main/app/notion.py): `app/notion.py`
- **Notion wrong-answer store**
- **OpenAI models**

### Other components

- **Learner**

## Connections

- Learner → Terminal runner: answers via (evidence: `app/main.py`)
- Learner → Study web app: uses (evidence: `README.md`)
- Terminal runner → Quiz graph: builds and invokes (evidence: `app/main.py`)
- Study web app → Quiz graph: builds and resumes (evidence: `README.md`)
- Study web app → Exam information: displays (evidence: `app/web.py`)
- Study web app → Concept retrieval: browses concepts (evidence: `app/web.py`)
- Quiz graph → Weakness analysis: dispatches (evidence: `app/graph.py`)
- Quiz graph → Question generation: dispatches (evidence: `app/graph.py`)
- Quiz graph → Question review: dispatches (evidence: `app/graph.py`)
- Quiz graph → Answer prompt: dispatches (evidence: `app/graph.py`)
- Quiz graph → Answer grading: dispatches (evidence: `app/graph.py`)
- Quiz graph → Meaning confirmation: dispatches (evidence: `app/graph.py`)
- Quiz graph → Wrong-answer save: dispatches (evidence: `app/graph.py`)
- Weakness analysis → Notion MCP adapter: reads wrong records (evidence: `app/nodes.py`)
- Question generation → Concept retrieval: retrieves concepts (evidence: `app/nodes.py`)
- Question generation → OpenAI models: generates questions (evidence: `app/nodes.py`)
- Question review → OpenAI models: reviews theory (evidence: `app/nodes.py`)
- Question review → Code runner: executes code (evidence: `app/nodes.py`)
- Answer prompt → Learner: requests answer (evidence: `README.md`)
- Meaning confirmation → Learner: asks judgment (evidence: `README.md`)
- Wrong-answer save → Notion MCP adapter: saves wrong answer (evidence: `app/nodes.py`)
- Concept retrieval → Concept notes: loads notes (evidence: `app/rag.py`)
- Concept retrieval → Chroma index: builds and searches (evidence: `app/rag.py`)
- Notion MCP adapter → Notion wrong-answer store: queries and writes (evidence: `app/notion.py`)
