# rashmigowda1206/matchnexa-ai architecture

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

- Interactive diagram: https://gitdiagram.com/rashmigowda1206/matchnexa-ai
- Repository: https://github.com/rashmigowda1206/matchnexa-ai

## Overview

MatchNexa resolves business records from Source 2 and Source 3 against Source 1, emphasizing high-precision matches and correct singleton handling. The CLI starts an orchestrated workflow: records are normalized, candidates are generated by multi-pass blocking, candidate pairs are featurized, and a LightGBM model is trained and threshold-tuned against Macro F0.5 before test predictions and two TSV outputs are written. The README documents additional normalization and blocking capabilities not all visible in excerpts; unsampled implementation details are represented only where documented, and edges reflect shown calls or documented workflow.

Main entry points: [`src/pipeline.py`](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/pipeline.py) (Resolution pipeline), [`src/main.py`](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/main.py) (CLI entry), [`src/blocking.py`](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/blocking.py) (Multi-pass blocker), [`src/features.py`](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/features.py) (Pair feature extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and orchestration"]
  node_cli["CLI entry<br/>[main.py]"]
  node_pipeline["Resolution pipeline<br/>[pipeline.py]"]
end

subgraph group_records["Record preparation"]
  node_normalization["Record normalization<br/>[preprocessing.py]"]
end

subgraph group_matching["Candidate matching"]
  node_blocker["Multi-pass blocker<br/>[blocking.py]"]
  node_candidates["Candidate pairs<br/>[blocking.py]"]
  node_features["Pair feature extraction<br/>[features.py]"]
  node_featurevectors["Pair feature vectors<br/>[features.py]"]
end

subgraph group_evaluation["Decision and outputs"]
  node_classifier["Pair classifier<br/>[model.py]"]
  node_threshold["Threshold tuning<br/>[model.py]"]
  node_metrics["Macro F0.5 metrics<br/>[metrics.py]"]
  node_predictions["Match predictions<br/>[model.py]"]
  node_candidatefile["Candidate TSV<br/>[pipeline.py]"]
  node_resultfile["Matching TSV<br/>[pipeline.py]"]
end

node_operator(("Operator"))
node_inputdata["Challenge datasets"]

node_operator -->|"runs"| node_cli
node_cli -->|"starts"| node_pipeline
node_pipeline -->|"loads"| node_inputdata
node_pipeline -->|"normalizes"| node_normalization
node_pipeline -->|"generates candidates"| node_blocker
node_blocker -->|"returns"| node_candidates
node_pipeline -->|"extracts features"| node_features
node_features -->|"produces"| node_featurevectors
node_pipeline -->|"trains"| node_classifier
node_pipeline -->|"tunes threshold"| node_threshold
node_threshold -->|"scores"| node_metrics
node_pipeline -->|"requests inference"| node_predictions
node_classifier -->|"predicts matches"| node_predictions
node_pipeline -->|"writes candidates"| node_candidatefile
node_pipeline -->|"writes matches"| node_resultfile

click node_cli "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/main.py"
click node_pipeline "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/pipeline.py"
click node_normalization "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/preprocessing.py"
click node_blocker "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/blocking.py"
click node_candidates "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/blocking.py"
click node_features "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/features.py"
click node_featurevectors "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/features.py"
click node_classifier "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/model.py"
click node_threshold "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/model.py"
click node_metrics "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/metrics.py"
click node_predictions "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/model.py"
click node_candidatefile "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/pipeline.py"
click node_resultfile "https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/pipeline.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_cli,node_pipeline toneBlue
class node_normalization toneAmber
class node_blocker,node_candidates,node_features,node_featurevectors toneMint
class node_classifier,node_threshold,node_metrics,node_predictions,node_candidatefile,node_resultfile toneRose
class node_operator,node_inputdata toneIndigo
```

## Components

### Entry and orchestration

- [CLI entry](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/main.py): `src/main.py`
- [Resolution pipeline](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/pipeline.py): `src/pipeline.py`

### Record preparation

- [Record normalization](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/preprocessing.py): `src/preprocessing.py`

### Candidate matching

- [Multi-pass blocker](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/blocking.py): `src/blocking.py`
- [Candidate pairs](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/blocking.py): `src/blocking.py`
- [Pair feature extraction](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/features.py): `src/features.py`
- [Pair feature vectors](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/features.py): `src/features.py`

### Decision and outputs

- [Pair classifier](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/model.py): `src/model.py`
- [Threshold tuning](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/model.py): `src/model.py`
- [Macro F0.5 metrics](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/metrics.py): `src/metrics.py`
- [Match predictions](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/model.py): `src/model.py`
- [Candidate TSV](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/pipeline.py): `src/pipeline.py`
- [Matching TSV](https://github.com/rashmigowda1206/matchnexa-ai/blob/main/src/pipeline.py): `src/pipeline.py`

### Other components

- **Operator**
- **Challenge datasets**

## Connections

- Operator → CLI entry: runs (evidence: `src/main.py`)
- CLI entry → Resolution pipeline: starts (evidence: `src/main.py`)
- Resolution pipeline → Challenge datasets: loads (evidence: `README.md`)
- Resolution pipeline → Record normalization: normalizes (evidence: `src/pipeline.py`)
- Resolution pipeline → Multi-pass blocker: generates candidates (evidence: `src/pipeline.py`)
- Multi-pass blocker → Candidate pairs: returns (evidence: `src/blocking.py`)
- Resolution pipeline → Pair feature extraction: extracts features (evidence: `src/pipeline.py`)
- Pair feature extraction → Pair feature vectors: produces (evidence: `src/features.py`)
- Resolution pipeline → Pair classifier: trains (evidence: `src/pipeline.py`)
- Resolution pipeline → Threshold tuning: tunes threshold (evidence: `src/pipeline.py`)
- Threshold tuning → Macro F0.5 metrics: scores (evidence: `src/model.py`)
- Resolution pipeline → Match predictions: requests inference (evidence: `src/pipeline.py`)
- Pair classifier → Match predictions: predicts matches (evidence: `src/model.py`)
- Resolution pipeline → Candidate TSV: writes candidates (evidence: `src/pipeline.py`)
- Resolution pipeline → Matching TSV: writes matches (evidence: `src/pipeline.py`)
