# dikshaforsure/repogpt architecture

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

- Interactive diagram: https://gitdiagram.com/dikshaforsure/repogpt
- Repository: https://github.com/dikshaforsure/repogpt

## Overview

RepoGPT is a Streamlit app for asking natural-language questions about GitHub repositories. A user supplies a repository URL and credentials, indexes supported files into an in-memory semantic index, then asks questions; retrieved code context goes to Groq, and the app streams an answer with source paths. The graph separates ingestion, indexing, Q&A, and interface concerns. Its implementation is concentrated in main.py, so several distinct responsibilities share that path. Some pipeline details are documented in the README but their implementation lines were not sampled.

Main entry points: [`main.py`](https://github.com/dikshaforsure/repogpt/blob/main/main.py) (Semantic retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Streamlit interface"]
  node_streamlit["Streamlit UI<br/>[main.py]"]
  node_credentials["Credential setup<br/>[main.py]"]
  node_session["Session state<br/>[main.py]"]
end

subgraph group_ingestion["Repository ingestion"]
  node_url["URL parsing<br/>[main.py]"]
  node_reader["Repository reader<br/>[main.py]"]
  node_filefilter["Supported-file filter<br/>[main.py]"]
  node_documents["Repository documents<br/>[main.py]"]
end

subgraph group_indexing["Semantic indexing"]
  node_embeddings["Local embeddings<br/>[main.py]"]
  node_vectorindex[("Vector index<br/>[main.py]")]
end

subgraph group_qa["Question answering"]
  node_retrieval["Semantic retrieval<br/>[main.py]"]
  node_prompt["QA prompt<br/>[main.py]"]
  node_streaming["Answer streaming<br/>[main.py]"]
  node_sources["Source references<br/>[main.py]"]
end

node_developer(("Developer"))
node_github[("GitHub repository")]
node_huggingface["Hugging Face model"]
node_groq["Groq model"]

node_developer -->|"asks questions"| node_streamlit
node_streamlit -->|"collects keys"| node_credentials
node_streamlit -->|"submits URL"| node_url
node_url -->|"selects repository"| node_reader
node_reader -->|"fetches files"| node_github
node_reader -->|"filters files"| node_filefilter
node_reader -->|"loads documents"| node_documents
node_documents -->|"creates vectors"| node_embeddings
node_embeddings -->|"uses model"| node_huggingface
node_documents -->|"builds index"| node_vectorindex
node_embeddings -->|"indexes vectors"| node_vectorindex
node_vectorindex -->|"stores index"| node_session
node_streamlit -->|"tracks app state"| node_session
node_streamlit -->|"submits question"| node_retrieval
node_session -->|"provides index"| node_retrieval
node_retrieval -->|"retrieves chunks"| node_vectorindex
node_retrieval -->|"sets QA template"| node_prompt
node_retrieval -->|"generates response"| node_groq
node_retrieval -->|"returns response stream"| node_streaming
node_streaming -->|"renders answer"| node_streamlit
node_retrieval -->|"returns source nodes"| node_sources
node_sources -->|"displays paths"| node_streamlit

click node_streamlit "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_credentials "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_session "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_url "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_reader "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_filefilter "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_documents "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_embeddings "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_vectorindex "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_retrieval "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_prompt "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_streaming "https://github.com/dikshaforsure/repogpt/blob/main/main.py"
click node_sources "https://github.com/dikshaforsure/repogpt/blob/main/main.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_streamlit,node_credentials,node_session toneBlue
class node_url,node_reader,node_filefilter,node_documents,node_github toneAmber
class node_embeddings,node_vectorindex toneMint
class node_retrieval,node_prompt,node_streaming,node_sources toneRose
class node_developer,node_huggingface,node_groq toneIndigo
```

## Components

### Streamlit interface

- [Streamlit UI](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`
- [Credential setup](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`
- [Session state](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`

### Repository ingestion

- [URL parsing](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`
- [Repository reader](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`
- [Supported-file filter](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`
- [Repository documents](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`

### Semantic indexing

- [Local embeddings](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`
- [Vector index](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`

### Question answering

- [Semantic retrieval](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`
- [QA prompt](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`
- [Answer streaming](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`
- [Source references](https://github.com/dikshaforsure/repogpt/blob/main/main.py): `main.py`

### Other components

- **Developer**
- **GitHub repository**
- **Hugging Face model**
- **Groq model**

## Connections

- Developer → Streamlit UI: asks questions (evidence: `README.md`)
- Streamlit UI → Credential setup: collects keys (evidence: `main.py`)
- Streamlit UI → URL parsing: submits URL (evidence: `main.py`)
- URL parsing → Repository reader: selects repository (evidence: `main.py`)
- Repository reader → GitHub repository: fetches files (evidence: `README.md`)
- Repository reader → Supported-file filter: filters files (evidence: `main.py`)
- Repository reader → Repository documents: loads documents (evidence: `README.md`)
- Repository documents → Local embeddings: creates vectors (evidence: `README.md`)
- Local embeddings → Hugging Face model: uses model (evidence: `README.md`)
- Repository documents → Vector index: builds index (evidence: `main.py`)
- Local embeddings → Vector index: indexes vectors (evidence: `README.md`)
- Vector index → Session state: stores index (evidence: `main.py`)
- Streamlit UI → Session state: tracks app state (evidence: `main.py`)
- Streamlit UI → Semantic retrieval: submits question (evidence: `main.py`)
- Session state → Semantic retrieval: provides index (evidence: `main.py`)
- Semantic retrieval → Vector index: retrieves chunks (evidence: `README.md`)
- Semantic retrieval → QA prompt: sets QA template (evidence: `main.py`)
- Semantic retrieval → Groq model: generates response (evidence: `README.md`)
- Semantic retrieval → Answer streaming: returns response stream (evidence: `main.py`)
- Answer streaming → Streamlit UI: renders answer (evidence: `main.py`)
- Semantic retrieval → Source references: returns source nodes (evidence: `main.py`)
- Source references → Streamlit UI: displays paths (evidence: `main.py`)
