# mitali-gautam05/stack_match architecture

> Architecture diagram of the GitHub repository mitali-gautam05/stack_match, 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/mitali-gautam05/stack_match
- Repository: https://github.com/mitali-gautam05/stack_match

## Overview

StackMatch detects duplicate GitHub issues by separating prose from code/stack traces, embedding each signal, and retrieving similar issues with fused similarity. Users can search by issue URL, check duplicates within a repository, scan recent issues, or enter text manually; the separate webhook bot searches new issues and can post comments. The documented data pipeline mines labeled duplicates, segments and embeds them, then evaluates retrieval. Some stages and optional UI modes are documented but their full implementation was not sampled, so those links cite the README.

Main entry points: [`bot/searcher.py`](https://github.com/mitali-gautam05/stack_match/blob/main/bot/searcher.py) (Similarity Search), [`app.py`](https://github.com/mitali-gautam05/stack_match/blob/main/app.py) (Gradio App), [`bot/fetcher.py`](https://github.com/mitali-gautam05/stack_match/blob/main/bot/fetcher.py) (Issue Fetcher), [`bot/repo_checker.py`](https://github.com/mitali-gautam05/stack_match/blob/main/bot/repo_checker.py) (Repository Checker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Data Pipeline"]
  node_scraper["Pair Scraper<br/>[github_scraper.py]"]
  node_pairs["Duplicate Pairs"]
  node_segmenter["Issue Segmenter<br/>[segmenter.py]"]
  node_embedder["Dual Embedder<br/>[embedder.py]"]
  node_vectors["Embedding Data<br/>[embeddings.npz]"]
  node_metadata["Issue Metadata<br/>[metadata.json]"]
end

subgraph group_retrieval["Search and Evaluation"]
  node_searcher["Similarity Search<br/>[searcher.py]"]
  node_fusion["Score Fusion<br/>[searcher.py]"]
  node_evaluator["Retrieval Evaluator<br/>[evaluator.py]"]
  node_alpha["Alpha Tuning<br/>[alpha_tuner.py]"]
  node_negative["Hard Negative Mining"]
  node_crossrepo["Cross-Repo Search<br/>[cross_repo.py]"]
end

subgraph group_ui["User Interfaces"]
  node_app["Gradio App<br/>[app.py]"]
  node_repocheck["Repository Checker<br/>[repo_checker.py]"]
end

subgraph group_bot["Webhook Bot"]
  node_webhook["Webhook Server<br/>[webhook.py]"]
  node_commenter["Comment Publisher<br/>[commenter.py]"]
end

subgraph group_integrations["GitHub Integration"]
  node_fetcher["Issue Fetcher<br/>[fetcher.py]"]
end

node_user(("User"))
node_github(("GitHub"))
node_externalissues[("GitHub Issues")]

node_github -->|"provides issues"| node_scraper
node_scraper -->|"saves pairs"| node_pairs
node_pairs -->|"segments pairs"| node_segmenter
node_segmenter -->|"provides segments"| node_embedder
node_embedder -->|"saves vectors"| node_vectors
node_embedder -->|"saves metadata"| node_metadata
node_vectors -->|"loads vectors"| node_searcher
node_metadata -->|"loads metadata"| node_searcher
node_searcher -->|"segments query"| node_segmenter
node_searcher -->|"fuses scores"| node_fusion
node_evaluator -->|"reads embeddings"| node_vectors
node_evaluator -->|"reads metadata"| node_metadata
node_alpha -.->|"tunes evaluation"| node_evaluator
node_negative -.->|"supports evaluation"| node_evaluator
node_user -->|"submits query"| node_app
node_app -->|"fetches issue"| node_fetcher
node_app -->|"checks repository"| node_repocheck
node_app -->|"searches issue"| node_searcher
node_app -->|"scans repository"| node_fetcher
node_app -.->|"offers cross-repo search"| node_crossrepo
node_fetcher -->|"fetches issues"| node_github
node_repocheck -->|"fetches query"| node_fetcher
node_repocheck -->|"segments query"| node_segmenter
node_repocheck -->|"uses embeddings"| node_searcher
node_crossrepo -->|"fetches issue"| node_fetcher
node_crossrepo -->|"searches issues"| node_searcher
node_github -->|"sends events"| node_webhook
node_webhook -->|"searches issue"| node_searcher
node_webhook -->|"routes results"| node_commenter
node_commenter -->|"posts comments"| node_github
node_fetcher -->|"reads issue data"| node_externalissues
node_repocheck -->|"lists repo issues"| node_externalissues

click node_scraper "https://github.com/mitali-gautam05/stack_match/blob/main/scraper/github_scraper.py"
click node_pairs "https://github.com/mitali-gautam05/stack_match/blob/main/data/segmented_pairs.json"
click node_segmenter "https://github.com/mitali-gautam05/stack_match/blob/main/segmenter/segmenter.py"
click node_embedder "https://github.com/mitali-gautam05/stack_match/blob/main/embedder/embedder.py"
click node_vectors "https://github.com/mitali-gautam05/stack_match/blob/main/data/embeddings.npz"
click node_metadata "https://github.com/mitali-gautam05/stack_match/blob/main/data/metadata.json"
click node_searcher "https://github.com/mitali-gautam05/stack_match/blob/main/bot/searcher.py"
click node_fusion "https://github.com/mitali-gautam05/stack_match/blob/main/bot/searcher.py"
click node_evaluator "https://github.com/mitali-gautam05/stack_match/blob/main/evaluator/evaluator.py"
click node_alpha "https://github.com/mitali-gautam05/stack_match/blob/main/evaluator/alpha_tuner.py"
click node_negative "https://github.com/mitali-gautam05/stack_match/blob/main/evaluator/hard_negative_miner.py"
click node_crossrepo "https://github.com/mitali-gautam05/stack_match/blob/main/evaluator/cross_repo.py"
click node_app "https://github.com/mitali-gautam05/stack_match/blob/main/app.py"
click node_fetcher "https://github.com/mitali-gautam05/stack_match/blob/main/bot/fetcher.py"
click node_repocheck "https://github.com/mitali-gautam05/stack_match/blob/main/bot/repo_checker.py"
click node_webhook "https://github.com/mitali-gautam05/stack_match/blob/main/bot/webhook.py"
click node_commenter "https://github.com/mitali-gautam05/stack_match/blob/main/bot/commenter.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_scraper,node_pairs,node_segmenter,node_embedder,node_vectors,node_metadata,node_user toneBlue
class node_searcher,node_fusion,node_evaluator,node_alpha,node_negative,node_crossrepo,node_externalissues toneAmber
class node_app,node_repocheck toneMint
class node_webhook,node_commenter toneRose
class node_fetcher,node_github toneIndigo
```

## Components

### Data Pipeline

- [Pair Scraper](https://github.com/mitali-gautam05/stack_match/blob/main/scraper/github_scraper.py): `scraper/github_scraper.py`
- [Duplicate Pairs](https://github.com/mitali-gautam05/stack_match/blob/main/data/segmented_pairs.json): `data/segmented_pairs.json`
- [Issue Segmenter](https://github.com/mitali-gautam05/stack_match/blob/main/segmenter/segmenter.py): `segmenter/segmenter.py`
- [Dual Embedder](https://github.com/mitali-gautam05/stack_match/blob/main/embedder/embedder.py): `embedder/embedder.py`
- [Embedding Data](https://github.com/mitali-gautam05/stack_match/blob/main/data/embeddings.npz): `data/embeddings.npz`
- [Issue Metadata](https://github.com/mitali-gautam05/stack_match/blob/main/data/metadata.json): `data/metadata.json`

### Search and Evaluation

- [Similarity Search](https://github.com/mitali-gautam05/stack_match/blob/main/bot/searcher.py): `bot/searcher.py`
- [Score Fusion](https://github.com/mitali-gautam05/stack_match/blob/main/bot/searcher.py): `bot/searcher.py`
- [Retrieval Evaluator](https://github.com/mitali-gautam05/stack_match/blob/main/evaluator/evaluator.py): `evaluator/evaluator.py`
- [Alpha Tuning](https://github.com/mitali-gautam05/stack_match/blob/main/evaluator/alpha_tuner.py): `evaluator/alpha_tuner.py`
- [Hard Negative Mining](https://github.com/mitali-gautam05/stack_match/blob/main/evaluator/hard_negative_miner.py): `evaluator/hard_negative_miner.py`
- [Cross-Repo Search](https://github.com/mitali-gautam05/stack_match/blob/main/evaluator/cross_repo.py): `evaluator/cross_repo.py`

### User Interfaces

- [Gradio App](https://github.com/mitali-gautam05/stack_match/blob/main/app.py): `app.py`
- [Repository Checker](https://github.com/mitali-gautam05/stack_match/blob/main/bot/repo_checker.py): `bot/repo_checker.py`

### Webhook Bot

- [Webhook Server](https://github.com/mitali-gautam05/stack_match/blob/main/bot/webhook.py): `bot/webhook.py`
- [Comment Publisher](https://github.com/mitali-gautam05/stack_match/blob/main/bot/commenter.py): `bot/commenter.py`

### GitHub Integration

- [Issue Fetcher](https://github.com/mitali-gautam05/stack_match/blob/main/bot/fetcher.py): `bot/fetcher.py`

### Other components

- **User**
- **GitHub**
- **GitHub Issues**

## Connections

- GitHub → Pair Scraper: provides issues (evidence: `README.MD`)
- Pair Scraper → Duplicate Pairs: saves pairs (evidence: `README.MD`)
- Duplicate Pairs → Issue Segmenter: segments pairs (evidence: `README.MD`)
- Issue Segmenter → Dual Embedder: provides segments (evidence: `README.MD`)
- Dual Embedder → Embedding Data: saves vectors (evidence: `README.MD`)
- Dual Embedder → Issue Metadata: saves metadata (evidence: `README.MD`)
- Embedding Data → Similarity Search: loads vectors (evidence: `bot/searcher.py`)
- Issue Metadata → Similarity Search: loads metadata (evidence: `bot/searcher.py`)
- Similarity Search → Issue Segmenter: segments query (evidence: `bot/searcher.py`)
- Similarity Search → Score Fusion: fuses scores (evidence: `bot/searcher.py`)
- Retrieval Evaluator → Embedding Data: reads embeddings (evidence: `README.MD`)
- Retrieval Evaluator → Issue Metadata: reads metadata (evidence: `README.MD`)
- Alpha Tuning → Retrieval Evaluator: tunes evaluation
- Hard Negative Mining → Retrieval Evaluator: supports evaluation
- User → Gradio App: submits query (evidence: `README.MD`)
- Gradio App → Issue Fetcher: fetches issue (evidence: `app.py`)
- Gradio App → Repository Checker: checks repository (evidence: `app.py`)
- Gradio App → Similarity Search: searches issue (evidence: `app.py`)
- Gradio App → Issue Fetcher: scans repository (evidence: `README.MD`)
- Gradio App → Cross-Repo Search: offers cross-repo search
- Issue Fetcher → GitHub: fetches issues (evidence: `bot/fetcher.py`)
- Repository Checker → Issue Fetcher: fetches query (evidence: `bot/repo_checker.py`)
- Repository Checker → Issue Segmenter: segments query (evidence: `bot/repo_checker.py`)
- Repository Checker → Similarity Search: uses embeddings (evidence: `bot/repo_checker.py`)
- Cross-Repo Search → Issue Fetcher: fetches issue (evidence: `evaluator/cross_repo.py`)
- Cross-Repo Search → Similarity Search: searches issues (evidence: `evaluator/cross_repo.py`)
- GitHub → Webhook Server: sends events (evidence: `README.MD`)
- Webhook Server → Similarity Search: searches issue (evidence: `bot/webhook.py`)
- Webhook Server → Comment Publisher: routes results (evidence: `bot/webhook.py`)
- Comment Publisher → GitHub: posts comments (evidence: `bot/commenter.py`)
- Issue Fetcher → GitHub Issues: reads issue data (evidence: `bot/fetcher.py`)
- Repository Checker → GitHub Issues: lists repo issues (evidence: `bot/repo_checker.py`)
