# ashvanth-kumar/codequeryx architecture

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

- Interactive diagram: https://gitdiagram.com/ashvanth-kumar/codequeryx
- Repository: https://github.com/ashvanth-kumar/codequeryx

## Overview

CodeQuery is a Streamlit app for asking questions about public GitHub repositories. Its main workflow is: load a repository, clone and parse its code, split files into chunks, build a vector index, retrieve relevant chunks for a question, and generate an answer with Groq. The app also displays source previews and tracks chat history. README capabilities are represented, including Sentence Transformers embeddings and the documented FAISS store. The graph follows calls shown in app.py and module excerpts; unsampled storage details and any other integrations are not inferred.

Main entry points: [`app.py`](https://github.com/ashvanth-kumar/codequeryx/blob/main/app.py) (Streamlit chat app), [`repo_loader.py`](https://github.com/ashvanth-kumar/codequeryx/blob/main/repo_loader.py) (Repository loader), [`rag_engine.py`](https://github.com/ashvanth-kumar/codequeryx/blob/main/rag_engine.py) (Context and answer engine), [`vector_store.py`](https://github.com/ashvanth-kumar/codequeryx/blob/main/vector_store.py) (Embedding and vector search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_streamlit_app["Streamlit chat app<br/>[app.py]"]
  node_answer_sources["Answer and sources<br/>[app.py]"]
end

subgraph group_ingestion["Repository ingestion"]
  node_repo_loader["Repository loader<br/>[repo_loader.py]"]
  node_repo_clone["Clone repository<br/>[repo_loader.py]"]
  node_code_parser["Parse code files<br/>[repo_loader.py]"]
  node_code_chunker["Chunk code<br/>[chunker.py]"]
end

subgraph group_qa["Search and answers"]
  node_vector_store[("Embedding and vector search<br/>[vector_store.py]")]
  node_rag_engine["Context and answer engine<br/>[rag_engine.py]"]
end

node_user(("Questioner"))
node_github_repo["GitHub repository"]
node_groq_api{{"Groq LLM API"}}

node_user -->|"submits URL and questions"| node_streamlit_app
node_streamlit_app -->|"loads repository"| node_repo_loader
node_github_repo -->|"clones from"| node_repo_clone
node_repo_loader -->|"calls clone_repo"| node_repo_clone
node_repo_loader -->|"calls parse_files"| node_code_parser
node_streamlit_app -->|"chunks documents"| node_code_chunker
node_streamlit_app -->|"builds index"| node_vector_store
node_streamlit_app -->|"searches query"| node_vector_store
node_streamlit_app -->|"answers with results"| node_rag_engine
node_rag_engine -->|"requests completion"| node_groq_api
node_streamlit_app -->|"shows answer and sources"| node_answer_sources

click node_streamlit_app "https://github.com/ashvanth-kumar/codequeryx/blob/main/app.py"
click node_repo_loader "https://github.com/ashvanth-kumar/codequeryx/blob/main/repo_loader.py"
click node_repo_clone "https://github.com/ashvanth-kumar/codequeryx/blob/main/repo_loader.py"
click node_code_parser "https://github.com/ashvanth-kumar/codequeryx/blob/main/repo_loader.py"
click node_code_chunker "https://github.com/ashvanth-kumar/codequeryx/blob/main/chunker.py"
click node_vector_store "https://github.com/ashvanth-kumar/codequeryx/blob/main/vector_store.py"
click node_rag_engine "https://github.com/ashvanth-kumar/codequeryx/blob/main/rag_engine.py"
click node_answer_sources "https://github.com/ashvanth-kumar/codequeryx/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_streamlit_app,node_answer_sources toneBlue
class node_repo_loader,node_repo_clone,node_code_parser,node_code_chunker toneAmber
class node_vector_store,node_rag_engine,node_groq_api toneMint
class node_user,node_github_repo toneIndigo
```

## Components

### User interface

- [Streamlit chat app](https://github.com/ashvanth-kumar/codequeryx/blob/main/app.py): `app.py`
- [Answer and sources](https://github.com/ashvanth-kumar/codequeryx/blob/main/app.py): `app.py`

### Repository ingestion

- [Repository loader](https://github.com/ashvanth-kumar/codequeryx/blob/main/repo_loader.py): `repo_loader.py`
- [Clone repository](https://github.com/ashvanth-kumar/codequeryx/blob/main/repo_loader.py): `repo_loader.py`
- [Parse code files](https://github.com/ashvanth-kumar/codequeryx/blob/main/repo_loader.py): `repo_loader.py`
- [Chunk code](https://github.com/ashvanth-kumar/codequeryx/blob/main/chunker.py): `chunker.py`

### Search and answers

- [Embedding and vector search](https://github.com/ashvanth-kumar/codequeryx/blob/main/vector_store.py): `vector_store.py`
- [Context and answer engine](https://github.com/ashvanth-kumar/codequeryx/blob/main/rag_engine.py): `rag_engine.py`

### Other components

- **Questioner**
- **GitHub repository**
- **Groq LLM API**

## Connections

- Questioner → Streamlit chat app: submits URL and questions (evidence: `README.md`)
- Streamlit chat app → Repository loader: loads repository (evidence: `app.py`)
- GitHub repository → Clone repository: clones from (evidence: `README.md`)
- Repository loader → Clone repository: calls clone_repo (evidence: `repo_loader.py`)
- Repository loader → Parse code files: calls parse_files (evidence: `repo_loader.py`)
- Streamlit chat app → Chunk code: chunks documents (evidence: `app.py`)
- Streamlit chat app → Embedding and vector search: builds index (evidence: `app.py`)
- Streamlit chat app → Embedding and vector search: searches query (evidence: `app.py`)
- Streamlit chat app → Context and answer engine: answers with results (evidence: `app.py`)
- Context and answer engine → Groq LLM API: requests completion (evidence: `rag_engine.py`)
- Streamlit chat app → Answer and sources: shows answer and sources (evidence: `app.py`)
