# shrikantnaidu/chat-with-repo architecture

> Architecture diagram of the GitHub repository shrikantnaidu/chat-with-repo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shrikantnaidu/chat-with-repo
- Repository: https://github.com/shrikantnaidu/chat-with-repo

## Overview

##### Project type and purpose
- RepoChat is a full-stack, AI-powered chat application built in Python with Streamlit for the UI, LangChain orchestration, Groq LLMs for generation, and DeepLake for vector storage.
- Its purpose is to allow interactive, context-aware conversations over any GitHub repository’s code.

##### File structure
- Top level:
- main.py (Streamlit app entry point & UI)
- repos/ (local or cached repository clones or dataset folders)
- utils/process.py (handles cloning, file parsing, embedding & indexing)
- utils/chat.py (handles retrieval from vector store & LLM calls)
- requirements.txt, README.md, config (.gitignore, LICENSE)
- No separate “frontend” vs “backend” folders, but the app logically splits into UI (main.py) and service layers (utils).

##### Extract architecture hints from README
- Streamlit web interface
- GitHub repo ingestion → file parsing → vector embedding → DeepLake storage
- Chat interface → query embeddings → LLM (Groq) call
- External dependencies: GitHub API, Groq API, ActiveLoop/DeepLake

##### Main components and interactions
a. Components
1. User’s Browser (UI)
2. Streamlit App (main.py)
3. Repo Processor (utils/process.py)
4. Vector Store (DeepLake)
5. Chat Engine (utils/chat.py + LangChain)
6. LLM Service (Groq API)
7. GitHub API / Repo Source
b. Relationships / Data flow
1. User → Streamlit UI: inputs keys, repo URL, file filters
2. UI → Repo Processor: “Process Repository” action
3. Repo Processor → GitHub API: clone/fetch files → local repo folder
4. Repo Processor → file parsing → embeddings → DeepLake
5. User → Streamlit UI: ask question
6. UI → Chat Engine: query text
7. Chat Engine → DeepLake: retrieve relevant embeddings/chunks
8. Chat Engine → Groq API: send prompt + context
9. Groq API → Chat Engine: LLM response
10. Chat Engine → Streamlit UI: display answer
c. Architectural patterns
– Layered/Pipeline: UI layer, ingestion layer, storage layer, retrieval + LLM layer
– Modular service: distinct process vs chat modules
– External services: vector DB & LLM as black-boxed microservices
d. Key technologies
– Python & Streamlit (UI)
– LangChain (orchestration, prompt templates)
– Groq API (LLM inference)
– DeepLake (vector database/storage)
– GitHub API (repo ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef ui fill:#D0E6FF,stroke:#000,stroke-width:1px;
    classDef backend fill:#D0FFD0,stroke:#000,stroke-width:1px;
    classDef external fill:#FFE6B3,stroke:#000,stroke-width:1px;
    classDef datastore fill:#FFD0D0,stroke:#000,stroke-width:1px;
    classDef docs fill:#F0F0F0,stroke:#000,stroke-width:1px;

    User(["User Browser"])

    subgraph "UI Layer"
        Streamlit["Streamlit App"]:::ui
    end

    subgraph "Ingestion Pipeline"
        RepoProcessor["Repo Processor"]:::backend
        LocalCache["Local Repo Cache"]:::datastore
    end

    subgraph "Storage Layer"
        DeepLake["DeepLake Vector Store"]:::datastore
    end

    subgraph "Chat Layer"
        ChatEngine["Chat Engine"]:::backend
    end

    GitHubAPI["GitHub API"]:::external
    GroqAPI["Groq API"]:::external

    User -->|"inputs repo URL & API keys"| Streamlit
    Streamlit -->|"Process Repository"| RepoProcessor
    RepoProcessor -->|"clone/fetch files"| GitHubAPI
    RepoProcessor -->|"store files"| LocalCache
    RepoProcessor -->|"embed & index"| DeepLake

    User -->|"ask question"| Streamlit
    Streamlit -->|"send query"| ChatEngine
    ChatEngine -->|"query embeddings"| DeepLake
    ChatEngine -->|"send prompt+context"| GroqAPI
    GroqAPI -->|"LLM response"| ChatEngine
    ChatEngine -->|"display answer"| Streamlit

    subgraph "Project Files"
        Req["requirements.txt"]:::docs
        Readme["README.md"]:::docs
        License["LICENSE"]:::docs
        Gitignore[".gitignore"]:::docs
        UtilInit["utils/__init__.py"]:::docs
        RootInit["__init__.py"]:::docs
    end

    click Streamlit "https://github.com/shrikantnaidu/chat-with-repo/blob/main/main.py"
    click RepoProcessor "https://github.com/shrikantnaidu/chat-with-repo/blob/main/utils/process.py"
    click ChatEngine "https://github.com/shrikantnaidu/chat-with-repo/blob/main/utils/chat.py"
    click LocalCache "https://github.com/shrikantnaidu/chat-with-repo/tree/main/repos/"
    click Req "https://github.com/shrikantnaidu/chat-with-repo/blob/main/requirements.txt"
    click Readme "https://github.com/shrikantnaidu/chat-with-repo/blob/main/README.md"
    click License "https://github.com/shrikantnaidu/chat-with-repo/tree/main/LICENSE"
    click Gitignore "https://github.com/shrikantnaidu/chat-with-repo/blob/main/.gitignore"
    click UtilInit "https://github.com/shrikantnaidu/chat-with-repo/blob/main/utils/__init__.py"
    click RootInit "https://github.com/shrikantnaidu/chat-with-repo/blob/main/__init__.py"
```
