# pranjasidhwani1/latency_priortized_smartmapper_using_ai architecture

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

- Interactive diagram: https://gitdiagram.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai
- Repository: https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai

## Overview

Smartmapper maps financial-file headers (and, where applicable, categorical values) to standardized fields, using company history, fuzzy matching, optional embeddings, and LLM suggestions. The principal workflow enters through the company-level wrapper, loads a file, delegates mapping to Smartmapper, optionally adds QC derivability results, and returns a response. Separate runtime capabilities include raw-file parsing and feedback-based history updates. Source excerpts show the wrapper and QC calls; some matching internals are documented in the README but not fully sampled.

Main entry points: [`smartmapper.py`](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py) (Smartmapper), [`smartmap_company_level.py`](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmap_company_level.py) (Company mapping), [`get_derivable_unmapped.py`](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/get_derivable_unmapped.py) (QC derivability), [`update_training_data_company_level.py`](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/update_training_data_company_level.py) (Feedback update)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mapping["Mapping workflow"]
  node_company_mapping["Company mapping"]
  node_file_loading["File loading<br/>[smartmapper.py]"]
  node_smartmapper["Smartmapper<br/>[smartmapper.py]"]
  node_mapping_result["Mapping result"]
end

subgraph group_matching["Matching methods"]
  node_history_match["History matching<br/>[smartmapper.py]"]
  node_fuzzy_match["Fuzzy matching<br/>[smartmapper.py]"]
  node_embedding_match["Embedding matching<br/>[bert_model.py]"]
  node_llm_prompt["LLM prompt<br/>[prompt.py]"]
end

subgraph group_support["QC and file parsing"]
  node_qc_derivability["QC derivability"]
  node_config_database[("Central config DB")]
  node_raw_parser["Raw-file parser<br/>[parse_raw_data.py]"]
end

subgraph group_history["Mapping history"]
  node_mapping_history[("Company mapping history<br/>[smartmapper.py]")]
  node_feedback_update["Feedback update"]
end

node_user(("Data user"))
node_bedrock{{"AWS Bedrock"}}

node_user -->|"submits file"| node_company_mapping
node_company_mapping -->|"loads file"| node_file_loading
node_company_mapping -->|"runs mapping"| node_smartmapper
node_smartmapper -->|"checks history"| node_history_match
node_smartmapper -->|"matches terms"| node_fuzzy_match
node_smartmapper -->|"matches semantically"| node_embedding_match
node_smartmapper -->|"builds prompt"| node_llm_prompt
node_smartmapper -->|"requests suggestions"| node_bedrock
node_smartmapper -->|"returns mappings"| node_mapping_result
node_company_mapping -->|"checks unmapped fields"| node_qc_derivability
node_qc_derivability -->|"queries config"| node_config_database
node_qc_derivability -->|"adds QC results"| node_mapping_result
node_user -->|"parses file"| node_raw_parser
node_feedback_update -->|"updates history"| node_smartmapper
node_smartmapper -->|"reads and writes"| node_mapping_history
node_feedback_update -->|"exports updates"| node_mapping_history

click node_company_mapping "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmap_company_level.py"
click node_file_loading "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py"
click node_smartmapper "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py"
click node_history_match "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py"
click node_fuzzy_match "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py"
click node_embedding_match "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/bert_model.py"
click node_llm_prompt "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/prompt.py"
click node_qc_derivability "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/get_derivable_unmapped.py"
click node_raw_parser "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/parse_raw_data.py"
click node_mapping_history "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py"
click node_feedback_update "https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/update_training_data_company_level.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_company_mapping,node_file_loading,node_smartmapper,node_mapping_result,node_user toneBlue
class node_history_match,node_fuzzy_match,node_embedding_match,node_llm_prompt toneAmber
class node_qc_derivability,node_config_database,node_raw_parser toneMint
class node_mapping_history,node_feedback_update toneRose
class node_bedrock toneIndigo
```

## Components

### Mapping workflow

- [Company mapping](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmap_company_level.py): `smartmap_company_level.py`
- [File loading](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py): `smartmapper.py`
- [Smartmapper](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py): `smartmapper.py`
- **Mapping result**

### Matching methods

- [History matching](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py): `smartmapper.py`
- [Fuzzy matching](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py): `smartmapper.py`
- [Embedding matching](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/bert_model.py): `bert_model.py`
- [LLM prompt](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/prompt.py): `prompt.py`

### QC and file parsing

- [QC derivability](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/get_derivable_unmapped.py): `get_derivable_unmapped.py`
- **Central config DB**
- [Raw-file parser](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/parse_raw_data.py): `parse_raw_data.py`

### Mapping history

- [Company mapping history](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/smartmapper.py): `smartmapper.py`
- [Feedback update](https://github.com/pranjasidhwani1/latency_priortized_smartmapper_using_ai/blob/main/update_training_data_company_level.py): `update_training_data_company_level.py`

### Other components

- **Data user**
- **AWS Bedrock**

## Connections

- Data user → Company mapping: submits file (evidence: `README.md`)
- Company mapping → File loading: loads file (evidence: `smartmap_company_level.py`)
- Company mapping → Smartmapper: runs mapping (evidence: `smartmap_company_level.py`)
- Smartmapper → History matching: checks history (evidence: `README.md`)
- Smartmapper → Fuzzy matching: matches terms (evidence: `README.md`)
- Smartmapper → Embedding matching: matches semantically (evidence: `README.md`)
- Smartmapper → LLM prompt: builds prompt (evidence: `smartmapper.py`)
- Smartmapper → AWS Bedrock: requests suggestions (evidence: `README.md`)
- Smartmapper → Mapping result: returns mappings (evidence: `README.md`)
- Company mapping → QC derivability: checks unmapped fields (evidence: `smartmap_company_level.py`)
- QC derivability → Central config DB: queries config (evidence: `get_derivable_unmapped.py`)
- QC derivability → Mapping result: adds QC results
- Data user → Raw-file parser: parses file (evidence: `parse_raw_data.py`)
- Feedback update → Smartmapper: updates history (evidence: `update_training_data_company_level.py`)
- Smartmapper → Company mapping history: reads and writes (evidence: `README.md`)
- Feedback update → Company mapping history: exports updates (evidence: `update_training_data_company_level.py`)
