# orange-opensource/tripleflow architecture

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

- Interactive diagram: https://gitdiagram.com/orange-opensource/tripleflow
- Repository: https://github.com/orange-opensource/tripleflow
- Video tour (about a minute): https://gitdiagram.com/orange-opensource/tripleflow/video

## Overview

Tripleflow is a web application for semi-supervised knowledge-graph population from unstructured documents. Users submit text or files to configured extractors, then review and validate extracted triples, inspect graph data, and publish approved triples to configured targets. The API also manages extractor and target configurations, file provenance, and audit history. The frontend and API source indexes support the main routing and service boundaries; some API-to-frontend and external-service links are shown as unverified because their runtime wiring was not excerpted.

Main entry points: [`tripleflow-api/app/main.py`](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/main.py) (FastAPI application), [`tripleflow-front/src/App.vue`](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/App.vue) (Vue application), [`tripleflow-api/app/routes/extraction.py`](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/extraction.py) (Extraction routes), [`tripleflow-api/app/services/sinks_service.py`](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/sinks_service.py) (Target configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_webapp["Vue application<br/>[App.vue]"]
  node_home["Extraction workspace<br/>[HomePage.vue]"]
  node_workflow["Workflow view<br/>[Workflow.vue]"]
  node_extract_state["Extraction state"]
  node_extract_api["Extraction API client<br/>[api.js]"]
  node_validation_ui["Validation workspace<br/>[ValidationPage.vue]"]
  node_graph_ui["Graph browser<br/>[GraphPage.vue]"]
  node_extractor_ui["Extractor management<br/>[ExtractorsPage.vue]"]
  node_target_ui["Target management<br/>[TargetsPage.vue]"]
end

subgraph group_extraction["Extraction"]
  node_extract_route["Extraction routes<br/>[extraction.py]"]
  node_docling["Document parsing<br/>[docling_service.py]"]
  node_chunking["Text chunking"]
  node_extract_service["Extractor execution"]
end

subgraph group_configuration["Configuration"]
  node_extractor_service["Extractor configuration"]
  node_extractor_schema["Extractor schemas<br/>[extractors.py]"]
  node_sink_service["Target configuration<br/>[sinks_service.py]"]
  node_sink_schema["Target schemas<br/>[sinks.py]"]
end

subgraph group_review["Review and publishing"]
  node_review_route["Triple and file routes<br/>[triples.py]"]
  node_file_route["File routes<br/>[files.py]"]
  node_search_route["Entity search<br/>[search.py]"]
  node_sink_route["Publication routes<br/>[sinks.py]"]
  node_triple_service["Triple and file data"]
end

subgraph group_storage["Persistence"]
  node_db[("MongoDB collections<br/>[db.py]")]
  node_api["FastAPI application<br/>[main.py]"]
end

node_user(("Reviewer"))
node_extractor_external{{"Extractor endpoint"}}
node_target_external{{"Knowledge graph target"}}

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_home
node_webapp -->|"routes to"| node_validation_ui
node_webapp -->|"routes to"| node_graph_ui
node_webapp -->|"routes to"| node_extractor_ui
node_webapp -->|"routes to"| node_target_ui
node_home -->|"renders"| node_workflow
node_home -->|"uses"| node_extract_state
node_workflow -->|"uses"| node_extract_state
node_extract_state -->|"requests extraction"| node_extract_api
node_extract_api -.->|"calls API"| node_extract_route
node_api -->|"registers route"| node_extract_route
node_api -->|"registers route"| node_review_route
node_api -->|"registers route"| node_file_route
node_api -->|"registers route"| node_search_route
node_api -->|"registers route"| node_sink_route
node_api -->|"ensures indexes"| node_db
node_extract_route -->|"uses parser"| node_docling
node_extract_route -->|"uses chunking"| node_chunking
node_extract_route -->|"runs extraction"| node_extract_service
node_extract_route -->|"stores results"| node_triple_service
node_extract_service -->|"resolves extractor"| node_extractor_service
node_extract_service -.->|"sends text"| node_extractor_external
node_extractor_service -->|"validates config"| node_extractor_schema
node_extractor_service -->|"reads and writes"| node_db
node_extractor_ui -.->|"manages via API"| node_extractor_service
node_sink_service -->|"validates config"| node_sink_schema
node_sink_service -->|"reads and writes"| node_db
node_sink_service -.->|"publishes triples"| node_target_external
node_target_ui -.->|"manages via API"| node_sink_service
node_validation_ui -.->|"publishes via API"| node_sink_route
node_validation_ui -.->|"submits review"| node_review_route
node_validation_ui -.->|"searches entities"| node_search_route
node_graph_ui -.->|"loads graph data"| node_review_route
node_review_route -->|"reads and updates"| node_triple_service
node_file_route -->|"manages files"| node_triple_service
node_search_route -->|"uses extractor config"| node_extractor_service
node_sink_route -->|"publishes and manages"| node_sink_service
node_sink_route -->|"loads triples"| node_triple_service
node_triple_service -->|"reads and writes"| node_db

click node_webapp "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/App.vue"
click node_home "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/HomePage.vue"
click node_workflow "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/components/organisms/Workflow.vue"
click node_extract_state "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/composables/UseExtractionState.js"
click node_extract_api "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/composables/extraction/api.js"
click node_validation_ui "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/ValidationPage.vue"
click node_graph_ui "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/GraphPage.vue"
click node_extractor_ui "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/ExtractorsPage.vue"
click node_target_ui "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/TargetsPage.vue"
click node_extract_route "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/extraction.py"
click node_docling "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/docling_service.py"
click node_chunking "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/chunking_service.py"
click node_extract_service "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/extraction_service.py"
click node_extractor_service "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/extractors_service.py"
click node_extractor_schema "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/schemas/extractors.py"
click node_sink_service "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/sinks_service.py"
click node_sink_schema "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/schemas/sinks.py"
click node_review_route "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/triples.py"
click node_file_route "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/files.py"
click node_search_route "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/search.py"
click node_sink_route "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/sinks.py"
click node_triple_service "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/triple_db_service.py"
click node_db "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/db.py"
click node_api "https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/main.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_home,node_workflow,node_extract_state,node_extract_api,node_validation_ui,node_graph_ui,node_extractor_ui,node_target_ui,node_user toneBlue
class node_extract_route,node_docling,node_chunking,node_extract_service toneAmber
class node_extractor_service,node_extractor_schema,node_sink_service,node_sink_schema toneMint
class node_review_route,node_file_route,node_search_route,node_sink_route,node_triple_service toneRose
class node_db,node_api,node_extractor_external,node_target_external toneIndigo
```

## Components

### Frontend

- [Vue application](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/App.vue): `tripleflow-front/src/App.vue`
- [Extraction workspace](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/HomePage.vue): `tripleflow-front/src/pages/HomePage.vue`
- [Workflow view](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/components/organisms/Workflow.vue): `tripleflow-front/src/components/organisms/Workflow.vue`
- [Extraction state](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/composables/UseExtractionState.js): `tripleflow-front/src/composables/UseExtractionState.js`
- [Extraction API client](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/composables/extraction/api.js): `tripleflow-front/src/composables/extraction/api.js`
- [Validation workspace](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/ValidationPage.vue): `tripleflow-front/src/pages/ValidationPage.vue`
- [Graph browser](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/GraphPage.vue): `tripleflow-front/src/pages/GraphPage.vue`
- [Extractor management](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/ExtractorsPage.vue): `tripleflow-front/src/pages/ExtractorsPage.vue`
- [Target management](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-front/src/pages/TargetsPage.vue): `tripleflow-front/src/pages/TargetsPage.vue`

### Extraction

- [Extraction routes](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/extraction.py): `tripleflow-api/app/routes/extraction.py`
- [Document parsing](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/docling_service.py): `tripleflow-api/app/services/docling_service.py`
- [Text chunking](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/chunking_service.py): `tripleflow-api/app/services/chunking_service.py`
- [Extractor execution](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/extraction_service.py): `tripleflow-api/app/services/extraction_service.py`

### Configuration

- [Extractor configuration](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/extractors_service.py): `tripleflow-api/app/services/extractors_service.py`
- [Extractor schemas](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/schemas/extractors.py): `tripleflow-api/app/schemas/extractors.py`
- [Target configuration](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/sinks_service.py): `tripleflow-api/app/services/sinks_service.py`
- [Target schemas](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/schemas/sinks.py): `tripleflow-api/app/schemas/sinks.py`

### Review and publishing

- [Triple and file routes](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/triples.py): `tripleflow-api/app/routes/triples.py`
- [File routes](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/files.py): `tripleflow-api/app/routes/files.py`
- [Entity search](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/search.py): `tripleflow-api/app/routes/search.py`
- [Publication routes](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/routes/sinks.py): `tripleflow-api/app/routes/sinks.py`
- [Triple and file data](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/services/triple_db_service.py): `tripleflow-api/app/services/triple_db_service.py`

### Persistence

- [MongoDB collections](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/db.py): `tripleflow-api/app/db.py`
- [FastAPI application](https://github.com/orange-opensource/tripleflow/blob/main/tripleflow-api/app/main.py): `tripleflow-api/app/main.py`

### Other components

- **Reviewer**
- **Extractor endpoint**
- **Knowledge graph target**

## Connections

- Reviewer → Vue application: uses (evidence: `tripleflow-front/src/App.vue`)
- Vue application → Extraction workspace: routes to (evidence: `tripleflow-front/src/App.vue`)
- Vue application → Validation workspace: routes to (evidence: `tripleflow-front/src/App.vue`)
- Vue application → Graph browser: routes to (evidence: `tripleflow-front/src/App.vue`)
- Vue application → Extractor management: routes to (evidence: `tripleflow-front/src/App.vue`)
- Vue application → Target management: routes to (evidence: `tripleflow-front/src/App.vue`)
- Extraction workspace → Workflow view: renders (evidence: `tripleflow-front/src/pages/HomePage.vue`)
- Extraction workspace → Extraction state: uses (evidence: `tripleflow-front/src/pages/HomePage.vue`)
- Workflow view → Extraction state: uses (evidence: `tripleflow-front/src/components/organisms/Workflow.vue`)
- Extraction state → Extraction API client: requests extraction (evidence: `tripleflow-front/src/composables/UseExtractionState.js`)
- Extraction API client → Extraction routes: calls API
- FastAPI application → Extraction routes: registers route (evidence: `tripleflow-api/app/main.py`)
- FastAPI application → Triple and file routes: registers route (evidence: `tripleflow-api/app/main.py`)
- FastAPI application → File routes: registers route (evidence: `tripleflow-api/app/main.py`)
- FastAPI application → Entity search: registers route (evidence: `tripleflow-api/app/main.py`)
- FastAPI application → Publication routes: registers route (evidence: `tripleflow-api/app/main.py`)
- FastAPI application → MongoDB collections: ensures indexes (evidence: `tripleflow-api/app/main.py`)
- Extraction routes → Document parsing: uses parser (evidence: `tripleflow-api/app/routes/extraction.py`)
- Extraction routes → Text chunking: uses chunking (evidence: `tripleflow-api/app/routes/extraction.py`)
- Extraction routes → Extractor execution: runs extraction (evidence: `tripleflow-api/app/routes/extraction.py`)
- Extraction routes → Triple and file data: stores results (evidence: `tripleflow-api/app/routes/extraction.py`)
- Extractor execution → Extractor configuration: resolves extractor (evidence: `tripleflow-api/app/services/extraction_service.py`)
- Extractor execution → Extractor endpoint: sends text
- Extractor configuration → Extractor schemas: validates config (evidence: `tripleflow-api/app/services/extractors_service.py`)
- Extractor configuration → MongoDB collections: reads and writes (evidence: `tripleflow-api/app/services/extractors_service.py`)
- Extractor management → Extractor configuration: manages via API
- Target configuration → Target schemas: validates config (evidence: `tripleflow-api/app/services/sinks_service.py`)
- Target configuration → MongoDB collections: reads and writes (evidence: `tripleflow-api/app/services/sinks_service.py`)
- Target configuration → Knowledge graph target: publishes triples
- Target management → Target configuration: manages via API
- Validation workspace → Publication routes: publishes via API
- Validation workspace → Triple and file routes: submits review
- Validation workspace → Entity search: searches entities
- Graph browser → Triple and file routes: loads graph data
- Triple and file routes → Triple and file data: reads and updates (evidence: `tripleflow-api/app/routes/triples.py`)
- File routes → Triple and file data: manages files (evidence: `tripleflow-api/app/routes/files.py`)
- Entity search → Extractor configuration: uses extractor config (evidence: `tripleflow-api/app/routes/search.py`)
- Publication routes → Target configuration: publishes and manages (evidence: `tripleflow-api/app/routes/sinks.py`)
- Publication routes → Triple and file data: loads triples (evidence: `tripleflow-api/app/routes/sinks.py`)
- Triple and file data → MongoDB collections: reads and writes (evidence: `tripleflow-api/app/services/triple_db_service.py`)
