# vasaviinumula24-code/askgithub architecture

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

- Interactive diagram: https://gitdiagram.com/vasaviinumula24-code/askgithub
- Repository: https://github.com/vasaviinumula24-code/askgithub

## Overview

GitHub RAG Agent lets users index a GitHub repository and ask questions about its code. The API validates requests and delegates indexing to a service that clones and parses the repository, then stores either a full-context bundle or a FAISS index of embedded chunks. Questions retrieve the stored full context or relevant chunks, send that context to a configured language model, and return an answer with source citations. The README also documents a browser UI and alternate model providers; unsampled UI wiring is shown only as documented, not inferred from source.

Main entry points: [`app/services/indexer.py`](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/indexer.py) (Indexer service), [`app/main.py`](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/main.py) (FastAPI endpoints), [`app/services/rag.py`](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/rag.py) (RAG service), [`app/services/github.py`](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/github.py) (GitHub clone)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and UI"]
  node_browser["Browser UI<br/>[index.html]"]
  node_api_service["FastAPI endpoints<br/>[main.py]"]
  node_api_models["API schemas<br/>[models.py]"]
  node_config["Settings<br/>[config.py]"]
end

subgraph group_ingestion["Repository ingestion"]
  node_github["GitHub clone<br/>[github.py]"]
  node_parser["Repository parser<br/>[repo_parser.py]"]
end

subgraph group_indexing["Indexing and storage"]
  node_indexer["Indexer service<br/>[indexer.py]"]
  node_full_context[("Full-context bundles<br/>[repo_parser.py]")]
  node_chunking["Text chunking<br/>[chunking.py]"]
  node_embeddings["Gemini embeddings<br/>[gemini.py]"]
  node_faiss_store[("FAISS vector store<br/>[faiss_store.py]")]
  node_metadata[("Repository metadata<br/>[indexer.py]")]
end

subgraph group_answers["Question answering"]
  node_rag["RAG service<br/>[rag.py]"]
  node_gemini["Gemini generation<br/>[gemini.py]"]
  node_other_models["Alternate LLM providers<br/>[rag.py]"]
end

node_user(("User"))
node_github_service{{"GitHub"}}
node_gemini_service{{"Google Gemini API"}}
node_llm_services{{"OpenAI, Hugging Face, Ollama"}}

node_user -.->|"uses"| node_browser
node_browser -.->|"calls API"| node_api_service
node_user -->|"submits requests"| node_api_service
node_api_service -->|"uses schemas"| node_api_models
node_api_service -->|"reads settings"| node_config
node_api_service -->|"validates URLs"| node_github
node_api_service -->|"indexes repositories"| node_indexer
node_api_service -->|"asks questions"| node_rag
node_api_service -->|"lists repositories"| node_indexer
node_indexer -->|"clones repository"| node_github
node_github -->|"clones from"| node_github_service
node_indexer -->|"parses files"| node_parser
node_parser -->|"iterates files"| node_github
node_indexer -->|"reads settings"| node_config
node_indexer -->|"chunks file text"| node_chunking
node_indexer -->|"embeds chunks"| node_embeddings
node_embeddings -->|"calls embedding API"| node_gemini_service
node_indexer -->|"saves and searches"| node_faiss_store
node_indexer -->|"writes bundles"| node_full_context
node_indexer -->|"reads and writes"| node_metadata
node_rag -->|"loads or searches"| node_indexer
node_rag -->|"normalizes repository URL"| node_github
node_rag -->|"generates answer"| node_gemini
node_gemini -->|"calls generation API"| node_gemini_service
node_rag -->|"dispatches by provider"| node_other_models
node_other_models -->|"calls selected provider"| node_llm_services
node_rag -->|"returns answer and citations"| node_api_service

click node_browser "https://github.com/vasaviinumula24-code/askgithub/blob/main/static/index.html"
click node_api_service "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/main.py"
click node_api_models "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/models.py"
click node_config "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/config.py"
click node_indexer "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/indexer.py"
click node_github "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/github.py"
click node_parser "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/repo_parser.py"
click node_full_context "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/repo_parser.py"
click node_chunking "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/utils/chunking.py"
click node_embeddings "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/gemini.py"
click node_faiss_store "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/faiss_store.py"
click node_metadata "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/indexer.py"
click node_rag "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/rag.py"
click node_gemini "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/gemini.py"
click node_other_models "https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/rag.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_browser,node_api_service,node_api_models,node_config,node_user toneBlue
class node_github,node_parser toneAmber
class node_indexer,node_full_context,node_chunking,node_embeddings,node_faiss_store,node_metadata,node_gemini_service toneMint
class node_rag,node_gemini,node_other_models toneRose
class node_github_service,node_llm_services toneIndigo
```

## Components

### API and UI

- [Browser UI](https://github.com/vasaviinumula24-code/askgithub/blob/main/static/index.html): `static/index.html`
- [FastAPI endpoints](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/main.py): `app/main.py`
- [API schemas](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/models.py): `app/models.py`
- [Settings](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/config.py): `app/config.py`

### Repository ingestion

- [GitHub clone](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/github.py): `app/services/github.py`
- [Repository parser](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/repo_parser.py): `app/services/repo_parser.py`

### Indexing and storage

- [Indexer service](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/indexer.py): `app/services/indexer.py`
- [Full-context bundles](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/repo_parser.py): `app/services/repo_parser.py`
- [Text chunking](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/utils/chunking.py): `app/utils/chunking.py`
- [Gemini embeddings](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/gemini.py): `app/services/gemini.py`
- [FAISS vector store](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/faiss_store.py): `app/services/faiss_store.py`
- [Repository metadata](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/indexer.py): `app/services/indexer.py`

### Question answering

- [RAG service](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/rag.py): `app/services/rag.py`
- [Gemini generation](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/gemini.py): `app/services/gemini.py`
- [Alternate LLM providers](https://github.com/vasaviinumula24-code/askgithub/blob/main/app/services/rag.py): `app/services/rag.py`

### Other components

- **User**
- **GitHub**
- **Google Gemini API**
- **OpenAI, Hugging Face, Ollama**

## Connections

- User → Browser UI: uses (evidence: `README.md`)
- Browser UI → FastAPI endpoints: calls API (evidence: `README.md`)
- User → FastAPI endpoints: submits requests (evidence: `app/main.py`)
- FastAPI endpoints → API schemas: uses schemas (evidence: `app/main.py`)
- FastAPI endpoints → Settings: reads settings (evidence: `app/main.py`)
- FastAPI endpoints → GitHub clone: validates URLs (evidence: `app/main.py`)
- FastAPI endpoints → Indexer service: indexes repositories (evidence: `app/main.py`)
- FastAPI endpoints → RAG service: asks questions (evidence: `app/main.py`)
- FastAPI endpoints → Indexer service: lists repositories (evidence: `app/main.py`)
- Indexer service → GitHub clone: clones repository (evidence: `app/services/indexer.py`)
- GitHub clone → GitHub: clones from (evidence: `app/services/github.py`)
- Indexer service → Repository parser: parses files (evidence: `app/services/indexer.py`)
- Repository parser → GitHub clone: iterates files (evidence: `app/services/repo_parser.py`)
- Indexer service → Settings: reads settings (evidence: `app/services/indexer.py`)
- Indexer service → Text chunking: chunks file text (evidence: `app/services/indexer.py`)
- Indexer service → Gemini embeddings: embeds chunks (evidence: `app/services/indexer.py`)
- Gemini embeddings → Google Gemini API: calls embedding API (evidence: `app/services/gemini.py`)
- Indexer service → FAISS vector store: saves and searches (evidence: `app/services/indexer.py`)
- Indexer service → Full-context bundles: writes bundles (evidence: `app/services/indexer.py`)
- Indexer service → Repository metadata: reads and writes (evidence: `app/services/indexer.py`)
- RAG service → Indexer service: loads or searches (evidence: `app/services/rag.py`)
- RAG service → GitHub clone: normalizes repository URL (evidence: `app/services/rag.py`)
- RAG service → Gemini generation: generates answer (evidence: `app/services/rag.py`)
- Gemini generation → Google Gemini API: calls generation API (evidence: `app/services/gemini.py`)
- RAG service → Alternate LLM providers: dispatches by provider (evidence: `app/services/rag.py`)
- Alternate LLM providers → OpenAI, Hugging Face, Ollama: calls selected provider (evidence: `app/services/rag.py`)
- RAG service → FastAPI endpoints: returns answer and citations (evidence: `app/main.py`)
