# rozainmalik/repomind-ai architecture

> Architecture diagram of the GitHub repository rozainmalik/repomind-ai, 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/rozainmalik/repomind-ai
- Repository: https://github.com/rozainmalik/repomind-ai

## Overview

RepoMind AI indexes public GitHub repositories locally, then answers repository-specific questions with cited files and line ranges. The main workflow runs from repository submission through clone and indexing, followed by question embedding, repository-filtered retrieval, prompt construction, and local LLM generation. The graph also includes repository management and the frontend’s browsing/chat surfaces. Relationships are based on sampled source, the SOURCE INDEX, and README workflow documentation; some service internals are documented but not excerpted.

Main entry points: [`backend/app/services/indexing_service.py`](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/indexing_service.py) (Indexing orchestrator), [`frontend/src/App.jsx`](https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/App.jsx) (Application shell), [`backend/app/services/repository_service.py`](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/repository_service.py) (Repository lifecycle), [`backend/app/services/chat_service.py`](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/chat_service.py) (Chat orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_app_ui["Application shell<br/>[App.jsx]"]
  node_add_repo["Add repository<br/>[AddRepository.jsx]"]
  node_sidebar["Repository sidebar<br/>[Sidebar.jsx]"]
  node_chat_view["Chat view<br/>[ChatView.jsx]"]
  node_icons["UI icons<br/>[icons.jsx]"]
  node_frontend_api["API client<br/>[api.js]"]
end

subgraph group_api["API and repository lifecycle"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_repository_routes["Repository endpoints<br/>[repositories.py]"]
  node_repository_service["Repository lifecycle"]
  node_chat_route["Chat endpoint<br/>[chat.py]"]
  node_repository_schema["Repository API schema<br/>[repository.py]"]
end

subgraph group_indexing["Repository indexing"]
  node_parser["Source file parser<br/>[parser_service.py]"]
  node_chunker["Code chunker"]
  node_chunk_schema["Chunk representation<br/>[chunk.py]"]
  node_embedder["Local embeddings"]
  node_indexer["Indexing orchestrator"]
end

subgraph group_qa["Question answering"]
  node_retrieval["Filtered retrieval"]
  node_prompt["Prompt builder<br/>[prompt_service.py]"]
  node_chat_service["Chat orchestration<br/>[chat_service.py]"]
  node_llm["Local LLM client<br/>[llm_service.py]"]
end

subgraph group_storage["Persistence and models"]
  node_repository_model["Repository metadata<br/>[repository.py]"]
  node_postgres[("PostgreSQL")]
  node_qdrant_service["Vector store access<br/>[qdrant_service.py]"]
  node_qdrant[("Qdrant")]
end

node_user(("User"))
node_github(("GitHub repository"))
node_ollama(("Ollama"))

node_user -->|"submits URL"| node_add_repo
node_add_repo -->|"invokes callback"| node_app_ui
node_app_ui -->|"requests repository actions"| node_frontend_api
node_app_ui -->|"renders"| node_sidebar
node_app_ui -->|"renders"| node_chat_view
node_sidebar -->|"renders"| node_icons
node_chat_view -->|"renders"| node_icons
node_frontend_api -.->|"calls API"| node_fastapi
node_fastapi -->|"registers routes"| node_repository_routes
node_fastapi -->|"registers routes"| node_chat_route
node_repository_routes -->|"delegates"| node_repository_service
node_repository_routes -->|"uses schema"| node_repository_schema
node_chat_route -->|"delegates"| node_chat_service
node_repository_service -->|"manages records"| node_repository_model
node_repository_model -->|"stores metadata"| node_postgres
node_repository_service -->|"clones repository"| node_github
node_repository_service -->|"starts indexing"| node_indexer
node_indexer -->|"finds source files"| node_parser
node_indexer -->|"chunks files"| node_chunker
node_indexer -->|"embeds chunks"| node_embedder
node_indexer -->|"stores vectors"| node_qdrant_service
node_chunker -->|"creates chunks"| node_chunk_schema
node_embedder -->|"reads chunks"| node_chunk_schema
node_qdrant_service -->|"stores and searches"| node_qdrant
node_chat_service -->|"retrieves context"| node_retrieval
node_retrieval -->|"embeds question"| node_embedder
node_retrieval -->|"searches candidates"| node_qdrant_service
node_chat_service -->|"builds prompt"| node_prompt
node_chat_service -->|"generates answer"| node_llm
node_llm -->|"requests completion"| node_ollama

click node_app_ui "https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/App.jsx"
click node_add_repo "https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/components/AddRepository.jsx"
click node_sidebar "https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/components/Sidebar.jsx"
click node_chat_view "https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/components/ChatView.jsx"
click node_icons "https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/components/icons.jsx"
click node_frontend_api "https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/services/api.js"
click node_fastapi "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/main.py"
click node_repository_routes "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/api/v1/endpoints/repositories.py"
click node_repository_service "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/repository_service.py"
click node_chat_route "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/routes/chat.py"
click node_repository_model "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/models/repository.py"
click node_repository_schema "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/schemas/repository.py"
click node_parser "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/parser_service.py"
click node_chunker "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/chunking_service.py"
click node_chunk_schema "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/schemas/chunk.py"
click node_embedder "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/embedding_service.py"
click node_indexer "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/indexing_service.py"
click node_retrieval "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/retrieval_service.py"
click node_prompt "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/prompt_service.py"
click node_chat_service "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/chat_service.py"
click node_llm "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/llm_service.py"
click node_qdrant_service "https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/qdrant_service.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_app_ui,node_add_repo,node_sidebar,node_chat_view,node_icons,node_frontend_api,node_user toneBlue
class node_fastapi,node_repository_routes,node_repository_service,node_chat_route,node_repository_schema toneAmber
class node_parser,node_chunker,node_chunk_schema,node_embedder,node_indexer toneMint
class node_retrieval,node_prompt,node_chat_service,node_llm toneRose
class node_repository_model,node_postgres,node_qdrant_service,node_qdrant,node_github,node_ollama toneIndigo
```

## Components

### User interface

- [Application shell](https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Add repository](https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/components/AddRepository.jsx): `frontend/src/components/AddRepository.jsx`
- [Repository sidebar](https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`
- [Chat view](https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/components/ChatView.jsx): `frontend/src/components/ChatView.jsx`
- [UI icons](https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/components/icons.jsx): `frontend/src/components/icons.jsx`
- [API client](https://github.com/rozainmalik/repomind-ai/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and repository lifecycle

- [FastAPI application](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Repository endpoints](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/api/v1/endpoints/repositories.py): `backend/app/api/v1/endpoints/repositories.py`
- [Repository lifecycle](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/repository_service.py): `backend/app/services/repository_service.py`
- [Chat endpoint](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/routes/chat.py): `backend/app/routes/chat.py`
- [Repository API schema](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/schemas/repository.py): `backend/app/schemas/repository.py`

### Repository indexing

- [Source file parser](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/parser_service.py): `backend/app/services/parser_service.py`
- [Code chunker](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/chunking_service.py): `backend/app/services/chunking_service.py`
- [Chunk representation](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/schemas/chunk.py): `backend/app/schemas/chunk.py`
- [Local embeddings](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/embedding_service.py): `backend/app/services/embedding_service.py`
- [Indexing orchestrator](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/indexing_service.py): `backend/app/services/indexing_service.py`

### Question answering

- [Filtered retrieval](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/retrieval_service.py): `backend/app/services/retrieval_service.py`
- [Prompt builder](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/prompt_service.py): `backend/app/services/prompt_service.py`
- [Chat orchestration](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/chat_service.py): `backend/app/services/chat_service.py`
- [Local LLM client](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/llm_service.py): `backend/app/services/llm_service.py`

### Persistence and models

- [Repository metadata](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/models/repository.py): `backend/app/models/repository.py`
- **PostgreSQL**
- [Vector store access](https://github.com/rozainmalik/repomind-ai/blob/main/backend/app/services/qdrant_service.py): `backend/app/services/qdrant_service.py`
- **Qdrant**

### Other components

- **User**
- **GitHub repository**
- **Ollama**

## Connections

- User → Add repository: submits URL (evidence: `frontend/src/components/AddRepository.jsx`)
- Add repository → Application shell: invokes callback (evidence: `frontend/src/components/AddRepository.jsx`)
- Application shell → API client: requests repository actions (evidence: `frontend/src/App.jsx`)
- Application shell → Repository sidebar: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Chat view: renders (evidence: `frontend/src/App.jsx`)
- Repository sidebar → UI icons: renders (evidence: `frontend/src/components/Sidebar.jsx`)
- Chat view → UI icons: renders (evidence: `frontend/src/components/ChatView.jsx`)
- API client → FastAPI application: calls API
- FastAPI application → Repository endpoints: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Chat endpoint: registers routes (evidence: `backend/app/main.py`)
- Repository endpoints → Repository lifecycle: delegates (evidence: `backend/app/api/v1/endpoints/repositories.py`)
- Repository endpoints → Repository API schema: uses schema (evidence: `backend/app/api/v1/endpoints/repositories.py`)
- Chat endpoint → Chat orchestration: delegates (evidence: `backend/app/routes/chat.py`)
- Repository lifecycle → Repository metadata: manages records (evidence: `backend/app/services/repository_service.py`)
- Repository metadata → PostgreSQL: stores metadata
- Repository lifecycle → GitHub repository: clones repository (evidence: `backend/app/services/repository_service.py`)
- Repository lifecycle → Indexing orchestrator: starts indexing (evidence: `backend/app/services/repository_service.py`)
- Indexing orchestrator → Source file parser: finds source files (evidence: `backend/app/services/indexing_service.py`)
- Indexing orchestrator → Code chunker: chunks files (evidence: `backend/app/services/indexing_service.py`)
- Indexing orchestrator → Local embeddings: embeds chunks (evidence: `backend/app/services/indexing_service.py`)
- Indexing orchestrator → Vector store access: stores vectors (evidence: `backend/app/services/indexing_service.py`)
- Code chunker → Chunk representation: creates chunks (evidence: `backend/app/services/chunking_service.py`)
- Local embeddings → Chunk representation: reads chunks (evidence: `backend/app/services/embedding_service.py`)
- Vector store access → Qdrant: stores and searches
- Chat orchestration → Filtered retrieval: retrieves context (evidence: `backend/app/services/chat_service.py`)
- Filtered retrieval → Local embeddings: embeds question (evidence: `backend/app/services/retrieval_service.py`)
- Filtered retrieval → Vector store access: searches candidates (evidence: `backend/app/services/retrieval_service.py`)
- Chat orchestration → Prompt builder: builds prompt (evidence: `backend/app/services/chat_service.py`)
- Chat orchestration → Local LLM client: generates answer (evidence: `backend/app/services/chat_service.py`)
- Local LLM client → Ollama: requests completion (evidence: `backend/app/services/llm_service.py`)
