# piyush2676/graphloom architecture

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

- Interactive diagram: https://gitdiagram.com/piyush2676/graphloom
- Repository: https://github.com/piyush2676/graphloom

## Overview

GraphLoom builds knowledge graphs from study material and provides AI-assisted study tools. The principal flow is PDF upload, text extraction and chunking, indexing and graph creation, then graph inspection or retrieval-based study outputs. The tree and excerpts also indicate a Streamlit application with transcript and report capabilities, but its wiring is only partially visible; frontend-to-backend calls are not asserted where the sampled source does not establish them.

Main entry points: [`backend.py`](https://github.com/piyush2676/graphloom/blob/main/backend.py) (Knowledge API), [`frontend/src/pages/Index.tsx`](https://github.com/piyush2676/graphloom/blob/main/frontend/src/pages/Index.tsx) (Workspace page), [`frontend/src/App.tsx`](https://github.com/piyush2676/graphloom/blob/main/frontend/src/App.tsx) (Web app shell), [`app.py`](https://github.com/piyush2676/graphloom/blob/main/app.py) (Streamlit application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_webapp["Web app shell<br/>[App.tsx]"]
  node_workspace["Workspace page<br/>[Index.tsx]"]
  node_sidebar["Sources and settings<br/>[AppSidebar.tsx]"]
  node_maincontent["Study workspace<br/>[MainContent.tsx]"]
  node_graphpanel["Knowledge graph"]
  node_chatpanel["Chat<br/>[ChatPanel.tsx]"]
  node_summarypanel["Summaries<br/>[SummaryPanel.tsx]"]
  node_flashcards["Flashcards"]
  node_mentor["AI mentor<br/>[AIMentorPanel.tsx]"]
end

subgraph group_backend["Knowledge services"]
  node_api["Knowledge API<br/>[backend.py]"]
  node_pdfextract["PDF extraction<br/>[backend.py]"]
  node_processing["Chunking and graphing<br/>[backend.py]"]
  node_vectorstore[("Vector index<br/>[backend.py]")]
end

subgraph group_legacy["Streamlit application"]
  node_streamlit["Streamlit application<br/>[app.py]"]
  node_sourceextract["Source extraction<br/>[app.py]"]
  node_legacytools["Study and export tools<br/>[app.py]"]
end

node_learner(("Learner"))
node_llm{{"Language model"}}
node_embedder{{"Embedding model"}}

node_learner -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_workspace
node_workspace -->|"renders"| node_sidebar
node_workspace -->|"renders"| node_maincontent
node_learner -->|"uploads PDFs"| node_api
node_api -->|"loads PDF"| node_pdfextract
node_pdfextract -->|"passes text"| node_processing
node_processing -->|"indexes chunks"| node_vectorstore
node_processing -->|"creates embeddings"| node_embedder
node_api -->|"retrieves context"| node_vectorstore
node_api -->|"requests generation"| node_llm
node_learner -->|"uses"| node_streamlit
node_streamlit -->|"extracts sources"| node_sourceextract
node_sourceextract -->|"provides content"| node_legacytools
node_legacytools -->|"requests generation"| node_llm

click node_webapp "https://github.com/piyush2676/graphloom/blob/main/frontend/src/App.tsx"
click node_workspace "https://github.com/piyush2676/graphloom/blob/main/frontend/src/pages/Index.tsx"
click node_sidebar "https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/AppSidebar.tsx"
click node_maincontent "https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/MainContent.tsx"
click node_graphpanel "https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/KnowledgeGraphPanel.tsx"
click node_chatpanel "https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/ChatPanel.tsx"
click node_summarypanel "https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/SummaryPanel.tsx"
click node_flashcards "https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/FlashcardsPanel.tsx"
click node_mentor "https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/AIMentorPanel.tsx"
click node_api "https://github.com/piyush2676/graphloom/blob/main/backend.py"
click node_pdfextract "https://github.com/piyush2676/graphloom/blob/main/backend.py"
click node_processing "https://github.com/piyush2676/graphloom/blob/main/backend.py"
click node_vectorstore "https://github.com/piyush2676/graphloom/blob/main/backend.py"
click node_streamlit "https://github.com/piyush2676/graphloom/blob/main/app.py"
click node_sourceextract "https://github.com/piyush2676/graphloom/blob/main/app.py"
click node_legacytools "https://github.com/piyush2676/graphloom/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_webapp,node_workspace,node_sidebar,node_maincontent,node_graphpanel,node_chatpanel,node_summarypanel,node_flashcards,node_mentor toneBlue
class node_api,node_pdfextract,node_processing,node_vectorstore toneAmber
class node_streamlit,node_sourceextract,node_legacytools toneMint
class node_learner,node_llm,node_embedder toneIndigo
```

## Components

### Web interface

- [Web app shell](https://github.com/piyush2676/graphloom/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Workspace page](https://github.com/piyush2676/graphloom/blob/main/frontend/src/pages/Index.tsx): `frontend/src/pages/Index.tsx`
- [Sources and settings](https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/AppSidebar.tsx): `frontend/src/components/AppSidebar.tsx`
- [Study workspace](https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/MainContent.tsx): `frontend/src/components/MainContent.tsx`
- [Knowledge graph](https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/KnowledgeGraphPanel.tsx): `frontend/src/components/KnowledgeGraphPanel.tsx`
- [Chat](https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/ChatPanel.tsx): `frontend/src/components/ChatPanel.tsx`
- [Summaries](https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/SummaryPanel.tsx): `frontend/src/components/SummaryPanel.tsx`
- [Flashcards](https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/FlashcardsPanel.tsx): `frontend/src/components/FlashcardsPanel.tsx`
- [AI mentor](https://github.com/piyush2676/graphloom/blob/main/frontend/src/components/AIMentorPanel.tsx): `frontend/src/components/AIMentorPanel.tsx`

### Knowledge services

- [Knowledge API](https://github.com/piyush2676/graphloom/blob/main/backend.py): `backend.py`
- [PDF extraction](https://github.com/piyush2676/graphloom/blob/main/backend.py): `backend.py`
- [Chunking and graphing](https://github.com/piyush2676/graphloom/blob/main/backend.py): `backend.py`
- [Vector index](https://github.com/piyush2676/graphloom/blob/main/backend.py): `backend.py`

### Streamlit application

- [Streamlit application](https://github.com/piyush2676/graphloom/blob/main/app.py): `app.py`
- [Source extraction](https://github.com/piyush2676/graphloom/blob/main/app.py): `app.py`
- [Study and export tools](https://github.com/piyush2676/graphloom/blob/main/app.py): `app.py`

### Other components

- **Learner**
- **Language model**
- **Embedding model**

## Connections

- Learner → Web app shell: uses
- Web app shell → Workspace page: routes to
- Workspace page → Sources and settings: renders
- Workspace page → Study workspace: renders
- Learner → Knowledge API: uploads PDFs
- Knowledge API → PDF extraction: loads PDF
- PDF extraction → Chunking and graphing: passes text
- Chunking and graphing → Vector index: indexes chunks
- Chunking and graphing → Embedding model: creates embeddings
- Knowledge API → Vector index: retrieves context
- Knowledge API → Language model: requests generation
- Learner → Streamlit application: uses
- Streamlit application → Source extraction: extracts sources
- Source extraction → Study and export tools: provides content
- Study and export tools → Language model: requests generation
