# addlinejebaprincy/ai-repository-assistent architecture

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

- Interactive diagram: https://gitdiagram.com/addlinejebaprincy/ai-repository-assistent
- Repository: https://github.com/addlinejebaprincy/ai-repository-assistent

## Overview

AI Repository Assistant indexes Python functions and GitHub issue/PR text, then answers user questions using retrieved repository context. The main flow runs from the React chat through Flask, retrieval, grounded generation, and streamed SSE events back to the UI. A separate ingestion flow clones the configured repositories, extracts code and issue records, embeds them, and stores them in Qdrant. The ingestion orchestration and request path are documented; individual integration details are included where supported by the sampled source.

Main entry points: [`build_walled_garden.py`](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/build_walled_garden.py) (Ingestion coordinator), [`generator.py`](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/generator.py) (Grounded generator), [`retriever.py`](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/retriever.py) (Semantic retrieval), [`app.py`](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/app.py) (Ask API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Chat interface"]
  node_frontend["Chat UI<br/>[App.jsx]"]
end

subgraph group_answer["Question answering"]
  node_flask["Ask API<br/>[app.py]"]
  node_generator["Grounded generator<br/>[generator.py]"]
  node_retriever["Semantic retrieval<br/>[retriever.py]"]
end

subgraph group_ingest["Repository ingestion"]
  node_downloader["Repository clone<br/>[repo_downloader.py]"]
  node_github_fetch["Issue fetcher"]
  node_builder["Ingestion coordinator"]
  node_code_parser["Function extractor<br/>[core_parser.py]"]
  node_issue_parser["Issue normalizer<br/>[issue_parser.py]"]
end

subgraph group_index["Vector indexing"]
  node_qdrant[("Qdrant collection")]
  node_vector_db["Embedding and upload<br/>[vector_db.py]"]
end

node_user(("Developer"))
node_hf["Hugging Face API"]
node_ollama["Ollama model"]
node_groq["Groq model"]
node_repo_source["Configured repositories"]
node_github_api["GitHub REST API"]
node_embed_model["Sentence Transformers"]

node_user -->|"asks"| node_frontend
node_frontend -->|"POST query"| node_flask
node_flask -->|"streams answer"| node_generator
node_generator -->|"searches"| node_retriever
node_retriever -->|"embeds query"| node_hf
node_retriever -->|"searches vectors"| node_qdrant
node_qdrant -->|"returns matches"| node_retriever
node_retriever -->|"returns context"| node_generator
node_generator -.->|"generates locally"| node_ollama
node_generator -.->|"generates hosted"| node_groq
node_generator -->|"yields SSE events"| node_flask
node_flask -->|"streams SSE"| node_frontend
node_repo_source -->|"provides repositories"| node_downloader
node_builder -->|"clones"| node_downloader
node_builder -->|"requests issues"| node_github_fetch
node_github_fetch -->|"fetches issues"| node_github_api
node_builder -->|"normalizes cached JSON"| node_issue_parser
node_builder -->|"extracts functions"| node_code_parser
node_downloader -->|"returns clone path"| node_builder
node_issue_parser -->|"returns issue records"| node_builder
node_code_parser -->|"returns function records"| node_builder
node_vector_db -->|"processes repositories"| node_builder
node_vector_db -->|"embeds records"| node_embed_model
node_vector_db -->|"writes vectors and payloads"| node_qdrant

click node_frontend "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/frontend/src/App.jsx"
click node_flask "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/app.py"
click node_generator "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/generator.py"
click node_retriever "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/retriever.py"
click node_downloader "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/repo_downloader.py"
click node_github_fetch "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/github_api_fetcher.py"
click node_builder "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/build_walled_garden.py"
click node_code_parser "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/core_parser.py"
click node_issue_parser "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/issue_parser.py"
click node_vector_db "https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/vector_db.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_frontend toneBlue
class node_flask,node_generator,node_retriever toneAmber
class node_downloader,node_github_fetch,node_builder,node_code_parser,node_issue_parser,node_hf,node_github_api toneMint
class node_qdrant,node_vector_db toneRose
class node_user,node_ollama,node_groq,node_repo_source,node_embed_model toneIndigo
```

## Components

### Chat interface

- [Chat UI](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Question answering

- [Ask API](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/app.py): `app.py`
- [Grounded generator](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/generator.py): `generator.py`
- [Semantic retrieval](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/retriever.py): `retriever.py`

### Repository ingestion

- [Repository clone](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/repo_downloader.py): `repo_downloader.py`
- [Issue fetcher](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/github_api_fetcher.py): `github_api_fetcher.py`
- [Ingestion coordinator](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/build_walled_garden.py): `build_walled_garden.py`
- [Function extractor](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/core_parser.py): `core_parser.py`
- [Issue normalizer](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/issue_parser.py): `issue_parser.py`

### Vector indexing

- **Qdrant collection**
- [Embedding and upload](https://github.com/addlinejebaprincy/ai-repository-assistent/blob/main/vector_db.py): `vector_db.py`

### Other components

- **Developer**
- **Hugging Face API**
- **Ollama model**
- **Groq model**
- **Configured repositories**
- **GitHub REST API**
- **Sentence Transformers**

## Connections

- Developer → Chat UI: asks
- Chat UI → Ask API: POST query
- Ask API → Grounded generator: streams answer
- Grounded generator → Semantic retrieval: searches
- Semantic retrieval → Hugging Face API: embeds query
- Semantic retrieval → Qdrant collection: searches vectors
- Qdrant collection → Semantic retrieval: returns matches
- Semantic retrieval → Grounded generator: returns context
- Grounded generator → Ollama model: generates locally
- Grounded generator → Groq model: generates hosted
- Grounded generator → Ask API: yields SSE events
- Ask API → Chat UI: streams SSE
- Configured repositories → Repository clone: provides repositories
- Ingestion coordinator → Repository clone: clones
- Ingestion coordinator → Issue fetcher: requests issues
- Issue fetcher → GitHub REST API: fetches issues
- Ingestion coordinator → Issue normalizer: normalizes cached JSON
- Ingestion coordinator → Function extractor: extracts functions
- Repository clone → Ingestion coordinator: returns clone path
- Issue normalizer → Ingestion coordinator: returns issue records
- Function extractor → Ingestion coordinator: returns function records
- Embedding and upload → Ingestion coordinator: processes repositories
- Embedding and upload → Sentence Transformers: embeds records
- Embedding and upload → Qdrant collection: writes vectors and payloads
