# farishana/smart-talent-engine architecture

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

- Interactive diagram: https://gitdiagram.com/farishana/smart-talent-engine
- Repository: https://github.com/farishana/smart-talent-engine

## Overview

1. **What this system is**
   - Smart Talent Engine is an AI-assisted resume screening platform that turns uploaded resumes and job descriptions into structured candidate profiles, then ranks candidates with an explainable hybrid pipeline.
   - The main architectural split is **backend AI/decision services** and **frontend review/analysis UI**.

2. **Backend entry point and API boundary**
   - `backend/main.py` is the FastAPI entry point and likely exposes the upload, candidate, ranking, comparison, and explanation endpoints used by the UI.
   - The backend is the orchestration layer: it receives raw documents, invokes extraction and matching services, persists results, and returns scored candidates plus decision traces.

3. **Document intake and parsing**
   - Resume and job-description text flow through `backend/extractor.py`, `backend/llm_extractor.py`, and `backend/jd_parser.py`.
   - The parser/extractor layer is responsible for turning unstructured inputs such as `.docx` resumes into normalized candidate/job data before any ranking occurs.

4. **LLM-assisted extraction with guardrails**
   - `backend/llm_extractor.py` uses Gemini 1.5 Flash, as indicated in the README, to extract verified skills and seniority signals.
   - This is not a free-form generation step; extracted claims are later checked against the deterministic skill knowledge layer so the system can reject hallucinated skills.

5. **Deterministic skill graph as the trust boundary**
   - `backend/skill_graph.json` is the canonical knowledge source for skill relationships.
   - `backend/alias_matcher.py` and related matching logic verify aliases and inferred relationships, so the system can treat “React” as evidence for “JavaScript” or related concepts only when the graph supports it.
   - This graph is the architectural guardrail between probabilistic LLM output and final scoring.

6. **Semantic retrieval layer**
   - `backend/vector_store.py` and `backend/reranker.py` implement the candidate filtering stage using SentenceTransformer embeddings and ChromaDB nearest-neighbor search, as described in the README.
   - This layer narrows the candidate pool based on semantic similarity before deterministic scoring and explanation generation.

7. **Scoring and ranking pipeline**
   - `backend/scorer.py`, `backend/classifier.py`, `backend/matcher.py`, and `backend/trajectory.py` appear to form the core ranking engine.
   - The system likely combines multiple signals: skill match quality, inferred seniority, domain alignment, and career trajectory.
   - `backend/hidden_gem.py` suggests a specific uplift mechanism for non-obvious but promising candidates, which is surfaced in the UI as a “Hidden Gem” concept.

8. **Explainability and decision trace**
   - `backend/explainer.py` is the reporting layer that turns internal scoring steps into human-readable reasoning.
   - The README’s “AI Decision Trace” implies the architecture records why a candidate matched, what evidence was used, and how the score was computed, rather than exposing only a final rank.

9. **Persistence and local state**
   - `backend/database.py` and `backend/models.py` define the structured storage layer, likely backed by the local SQLite database file `backend/smart_talent.db`.
   - This persistence layer stores candidates, extracted entities, rankings, and possibly historical runs so the dashboard can reload previously processed data without re-running the entire AI pipeline.

10. **Backend runtime dependencies**
   - The backend depends on FastAPI for serving, Pydantic-style data modeling, aiosqlite for local storage, ChromaDB for vector retrieval, SentenceTransformers for embeddings, and Gemini via external API key.
   - These technologies shape the architecture: there is a clear split between deterministic local processing and remote LLM enrichment.

11. **Frontend presentation layer**
   - The React/Vite frontend in `frontend/src` is organized around screens such as `Upload`, `Dashboard`, `Ranking`, `Comparison`, and `CandidateDetail`.
   - Components like `RadarChart`, `MatchMap`, `JobCard`, `CandidateRow`, and `HiddenGemBadge` visualize ranking rationale, skill overlap, and candidate quality signals rather than just lists of names.

12. **End-to-end data flow**
   - The primary flow is: upload resume/job description → parse and extract → LLM-assisted skill/seniority extraction → verify against skill graph → embed and retrieve semantically similar candidates → rerank and score → generate explanation/trajectory → persist results → render in the UI.
   - This makes the system a pipeline, not a single model call: each stage adds structure, reduces noise, and increases explainability.

13. **Artifacts and test surface**
   - Test files such as `test_extractor.py`, `test_aliases.py`, and `test_fresher_uplift.py` indicate that extraction correctness, alias/graph resolution, and candidate uplift logic are important behavior boundaries.
   - Supporting files like `create_test_resume.py` and `farisha_resume.docx` suggest the repo includes sample input generation for validating the pipeline.

14. **How to draw the diagram**
   - The main boxes should be: **Frontend UI**, **FastAPI backend orchestrator**, **Extraction/LLM service**, **Skill graph verifier**, **Vector search + reranker**, **Scoring/trajectory/explainer**, and **SQLite persistence**.
   - The only external service that materially affects the architecture is the **Gemini API**; the rest is local processing with a knowledge-graph guardrail and a semantic retrieval stage.

Main entry points: [`frontend/src/api.js`](https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/api.js) (API client), [`frontend/src/App.jsx`](https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/App.jsx) (App shell), [`backend/main.py`](https://github.com/farishana/smart-talent-engine/blob/main/backend/main.py) (API server), [`backend/scorer.py`](https://github.com/farishana/smart-talent-engine/blob/main/backend/scorer.py) (Scoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend UI"]
  node_frontend_app["App shell<br/>react app<br/>[App.jsx]"]
  node_frontend_upload["Upload<br/>screen<br/>[Upload.jsx]"]
  node_frontend_dashboard["Dashboard<br/>screen<br/>[Dashboard.jsx]"]
  node_frontend_ranking["Ranking<br/>screen<br/>[Ranking.jsx]"]
  node_frontend_comparison["Comparison<br/>screen<br/>[Comparison.jsx]"]
  node_frontend_detail["Candidate detail<br/>screen"]
  node_frontend_api["API client<br/>[api.js]"]
end

subgraph group_backend["Backend Engine"]
  node_backend_main["API server<br/>fastapi entry<br/>[main.py]"]
  node_backend_extract["Extraction<br/>parser layer<br/>[extractor.py]"]
  node_backend_llm["LLM extractor<br/>gemini extraction<br/>[llm_extractor.py]"]
  node_backend_jd["JD parser<br/>job parser<br/>[jd_parser.py]"]
  node_backend_alias["Alias matcher<br/>verification<br/>[alias_matcher.py]"]
  node_backend_vector[("Vector search<br/>semantic retrieval<br/>[vector_store.py]")]
  node_backend_rerank["Reranker<br/>nearest-neighbor rerank<br/>[reranker.py]"]
  node_backend_score["Scoring<br/>rank engine<br/>[scorer.py]"]
  node_backend_hidden["Hidden gem<br/>uplift<br/>[hidden_gem.py]"]
  node_backend_traj["Trajectory<br/>career signal<br/>[trajectory.py]"]
  node_backend_explain["Explainer<br/>decision trace<br/>[explainer.py]"]
  node_backend_models["Models<br/>schema<br/>[models.py]"]
end

subgraph group_data["Data Store"]
  node_backend_skill{{"Skill graph<br/>knowledge graph<br/>[skill_graph.json]"}}
  node_backend_db[("Database<br/>sqlite persistence<br/>[database.py]")]
end

subgraph group_external["External Services"]
  node_gemini_api(("Gemini API<br/>external llm"))
end

node_frontend_app -->|"routes"| node_frontend_upload
node_frontend_app -->|"routes"| node_frontend_dashboard
node_frontend_app -->|"routes"| node_frontend_ranking
node_frontend_app -->|"routes"| node_frontend_comparison
node_frontend_app -->|"routes"| node_frontend_detail
node_frontend_upload -->|"calls"| node_frontend_api
node_frontend_dashboard -->|"calls"| node_frontend_api
node_frontend_ranking -->|"calls"| node_frontend_api
node_frontend_comparison -->|"calls"| node_frontend_api
node_frontend_detail -->|"calls"| node_frontend_api
node_frontend_api -->|"HTTP"| node_backend_main
node_backend_main -->|"orchestrates"| node_backend_extract
node_backend_main -->|"orchestrates"| node_backend_jd
node_backend_extract -->|"enriches"| node_backend_llm
node_backend_llm -->|"remote call"| node_gemini_api
node_backend_llm -->|"verifies"| node_backend_skill
node_backend_jd -->|"normalizes"| node_backend_skill
node_backend_skill -->|"supports"| node_backend_alias
node_backend_main -->|"retrieves"| node_backend_vector
node_backend_vector -->|"feeds"| node_backend_rerank
node_backend_rerank -->|"feeds"| node_backend_score
node_backend_score -->|"uplift"| node_backend_hidden
node_backend_score -->|"uses"| node_backend_traj
node_backend_score -->|"explains"| node_backend_explain
node_backend_main -->|"persists"| node_backend_db
node_backend_db -->|"uses"| node_backend_models

click node_frontend_app "https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/App.jsx"
click node_frontend_upload "https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/Upload.jsx"
click node_frontend_dashboard "https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/Dashboard.jsx"
click node_frontend_ranking "https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/Ranking.jsx"
click node_frontend_comparison "https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/Comparison.jsx"
click node_frontend_detail "https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/CandidateDetail.jsx"
click node_frontend_api "https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/api.js"
click node_backend_main "https://github.com/farishana/smart-talent-engine/blob/main/backend/main.py"
click node_backend_extract "https://github.com/farishana/smart-talent-engine/blob/main/backend/extractor.py"
click node_backend_llm "https://github.com/farishana/smart-talent-engine/blob/main/backend/llm_extractor.py"
click node_backend_jd "https://github.com/farishana/smart-talent-engine/blob/main/backend/jd_parser.py"
click node_backend_skill "https://github.com/farishana/smart-talent-engine/blob/main/backend/skill_graph.json"
click node_backend_alias "https://github.com/farishana/smart-talent-engine/blob/main/backend/alias_matcher.py"
click node_backend_vector "https://github.com/farishana/smart-talent-engine/blob/main/backend/vector_store.py"
click node_backend_rerank "https://github.com/farishana/smart-talent-engine/blob/main/backend/reranker.py"
click node_backend_score "https://github.com/farishana/smart-talent-engine/blob/main/backend/scorer.py"
click node_backend_hidden "https://github.com/farishana/smart-talent-engine/blob/main/backend/hidden_gem.py"
click node_backend_traj "https://github.com/farishana/smart-talent-engine/blob/main/backend/trajectory.py"
click node_backend_explain "https://github.com/farishana/smart-talent-engine/blob/main/backend/explainer.py"
click node_backend_db "https://github.com/farishana/smart-talent-engine/blob/main/backend/database.py"
click node_backend_models "https://github.com/farishana/smart-talent-engine/blob/main/backend/models.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_frontend_app,node_frontend_upload,node_frontend_dashboard,node_frontend_ranking,node_frontend_comparison,node_frontend_detail,node_frontend_api toneBlue
class node_backend_main,node_backend_extract,node_backend_llm,node_backend_jd,node_backend_alias,node_backend_vector,node_backend_rerank,node_backend_score,node_backend_hidden,node_backend_traj,node_backend_explain,node_backend_models toneAmber
class node_backend_skill,node_backend_db toneMint
class node_gemini_api toneRose
```

## Components

### Frontend UI

React/Vite review and comparison interface

- [App shell](https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/App.jsx): react app · Top-level UI composition and route wiring · `frontend/src/App.jsx`
- [Upload](https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/Upload.jsx): screen · Entry screen for resumes and job descriptions · `frontend/src/pages/Upload.jsx`
- [Dashboard](https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/Dashboard.jsx): screen · Overview of processed candidates and results · `frontend/src/pages/Dashboard.jsx`
- [Ranking](https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/Ranking.jsx): screen · Ranked candidate list and scoring views · `frontend/src/pages/Ranking.jsx`
- [Comparison](https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/Comparison.jsx): screen · Side-by-side candidate comparison view · `frontend/src/pages/Comparison.jsx`
- [Candidate detail](https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/pages/CandidateDetail.jsx): screen · Single candidate drill-down and explanation view · `frontend/src/pages/CandidateDetail.jsx`
- [API client](https://github.com/farishana/smart-talent-engine/blob/main/frontend/src/api.js): client · Frontend-to-backend request layer · `frontend/src/api.js`

### Backend Engine

FastAPI orchestration, extraction, ranking, and persistence

- [API server](https://github.com/farishana/smart-talent-engine/blob/main/backend/main.py): fastapi entry · HTTP boundary for uploads, ranking, comparison, and explanation · `backend/main.py`
- [Extraction](https://github.com/farishana/smart-talent-engine/blob/main/backend/extractor.py): parser layer · Document and job-description normalization · `backend/extractor.py`
- [LLM extractor](https://github.com/farishana/smart-talent-engine/blob/main/backend/llm_extractor.py): gemini extraction · LLM-assisted skill and seniority extraction with guardrails · `backend/llm_extractor.py`
- [JD parser](https://github.com/farishana/smart-talent-engine/blob/main/backend/jd_parser.py): job parser · Normalizes job descriptions into structured requirements · `backend/jd_parser.py`
- [Alias matcher](https://github.com/farishana/smart-talent-engine/blob/main/backend/alias_matcher.py): verification · Resolves aliases and validates inferred skill relationships · `backend/alias_matcher.py`
- [Vector search](https://github.com/farishana/smart-talent-engine/blob/main/backend/vector_store.py): semantic retrieval · Embedding-based candidate retrieval over the local index · `backend/vector_store.py`
- [Reranker](https://github.com/farishana/smart-talent-engine/blob/main/backend/reranker.py): nearest-neighbor rerank · Refines retrieval results before scoring · `backend/reranker.py`
- [Scoring](https://github.com/farishana/smart-talent-engine/blob/main/backend/scorer.py): rank engine · Combines match quality, seniority, trajectory, and uplift signals · `backend/scorer.py`
- [Hidden gem](https://github.com/farishana/smart-talent-engine/blob/main/backend/hidden_gem.py): uplift · Boosts promising non-obvious candidates · `backend/hidden_gem.py`
- [Trajectory](https://github.com/farishana/smart-talent-engine/blob/main/backend/trajectory.py): career signal · Analyzes career progression and growth patterns · `backend/trajectory.py`
- [Explainer](https://github.com/farishana/smart-talent-engine/blob/main/backend/explainer.py): decision trace · Produces human-readable reasoning and evidence summaries · `backend/explainer.py`
- [Models](https://github.com/farishana/smart-talent-engine/blob/main/backend/models.py): schema · Structured data models for persisted and exchanged entities · `backend/models.py`

### Data Store

Local knowledge and persistence assets

- [Skill graph](https://github.com/farishana/smart-talent-engine/blob/main/backend/skill_graph.json): knowledge graph · Canonical skill and alias relationships used for verification · `backend/skill_graph.json`
- [Database](https://github.com/farishana/smart-talent-engine/blob/main/backend/database.py): sqlite persistence · Local storage for candidates, runs, and results · `backend/database.py`

### External Services

Remote AI services used by the backend

- **Gemini API**: external llm · Remote LLM service used for extraction enrichment

## Connections

- App shell → Upload: routes · App shell exposes the upload flow
- App shell → Dashboard: routes · App shell exposes the results dashboard
- App shell → Ranking: routes · App shell exposes ranking views
- App shell → Comparison: routes · App shell exposes comparison views
- App shell → Candidate detail: routes · App shell exposes candidate detail views
- Upload → API client: calls · Upload screen submits documents and job data
- Dashboard → API client: calls · Dashboard fetches processed run data
- Ranking → API client: calls · Ranking screen requests scored candidates
- Comparison → API client: calls · Comparison screen requests candidate pairs
- Candidate detail → API client: calls · Detail screen requests candidate explanations
- API client → API server: HTTP · Frontend talks to the FastAPI backend
- API server → Extraction: orchestrates · API server triggers document parsing
- API server → JD parser: orchestrates · API server triggers job-description parsing
- Extraction → LLM extractor: enriches · Extraction layer uses LLM-assisted enrichment
- LLM extractor → Gemini API: remote call · LLM extraction relies on Gemini
- LLM extractor → Skill graph: verifies · Extracted claims are checked against the skill graph
- JD parser → Skill graph: normalizes · Job requirements are mapped through canonical skills
- Skill graph → Alias matcher: supports · Knowledge graph enables alias and relation checks
- API server → Vector search: retrieves · Backend initiates semantic candidate search
- Vector search → Reranker: feeds · Nearest-neighbor results are refined
- Reranker → Scoring: feeds · Reranked candidates enter scoring
- Scoring → Hidden gem: uplift · Hidden-gem logic adjusts promising candidates
- Scoring → Trajectory: uses · Trajectory signals contribute to ranking
- Scoring → Explainer: explains · Scoring outputs are turned into decision traces
- API server → Database: persists · API layer stores runs and outcomes
- Database → Models: uses · Persistence relies on shared data models
