# satishk01/open-ontology architecture

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

- Interactive diagram: https://gitdiagram.com/satishk01/open-ontology
- Repository: https://github.com/satishk01/open-ontology

## Overview

Helix Foundry is a local-first data workspace: users connect company data, review a suggested cross-source ontology, then explore metrics or ask questions answered with executed SQL and snapshot citations. Its main flow spans browser areas, API routes and domain services, versioned dataset storage, and isolated DuckDB execution; ontology changes and pipeline definitions can also be reviewed before use. The README documents these capabilities, while sampled code confirms selected API, storage, and executor links. Several feature modules were not sampled, so documented links are cited to the README rather than presented as inspected call chains.

Main entry points: [`apps/web/src/main.tsx`](https://github.com/satishk01/open-ontology/blob/main/apps/web/src/main.tsx) (Workspace shell), [`apps/api/src/app.ts`](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/app.ts) (API application), [`apps/api/src/assistant.ts`](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/assistant.ts) (AI assistant), [`apps/web/src/api.ts`](https://github.com/satishk01/open-ontology/blob/main/apps/web/src/api.ts) (Browser API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Workspace experience"]
  node_web["Workspace shell<br/>[main.tsx]"]
  node_connections_ui["Data connections<br/>[connections.tsx]"]
  node_ontology_ui["Ontology explorer<br/>[graph.tsx]"]
  node_metrics_ui["Home metrics<br/>[metrics.tsx]"]
  node_analyst_ui["Analyst<br/>[chat.tsx]"]
  node_review_ui["Change review<br/>[review.tsx]"]
  node_web_api["Browser API client<br/>[api.ts]"]
end

subgraph group_api["API and domain"]
  node_api_app["API application<br/>[app.ts]"]
  node_data_routes["Data routes<br/>[data.ts]"]
  node_ontology_routes["Ontology routes<br/>[ontology.ts]"]
  node_workspace_routes["Workspace routes<br/>[workspace.ts]"]
  node_analyst_routes["Analyst routes<br/>[analyst.ts]"]
  node_assistant["AI assistant<br/>[assistant.ts]"]
end

subgraph group_data["Data and execution"]
  node_datasets["Dataset management<br/>[datasets.ts]"]
  node_snapshots["Snapshot management<br/>[snapshots.ts]"]
  node_store[("HelixDB store<br/>[store.ts]")]
  node_executor["DuckDB executor<br/>[engine.ts]"]
end

subgraph group_contracts["Shared contracts"]
  node_shared_schemas["Domain schemas<br/>[index.ts]"]
  node_pipeline_schema["Pipeline schemas<br/>[pipelines.ts]"]
end

node_user(("Local user"))
node_external_sources[("Connected sources")]
node_ai_provider["AI provider"]

node_user -->|"uses"| node_web
node_web -->|"opens setup"| node_connections_ui
node_web -->|"opens explorer"| node_ontology_ui
node_web -->|"views metrics"| node_metrics_ui
node_web -->|"asks questions"| node_analyst_ui
node_web -->|"reviews changes"| node_review_ui
node_connections_ui -->|"sends requests"| node_web_api
node_ontology_ui -->|"loads graph"| node_web_api
node_metrics_ui -->|"loads metrics"| node_web_api
node_analyst_ui -->|"sends questions"| node_web_api
node_review_ui -->|"submits review"| node_web_api
node_web_api -->|"calls API"| node_api_app
node_api_app -->|"registers routes"| node_data_routes
node_api_app -->|"registers routes"| node_ontology_routes
node_api_app -->|"registers routes"| node_workspace_routes
node_api_app -->|"registers routes"| node_analyst_routes
node_external_sources -->|"provides data"| node_data_routes
node_data_routes -->|"imports data"| node_datasets
node_datasets -->|"versions data"| node_snapshots
node_snapshots -->|"queries snapshots"| node_executor
node_executor -->|"writes results"| node_snapshots
node_ontology_routes -->|"stores ontology"| node_store
node_workspace_routes -->|"invokes assistant"| node_assistant
node_analyst_routes -->|"answers questions"| node_assistant
node_assistant -->|"executes SQL"| node_executor
node_assistant -->|"requests completions"| node_ai_provider
node_assistant -->|"cites versions"| node_snapshots
node_data_routes -.->|"validates data"| node_shared_schemas
node_ontology_routes -.->|"uses schemas"| node_shared_schemas
node_assistant -->|"uses contracts"| node_shared_schemas
node_pipeline_schema -->|"re-exported by"| node_shared_schemas
node_api_app -->|"accepts pipeline schema"| node_pipeline_schema

click node_web "https://github.com/satishk01/open-ontology/blob/main/apps/web/src/main.tsx"
click node_connections_ui "https://github.com/satishk01/open-ontology/blob/main/apps/web/src/areas/data/connections.tsx"
click node_ontology_ui "https://github.com/satishk01/open-ontology/blob/main/apps/web/src/areas/ontology/graph.tsx"
click node_metrics_ui "https://github.com/satishk01/open-ontology/blob/main/apps/web/src/areas/workspace/metrics.tsx"
click node_analyst_ui "https://github.com/satishk01/open-ontology/blob/main/apps/web/src/areas/analyst/chat.tsx"
click node_review_ui "https://github.com/satishk01/open-ontology/blob/main/apps/web/src/review.tsx"
click node_web_api "https://github.com/satishk01/open-ontology/blob/main/apps/web/src/api.ts"
click node_api_app "https://github.com/satishk01/open-ontology/blob/main/apps/api/src/app.ts"
click node_data_routes "https://github.com/satishk01/open-ontology/blob/main/apps/api/src/routes/data.ts"
click node_ontology_routes "https://github.com/satishk01/open-ontology/blob/main/apps/api/src/routes/ontology.ts"
click node_workspace_routes "https://github.com/satishk01/open-ontology/blob/main/apps/api/src/routes/workspace.ts"
click node_analyst_routes "https://github.com/satishk01/open-ontology/blob/main/apps/api/src/routes/analyst.ts"
click node_assistant "https://github.com/satishk01/open-ontology/blob/main/apps/api/src/assistant.ts"
click node_datasets "https://github.com/satishk01/open-ontology/blob/main/apps/api/src/datasets.ts"
click node_snapshots "https://github.com/satishk01/open-ontology/blob/main/apps/api/src/snapshots.ts"
click node_store "https://github.com/satishk01/open-ontology/blob/main/apps/api/src/store.ts"
click node_executor "https://github.com/satishk01/open-ontology/blob/main/services/executor/src/engine.ts"
click node_shared_schemas "https://github.com/satishk01/open-ontology/blob/main/packages/shared/src/index.ts"
click node_pipeline_schema "https://github.com/satishk01/open-ontology/blob/main/packages/shared/src/pipelines.ts"

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_web,node_connections_ui,node_ontology_ui,node_metrics_ui,node_analyst_ui,node_review_ui,node_web_api,node_user toneBlue
class node_api_app,node_data_routes,node_ontology_routes,node_workspace_routes,node_analyst_routes,node_assistant,node_external_sources toneAmber
class node_datasets,node_snapshots,node_store,node_executor toneMint
class node_shared_schemas,node_pipeline_schema toneRose
class node_ai_provider toneIndigo
```

## Components

### Workspace experience

- [Workspace shell](https://github.com/satishk01/open-ontology/blob/main/apps/web/src/main.tsx): `apps/web/src/main.tsx`
- [Data connections](https://github.com/satishk01/open-ontology/blob/main/apps/web/src/areas/data/connections.tsx): `apps/web/src/areas/data/connections.tsx`
- [Ontology explorer](https://github.com/satishk01/open-ontology/blob/main/apps/web/src/areas/ontology/graph.tsx): `apps/web/src/areas/ontology/graph.tsx`
- [Home metrics](https://github.com/satishk01/open-ontology/blob/main/apps/web/src/areas/workspace/metrics.tsx): `apps/web/src/areas/workspace/metrics.tsx`
- [Analyst](https://github.com/satishk01/open-ontology/blob/main/apps/web/src/areas/analyst/chat.tsx): `apps/web/src/areas/analyst/chat.tsx`
- [Change review](https://github.com/satishk01/open-ontology/blob/main/apps/web/src/review.tsx): `apps/web/src/review.tsx`
- [Browser API client](https://github.com/satishk01/open-ontology/blob/main/apps/web/src/api.ts): `apps/web/src/api.ts`

### API and domain

- [API application](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Data routes](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/routes/data.ts): `apps/api/src/routes/data.ts`
- [Ontology routes](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/routes/ontology.ts): `apps/api/src/routes/ontology.ts`
- [Workspace routes](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/routes/workspace.ts): `apps/api/src/routes/workspace.ts`
- [Analyst routes](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/routes/analyst.ts): `apps/api/src/routes/analyst.ts`
- [AI assistant](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/assistant.ts): `apps/api/src/assistant.ts`

### Data and execution

- [Dataset management](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/datasets.ts): `apps/api/src/datasets.ts`
- [Snapshot management](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/snapshots.ts): `apps/api/src/snapshots.ts`
- [HelixDB store](https://github.com/satishk01/open-ontology/blob/main/apps/api/src/store.ts): `apps/api/src/store.ts`
- [DuckDB executor](https://github.com/satishk01/open-ontology/blob/main/services/executor/src/engine.ts): `services/executor/src/engine.ts`

### Shared contracts

- [Domain schemas](https://github.com/satishk01/open-ontology/blob/main/packages/shared/src/index.ts): `packages/shared/src/index.ts`
- [Pipeline schemas](https://github.com/satishk01/open-ontology/blob/main/packages/shared/src/pipelines.ts): `packages/shared/src/pipelines.ts`

### Other components

- **Local user**
- **Connected sources**
- **AI provider**

## Connections

- Local user → Workspace shell: uses (evidence: `README.md`)
- Workspace shell → Data connections: opens setup (evidence: `README.md`)
- Workspace shell → Ontology explorer: opens explorer (evidence: `README.md`)
- Workspace shell → Home metrics: views metrics (evidence: `README.md`)
- Workspace shell → Analyst: asks questions (evidence: `README.md`)
- Workspace shell → Change review: reviews changes (evidence: `README.md`)
- Data connections → Browser API client: sends requests (evidence: `apps/web/src/areas/data/connections.tsx`)
- Ontology explorer → Browser API client: loads graph (evidence: `apps/web/src/areas/ontology/graph.tsx`)
- Home metrics → Browser API client: loads metrics (evidence: `apps/web/src/areas/workspace/metrics.tsx`)
- Analyst → Browser API client: sends questions (evidence: `README.md`)
- Change review → Browser API client: submits review (evidence: `README.md`)
- Browser API client → API application: calls API (evidence: `apps/web/src/api.ts`)
- API application → Data routes: registers routes (evidence: `apps/api/src/app.ts`)
- API application → Ontology routes: registers routes (evidence: `apps/api/src/app.ts`)
- API application → Workspace routes: registers routes (evidence: `apps/api/src/app.ts`)
- API application → Analyst routes: registers routes (evidence: `apps/api/src/app.ts`)
- Connected sources → Data routes: provides data (evidence: `README.md`)
- Data routes → Dataset management: imports data (evidence: `README.md`)
- Dataset management → Snapshot management: versions data (evidence: `README.md`)
- Snapshot management → DuckDB executor: queries snapshots (evidence: `apps/api/src/snapshots.ts`)
- DuckDB executor → Snapshot management: writes results (evidence: `README.md`)
- Ontology routes → HelixDB store: stores ontology (evidence: `README.md`)
- Workspace routes → AI assistant: invokes assistant (evidence: `apps/api/src/routes/workspace.ts`)
- Analyst routes → AI assistant: answers questions (evidence: `README.md`)
- AI assistant → DuckDB executor: executes SQL (evidence: `apps/api/src/assistant.ts`)
- AI assistant → AI provider: requests completions (evidence: `README.md`)
- AI assistant → Snapshot management: cites versions (evidence: `README.md`)
- Data routes → Domain schemas: validates data
- Ontology routes → Domain schemas: uses schemas
- AI assistant → Domain schemas: uses contracts (evidence: `apps/api/src/assistant.ts`)
- Pipeline schemas → Domain schemas: re-exported by (evidence: `packages/shared/src/index.ts`)
- API application → Pipeline schemas: accepts pipeline schema
