# joelrajjoe/mk-path architecture

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

- Interactive diagram: https://gitdiagram.com/joelrajjoe/mk-path
- Repository: https://github.com/joelrajjoe/mk-path

## Overview

MK-Path is an evidence-gated data transformation platform: users manage projects, upload datasets, build semantic context, analyze and model data, apply healing, and review verification results. The graph combines documented capabilities with relationships visible in the excerpts and SOURCE INDEX; several UI-to-API and unsampled subsystem details are therefore omitted or marked unverified.

Main entry points: [`backend/app/routers/pipeline.py`](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/routers/pipeline.py) (Pipeline routes), [`backend/app/main.py`](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/routers/datasets.py`](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/routers/datasets.py) (Dataset routes), [`backend/app/ingestion/service.py`](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/ingestion/service.py) (Archive ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_webapp["Project workspace"]
  node_analystui["Analysis workspace"]
  node_visualizer["Data visualizer<br/>[DataVisualizer.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API and workflow"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_dataset_routes["Dataset routes<br/>[datasets.py]"]
  node_pipeline_routes["Pipeline routes<br/>[pipeline.py]"]
  node_run_routes["Run routes<br/>[runs.py]"]
end

subgraph group_data["Ingestion and data"]
  node_ingestion["Archive ingestion<br/>[service.py]"]
  node_parsers["Format parsers<br/>[parsers.py]"]
  node_security["Archive security<br/>[security.py]"]
  node_registry[("DuckDB registry<br/>[registry.py]")]
  node_profiler["Data profiler<br/>[profiler.py]"]
end

subgraph group_intelligence["Analysis and knowledge"]
  node_analyst["Goal-driven analysis<br/>[analyst.py]"]
  node_causal["Causal analysis<br/>[causal.py]"]
  node_tournament["Model tournament<br/>[tournament.py]"]
  node_healing["Data healing<br/>[engine.py]"]
  node_semantic["Semantic workflow<br/>[service.py]"]
  node_semantic_builder["Context builder<br/>[builder.py]"]
  node_llm["LLM providers<br/>[llm.py]"]
end

subgraph group_governance["Governance and state"]
  node_verification["Readiness gates<br/>[engine.py]"]
  node_audit["Audit events<br/>[audit.py]"]
  node_metadata[("Metadata repository<br/>[repo.py]")]
  node_database[("MongoDB and local fallback<br/>[database.py]")]
end

node_user(("Platform user"))
node_external_llm(("LLM services"))

node_user -.->|"uses"| node_webapp
node_webapp -.->|"opens"| node_analystui
node_analystui -->|"renders"| node_visualizer
node_webapp -.->|"requests"| node_api_client
node_api_client -.->|"calls API"| node_api_app
node_api_app -->|"mounts"| node_dataset_routes
node_api_app -->|"mounts"| node_pipeline_routes
node_api_app -->|"mounts"| node_run_routes
node_dataset_routes -->|"invokes"| node_ingestion
node_ingestion -->|"validates archives"| node_security
node_ingestion -->|"parses files"| node_parsers
node_ingestion -->|"registers views"| node_registry
node_dataset_routes -->|"profiles data"| node_profiler
node_pipeline_routes -->|"plans analysis"| node_analyst
node_pipeline_routes -->|"loads views"| node_registry
node_pipeline_routes -->|"runs tournament"| node_tournament
node_pipeline_routes -->|"applies healing"| node_healing
node_pipeline_routes -->|"runs gates"| node_verification
node_pipeline_routes -->|"gets context"| node_semantic
node_pipeline_routes -->|"records events"| node_audit
node_semantic -->|"builds context"| node_semantic_builder
node_semantic_builder -->|"requests proposals"| node_llm
node_llm -.->|"calls provider"| node_external_llm
node_analyst -.->|"optional interpretation"| node_external_llm
node_run_routes -->|"loads metadata"| node_metadata
node_dataset_routes -->|"stores metadata"| node_metadata
node_metadata -->|"uses collections"| node_database
node_audit -->|"stores records"| node_database

click node_webapp "https://github.com/joelrajjoe/mk-path/blob/main/frontend/src/pages/projects/ProjectWorkspace.tsx"
click node_analystui "https://github.com/joelrajjoe/mk-path/blob/main/frontend/src/pages/projects/analysis/DataAnalystWorkspace.tsx"
click node_visualizer "https://github.com/joelrajjoe/mk-path/blob/main/frontend/src/components/visualization/DataVisualizer.tsx"
click node_api_client "https://github.com/joelrajjoe/mk-path/blob/main/frontend/src/lib/api.ts"
click node_api_app "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/main.py"
click node_dataset_routes "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/routers/datasets.py"
click node_pipeline_routes "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/routers/pipeline.py"
click node_run_routes "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/routers/runs.py"
click node_ingestion "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/ingestion/service.py"
click node_parsers "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/ingestion/parsers.py"
click node_security "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/ingestion/security.py"
click node_registry "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/ingestion/registry.py"
click node_profiler "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/profiling/profiler.py"
click node_analyst "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/analysis/analyst.py"
click node_causal "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/analysis/causal.py"
click node_tournament "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/modeling/tournament.py"
click node_healing "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/healing/engine.py"
click node_semantic "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/semantic/service.py"
click node_semantic_builder "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/semantic/builder.py"
click node_llm "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/semantic/llm.py"
click node_verification "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/verification/engine.py"
click node_audit "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/audit.py"
click node_metadata "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/repo.py"
click node_database "https://github.com/joelrajjoe/mk-path/blob/main/backend/app/database.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_webapp,node_analystui,node_visualizer,node_api_client,node_user toneBlue
class node_api_app,node_dataset_routes,node_pipeline_routes,node_run_routes toneAmber
class node_ingestion,node_parsers,node_security,node_registry,node_profiler toneMint
class node_analyst,node_causal,node_tournament,node_healing,node_semantic,node_semantic_builder,node_llm toneRose
class node_verification,node_audit,node_metadata,node_database,node_external_llm toneIndigo
```

## Components

### User experience

- [Project workspace](https://github.com/joelrajjoe/mk-path/blob/main/frontend/src/pages/projects/ProjectWorkspace.tsx): `frontend/src/pages/projects/ProjectWorkspace.tsx`
- [Analysis workspace](https://github.com/joelrajjoe/mk-path/blob/main/frontend/src/pages/projects/analysis/DataAnalystWorkspace.tsx): `frontend/src/pages/projects/analysis/DataAnalystWorkspace.tsx`
- [Data visualizer](https://github.com/joelrajjoe/mk-path/blob/main/frontend/src/components/visualization/DataVisualizer.tsx): `frontend/src/components/visualization/DataVisualizer.tsx`
- [API client](https://github.com/joelrajjoe/mk-path/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API and workflow

- [FastAPI application](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/main.py): `backend/app/main.py`
- [Dataset routes](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/routers/datasets.py): `backend/app/routers/datasets.py`
- [Pipeline routes](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/routers/pipeline.py): `backend/app/routers/pipeline.py`
- [Run routes](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/routers/runs.py): `backend/app/routers/runs.py`

### Ingestion and data

- [Archive ingestion](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/ingestion/service.py): `backend/app/ingestion/service.py`
- [Format parsers](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/ingestion/parsers.py): `backend/app/ingestion/parsers.py`
- [Archive security](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/ingestion/security.py): `backend/app/ingestion/security.py`
- [DuckDB registry](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/ingestion/registry.py): `backend/app/ingestion/registry.py`
- [Data profiler](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/profiling/profiler.py): `backend/app/profiling/profiler.py`

### Analysis and knowledge

- [Goal-driven analysis](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/analysis/analyst.py): `backend/app/analysis/analyst.py`
- [Causal analysis](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/analysis/causal.py): `backend/app/analysis/causal.py`
- [Model tournament](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/modeling/tournament.py): `backend/app/modeling/tournament.py`
- [Data healing](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/healing/engine.py): `backend/app/healing/engine.py`
- [Semantic workflow](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/semantic/service.py): `backend/app/semantic/service.py`
- [Context builder](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/semantic/builder.py): `backend/app/semantic/builder.py`
- [LLM providers](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/semantic/llm.py): `backend/app/semantic/llm.py`

### Governance and state

- [Readiness gates](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/verification/engine.py): `backend/app/verification/engine.py`
- [Audit events](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/audit.py): `backend/app/audit.py`
- [Metadata repository](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/repo.py): `backend/app/repo.py`
- [MongoDB and local fallback](https://github.com/joelrajjoe/mk-path/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **Platform user**
- **LLM services**

## Connections

- Platform user → Project workspace: uses
- Project workspace → Analysis workspace: opens
- Analysis workspace → Data visualizer: renders
- Project workspace → API client: requests
- API client → FastAPI application: calls API
- FastAPI application → Dataset routes: mounts (evidence: `backend/app/main.py`)
- FastAPI application → Pipeline routes: mounts (evidence: `backend/app/main.py`)
- FastAPI application → Run routes: mounts (evidence: `backend/app/main.py`)
- Dataset routes → Archive ingestion: invokes (evidence: `backend/app/routers/datasets.py`)
- Archive ingestion → Archive security: validates archives (evidence: `backend/app/ingestion/service.py`)
- Archive ingestion → Format parsers: parses files (evidence: `backend/app/ingestion/service.py`)
- Archive ingestion → DuckDB registry: registers views (evidence: `backend/app/ingestion/service.py`)
- Dataset routes → Data profiler: profiles data (evidence: `backend/app/routers/datasets.py`)
- Pipeline routes → Goal-driven analysis: plans analysis (evidence: `backend/app/routers/pipeline.py`)
- Pipeline routes → DuckDB registry: loads views (evidence: `backend/app/routers/pipeline.py`)
- Pipeline routes → Model tournament: runs tournament (evidence: `backend/app/routers/pipeline.py`)
- Pipeline routes → Data healing: applies healing (evidence: `backend/app/routers/pipeline.py`)
- Pipeline routes → Readiness gates: runs gates (evidence: `backend/app/routers/pipeline.py`)
- Pipeline routes → Semantic workflow: gets context (evidence: `backend/app/routers/pipeline.py`)
- Pipeline routes → Audit events: records events (evidence: `backend/app/routers/pipeline.py`)
- Semantic workflow → Context builder: builds context (evidence: `backend/app/semantic/service.py`)
- Context builder → LLM providers: requests proposals (evidence: `backend/app/semantic/builder.py`)
- LLM providers → LLM services: calls provider
- Goal-driven analysis → LLM services: optional interpretation
- Run routes → Metadata repository: loads metadata (evidence: `backend/app/routers/runs.py`)
- Dataset routes → Metadata repository: stores metadata (evidence: `backend/app/routers/datasets.py`)
- Metadata repository → MongoDB and local fallback: uses collections (evidence: `backend/app/repo.py`)
- Audit events → MongoDB and local fallback: stores records (evidence: `backend/app/audit.py`)
