# subhrajit36/synapse architecture

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

- Interactive diagram: https://gitdiagram.com/subhrajit36/synapse
- Repository: https://github.com/subhrajit36/synapse

## Overview

Synapse turns resumes and job requirements into explainable candidate rankings based on skill-graph distance, not keyword overlap. The user workflow is document ingestion and skill extraction, canonical skill linking, candidate-profile storage, then job-skill matching and ranking with direct matches, bridgeable gaps, and true gaps. The graph is built offline and served from Neo4j/NetworkX-backed resources. The README documents the intended architecture; sampled source excerpts and the SOURCE INDEX support only some implementation links, so undocumented connections are omitted.

Main entry points: [`src/synapse/mcp/engine.py`](https://github.com/subhrajit36/synapse/blob/main/src/synapse/mcp/engine.py) (Scoring Engine), [`src/synapse/eval/run_eval_arms.py`](https://github.com/subhrajit36/synapse/blob/main/src/synapse/eval/run_eval_arms.py) (Evaluation Runner), [`src/synapse/ingest/pipeline.py`](https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/pipeline.py) (Ingestion Pipeline), [`src/synapse/ingest/extractor.py`](https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/extractor.py) (Skill Extractor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Document Ingestion"]
  node_reader["Document Reader<br/>[reader.py]"]
  node_extractor["Skill Extractor<br/>[extractor.py]"]
  node_schemas["Extraction Contracts<br/>[schemas.py]"]
  node_pipeline["Ingestion Pipeline<br/>[pipeline.py]"]
end

subgraph group_knowledge["Skill Knowledge Graph"]
  node_builder["Graph Builder<br/>[build_graph.py]"]
  node_migrator["Graph Migration"]
  node_typed["Typed Edge Research<br/>[typed_edges.py]"]
  node_graphstore[("Skill Graph Store<br/>[neo4j_client.py]")]
  node_loader["Graph Loader<br/>[neo4j_loader.py]"]
end

subgraph group_serving["Matching And Serving"]
  node_linker["Entity Linker<br/>[entity_linker.py]"]
  node_aliases["Skill Aliases<br/>[aliases.py]"]
  node_persist[("Candidate Profiles<br/>[neo4j_client.py]")]
  node_engine["Scoring Engine<br/>[engine.py]"]
  node_server["MCP Server<br/>[server.py]"]
  node_chat["Chat Interface<br/>[chat.py]"]
  node_matcher["Graph Matcher<br/>[matcher.py]"]
  node_webapp["Streamlit App<br/>[app.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_evaldata["Evaluation Dataset<br/>[dataset.py]"]
  node_baselines["Ranking Baselines<br/>[baselines.py]"]
  node_metrics["Evaluation Metrics<br/>[metrics.py]"]
  node_evalrun["Evaluation Runner<br/>[run_eval_arms.py]"]
end

node_user(("Browser / Client"))
node_gemini{{"Gemini API"}}
node_auradb[("Neo4j AuraDB")]

node_user -->|"uploads documents"| node_reader
node_reader -->|"provides documents"| node_pipeline
node_pipeline -->|"extracts skills"| node_extractor
node_extractor -->|"requests extraction"| node_gemini
node_extractor -->|"validates output"| node_schemas
node_pipeline -->|"links skills"| node_linker
node_linker -->|"checks aliases"| node_aliases
node_pipeline -->|"persists profiles"| node_persist
node_builder -->|"builds graph for"| node_migrator
node_migrator -->|"migrates graph"| node_graphstore
node_builder -.->|"supports edge research"| node_typed
node_graphstore -->|"loads skill graph"| node_loader
node_loader -->|"materializes graph"| node_engine
node_persist -->|"supplies candidate pool"| node_engine
node_user -->|"requests rankings"| node_server
node_server -->|"delegates tools"| node_engine
node_server -->|"serves chat"| node_chat
node_engine -->|"scores candidates"| node_matcher
node_engine -->|"links job skills"| node_linker
node_user -->|"uses matching page"| node_webapp
node_webapp -->|"scores resumes"| node_matcher
node_evalrun -->|"uses dataset"| node_evaldata
node_evalrun -->|"compares rankers"| node_baselines
node_evalrun -->|"computes metrics"| node_metrics
node_evalrun -->|"evaluates matching"| node_matcher

click node_reader "https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/reader.py"
click node_extractor "https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/extractor.py"
click node_schemas "https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/schemas.py"
click node_pipeline "https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/pipeline.py"
click node_linker "https://github.com/subhrajit36/synapse/blob/main/src/synapse/matching/entity_linker.py"
click node_aliases "https://github.com/subhrajit36/synapse/blob/main/src/synapse/matching/aliases.py"
click node_persist "https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/neo4j_client.py"
click node_builder "https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/build_graph.py"
click node_migrator "https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/migrate_to_neo4j.py"
click node_typed "https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/typed_edges.py"
click node_graphstore "https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/neo4j_client.py"
click node_loader "https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/neo4j_loader.py"
click node_engine "https://github.com/subhrajit36/synapse/blob/main/src/synapse/mcp/engine.py"
click node_server "https://github.com/subhrajit36/synapse/blob/main/src/synapse/mcp/server.py"
click node_chat "https://github.com/subhrajit36/synapse/blob/main/src/synapse/mcp/chat.py"
click node_matcher "https://github.com/subhrajit36/synapse/blob/main/src/synapse/matching/matcher.py"
click node_webapp "https://github.com/subhrajit36/synapse/blob/main/app.py"
click node_evaldata "https://github.com/subhrajit36/synapse/blob/main/src/synapse/eval/dataset.py"
click node_baselines "https://github.com/subhrajit36/synapse/blob/main/src/synapse/eval/baselines.py"
click node_metrics "https://github.com/subhrajit36/synapse/blob/main/src/synapse/eval/metrics.py"
click node_evalrun "https://github.com/subhrajit36/synapse/blob/main/src/synapse/eval/run_eval_arms.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_reader,node_extractor,node_schemas,node_pipeline,node_user toneBlue
class node_builder,node_migrator,node_typed,node_graphstore,node_loader,node_auradb toneAmber
class node_linker,node_aliases,node_persist,node_engine,node_server,node_chat,node_matcher,node_webapp,node_gemini toneMint
class node_evaldata,node_baselines,node_metrics,node_evalrun toneRose
```

## Components

### Document Ingestion

- [Document Reader](https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/reader.py): `src/synapse/ingest/reader.py`
- [Skill Extractor](https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/extractor.py): `src/synapse/ingest/extractor.py`
- [Extraction Contracts](https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/schemas.py): `src/synapse/ingest/schemas.py`
- [Ingestion Pipeline](https://github.com/subhrajit36/synapse/blob/main/src/synapse/ingest/pipeline.py): `src/synapse/ingest/pipeline.py`

### Skill Knowledge Graph

- [Graph Builder](https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/build_graph.py): `src/synapse/graph/build_graph.py`
- [Graph Migration](https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/migrate_to_neo4j.py): `src/synapse/graph/migrate_to_neo4j.py`
- [Typed Edge Research](https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/typed_edges.py): `src/synapse/graph/typed_edges.py`
- [Skill Graph Store](https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/neo4j_client.py): `src/synapse/graph/neo4j_client.py`
- [Graph Loader](https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/neo4j_loader.py): `src/synapse/graph/neo4j_loader.py`

### Matching And Serving

- [Entity Linker](https://github.com/subhrajit36/synapse/blob/main/src/synapse/matching/entity_linker.py): `src/synapse/matching/entity_linker.py`
- [Skill Aliases](https://github.com/subhrajit36/synapse/blob/main/src/synapse/matching/aliases.py): `src/synapse/matching/aliases.py`
- [Candidate Profiles](https://github.com/subhrajit36/synapse/blob/main/src/synapse/graph/neo4j_client.py): `src/synapse/graph/neo4j_client.py`
- [Scoring Engine](https://github.com/subhrajit36/synapse/blob/main/src/synapse/mcp/engine.py): `src/synapse/mcp/engine.py`
- [MCP Server](https://github.com/subhrajit36/synapse/blob/main/src/synapse/mcp/server.py): `src/synapse/mcp/server.py`
- [Chat Interface](https://github.com/subhrajit36/synapse/blob/main/src/synapse/mcp/chat.py): `src/synapse/mcp/chat.py`
- [Graph Matcher](https://github.com/subhrajit36/synapse/blob/main/src/synapse/matching/matcher.py): `src/synapse/matching/matcher.py`
- [Streamlit App](https://github.com/subhrajit36/synapse/blob/main/app.py): `app.py`

### Evaluation

- [Evaluation Dataset](https://github.com/subhrajit36/synapse/blob/main/src/synapse/eval/dataset.py): `src/synapse/eval/dataset.py`
- [Ranking Baselines](https://github.com/subhrajit36/synapse/blob/main/src/synapse/eval/baselines.py): `src/synapse/eval/baselines.py`
- [Evaluation Metrics](https://github.com/subhrajit36/synapse/blob/main/src/synapse/eval/metrics.py): `src/synapse/eval/metrics.py`
- [Evaluation Runner](https://github.com/subhrajit36/synapse/blob/main/src/synapse/eval/run_eval_arms.py): `src/synapse/eval/run_eval_arms.py`

### Other components

- **Browser / Client**
- **Gemini API**
- **Neo4j AuraDB**

## Connections

- Browser / Client → Document Reader: uploads documents (evidence: `README.md`)
- Document Reader → Ingestion Pipeline: provides documents (evidence: `README.md`)
- Ingestion Pipeline → Skill Extractor: extracts skills (evidence: `src/synapse/ingest/pipeline.py`)
- Skill Extractor → Gemini API: requests extraction (evidence: `README.md`)
- Skill Extractor → Extraction Contracts: validates output (evidence: `src/synapse/ingest/extractor.py`)
- Ingestion Pipeline → Entity Linker: links skills (evidence: `README.md`)
- Entity Linker → Skill Aliases: checks aliases (evidence: `src/synapse/matching/entity_linker.py`)
- Ingestion Pipeline → Candidate Profiles: persists profiles (evidence: `README.md`)
- Graph Builder → Graph Migration: builds graph for (evidence: `README.md`)
- Graph Migration → Skill Graph Store: migrates graph (evidence: `README.md`)
- Graph Builder → Typed Edge Research: supports edge research (evidence: `src/synapse/graph/typed_edges.py`)
- Skill Graph Store → Graph Loader: loads skill graph (evidence: `README.md`)
- Graph Loader → Scoring Engine: materializes graph (evidence: `README.md`)
- Candidate Profiles → Scoring Engine: supplies candidate pool (evidence: `README.md`)
- Browser / Client → MCP Server: requests rankings (evidence: `README.md`)
- MCP Server → Scoring Engine: delegates tools (evidence: `src/synapse/mcp/server.py`)
- MCP Server → Chat Interface: serves chat (evidence: `src/synapse/mcp/server.py`)
- Scoring Engine → Graph Matcher: scores candidates (evidence: `src/synapse/mcp/engine.py`)
- Scoring Engine → Entity Linker: links job skills (evidence: `src/synapse/mcp/engine.py`)
- Browser / Client → Streamlit App: uses matching page (evidence: `README.md`)
- Streamlit App → Graph Matcher: scores resumes (evidence: `app.py`)
- Evaluation Runner → Evaluation Dataset: uses dataset (evidence: `src/synapse/eval/run_eval_arms.py`)
- Evaluation Runner → Ranking Baselines: compares rankers (evidence: `src/synapse/eval/run_eval_arms.py`)
- Evaluation Runner → Evaluation Metrics: computes metrics (evidence: `src/synapse/eval/run_eval_arms.py`)
- Evaluation Runner → Graph Matcher: evaluates matching (evidence: `src/synapse/eval/run_eval_arms.py`)
