# gitlabhq/orbit-knowledge-graph architecture

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

- Interactive diagram: https://gitdiagram.com/gitlabhq/orbit-knowledge-graph
- Repository: https://github.com/gitlabhq/orbit-knowledge-graph

## Overview

GitLab Orbit indexes GitLab lifecycle data and repository code into a ClickHouse context graph, then serves permission-filtered graph queries to AI agents and other clients. Local `glab orbit` also supports offline repository indexing and code search. The graph highlights the documented end-to-end workflow and sampled code-indexing path; several unsampled subsystem links are omitted rather than inferred.

Main entry points: [`crates/orbit-server/src/grpc/service.rs`](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/orbit-server/src/grpc/service.rs) (Query and authorization), [`crates/code-graph/src/v2/pipeline.rs`](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/pipeline.rs) (Language parsing), [`crates/indexer/src/modules/sdlc/pipeline.rs`](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/indexer/src/modules/sdlc/pipeline.rs) (Lifecycle indexing), [`crates/indexer/src/modules/code/pipeline.rs`](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/indexer/src/modules/code/pipeline.rs) (Code indexing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion"]
  node_nats["NATS messaging<br/>[mod.rs]"]
  node_sdlc["Lifecycle indexing<br/>[pipeline.rs]"]
  node_codeindex["Code indexing<br/>[pipeline.rs]"]
end

subgraph group_codegraph["Code graph"]
  node_parser["Language parsing<br/>[pipeline.rs]"]
  node_js["JavaScript analysis<br/>[pipeline.rs]"]
  node_dsl["Semantic extraction<br/>[engine.rs]"]
  node_ssa["SSA analysis<br/>[ssa.rs]"]
  node_linker["Symbol linking<br/>[graph.rs]"]
  node_resolver["Import resolution<br/>[resolver.rs]"]
  node_linkrules["Resolution rules<br/>[rules.rs]"]
  node_trace["Parse tracing<br/>[trace.rs]"]
end

subgraph group_storage["Graph storage"]
  node_ontology["Graph ontology<br/>[pipelines.rs]"]
  node_clickhouse[("ClickHouse graph<br/>[arrow_client.rs]")]
end

subgraph group_serving["Query serving"]
  node_server["Query and authorization<br/>[service.rs]"]
  node_grpc["gRPC server<br/>[server.rs]"]
end

subgraph group_clients["User surfaces"]
  node_cli["Orbit CLI<br/>[main.rs]"]
  node_remotequery["Remote queries<br/>[query.rs]"]
end

node_gitlab(("GitLab data and code"))
node_agent(("AI agent"))
node_mcp(("MCP client"))
node_api(("REST API client"))
node_duo(("GitLab Duo"))

node_gitlab -->|"supplies lifecycle data"| node_sdlc
node_gitlab -->|"supplies repository code"| node_codeindex
node_nats -.->|"dispatches indexing"| node_sdlc
node_codeindex -->|"runs graph pipeline"| node_parser
node_parser -->|"parses definitions"| node_dsl
node_parser -.->|"dispatches language work"| node_js
node_js -->|"attaches resolution edges"| node_resolver
node_dsl -->|"uses SSA values"| node_ssa
node_parser -->|"links graph"| node_linker
node_linker -.->|"resolves imports"| node_resolver
node_linker -.->|"applies rules"| node_linkrules
node_parser -->|"records progress"| node_trace
node_sdlc -->|"writes batches"| node_clickhouse
node_ontology -->|"describes ETL pipelines"| node_sdlc
node_codeindex -.->|"writes indexed graph"| node_clickhouse
node_agent -->|"asks questions"| node_cli
node_cli -->|"routes remote queries"| node_remotequery
node_remotequery -.->|"sends query"| node_server
node_mcp -->|"queries graph"| node_server
node_api -->|"queries graph"| node_server
node_duo -->|"asks questions"| node_server
node_server -->|"serves gRPC"| node_grpc
node_server -->|"queries graph"| node_clickhouse
node_server -->|"returns permitted results"| node_agent

click node_nats "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/indexer/src/nats/mod.rs"
click node_sdlc "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/indexer/src/modules/sdlc/pipeline.rs"
click node_codeindex "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/indexer/src/modules/code/pipeline.rs"
click node_parser "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/pipeline.rs"
click node_js "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/langs/custom/js/pipeline.rs"
click node_dsl "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/dsl/engine.rs"
click node_ssa "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/dsl/ssa.rs"
click node_linker "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/linker/graph.rs"
click node_resolver "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/linker/resolver.rs"
click node_linkrules "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/linker/rules.rs"
click node_trace "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/trace.rs"
click node_ontology "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/ontology/src/pipelines.rs"
click node_clickhouse "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/clickhouse-client/src/arrow_client.rs"
click node_server "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/orbit-server/src/grpc/service.rs"
click node_grpc "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/orbit-server/src/grpc/server.rs"
click node_cli "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/orbit-cli/src/main.rs"
click node_remotequery "https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/orbit-cli/src/remote/query.rs"

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_nats,node_sdlc,node_codeindex,node_mcp,node_api toneBlue
class node_parser,node_js,node_dsl,node_ssa,node_linker,node_resolver,node_linkrules,node_trace toneAmber
class node_ontology,node_clickhouse toneMint
class node_server,node_grpc toneRose
class node_cli,node_remotequery,node_gitlab,node_agent,node_duo toneIndigo
```

## Components

### Ingestion

- [NATS messaging](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/indexer/src/nats/mod.rs): `crates/indexer/src/nats/mod.rs`
- [Lifecycle indexing](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/indexer/src/modules/sdlc/pipeline.rs): `crates/indexer/src/modules/sdlc/pipeline.rs`
- [Code indexing](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/indexer/src/modules/code/pipeline.rs): `crates/indexer/src/modules/code/pipeline.rs`

### Code graph

- [Language parsing](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/pipeline.rs): `crates/code-graph/src/v2/pipeline.rs`
- [JavaScript analysis](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/langs/custom/js/pipeline.rs): `crates/code-graph/src/v2/langs/custom/js/pipeline.rs`
- [Semantic extraction](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/dsl/engine.rs): `crates/code-graph/src/v2/dsl/engine.rs`
- [SSA analysis](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/dsl/ssa.rs): `crates/code-graph/src/v2/dsl/ssa.rs`
- [Symbol linking](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/linker/graph.rs): `crates/code-graph/src/v2/linker/graph.rs`
- [Import resolution](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/linker/resolver.rs): `crates/code-graph/src/v2/linker/resolver.rs`
- [Resolution rules](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/linker/rules.rs): `crates/code-graph/src/v2/linker/rules.rs`
- [Parse tracing](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/code-graph/src/v2/trace.rs): `crates/code-graph/src/v2/trace.rs`

### Graph storage

- [Graph ontology](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/ontology/src/pipelines.rs): `crates/ontology/src/pipelines.rs`
- [ClickHouse graph](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/clickhouse-client/src/arrow_client.rs): `crates/clickhouse-client/src/arrow_client.rs`

### Query serving

- [Query and authorization](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/orbit-server/src/grpc/service.rs): `crates/orbit-server/src/grpc/service.rs`
- [gRPC server](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/orbit-server/src/grpc/server.rs): `crates/orbit-server/src/grpc/server.rs`

### User surfaces

- [Orbit CLI](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/orbit-cli/src/main.rs): `crates/orbit-cli/src/main.rs`
- [Remote queries](https://github.com/gitlabhq/orbit-knowledge-graph/blob/main/crates/orbit-cli/src/remote/query.rs): `crates/orbit-cli/src/remote/query.rs`

### Other components

- **GitLab data and code**
- **AI agent**
- **MCP client**
- **REST API client**
- **GitLab Duo**

## Connections

- GitLab data and code → Lifecycle indexing: supplies lifecycle data (evidence: `README.md`)
- GitLab data and code → Code indexing: supplies repository code (evidence: `README.md`)
- NATS messaging → Lifecycle indexing: dispatches indexing (evidence: `crates/indexer/src/modules/sdlc/pipeline.rs`)
- Code indexing → Language parsing: runs graph pipeline (evidence: `crates/indexer/src/modules/code/pipeline.rs`)
- Language parsing → Semantic extraction: parses definitions (evidence: `crates/code-graph/src/v2/pipeline.rs`)
- Language parsing → JavaScript analysis: dispatches language work (evidence: `crates/code-graph/src/v2/langs/custom/js/pipeline.rs`)
- JavaScript analysis → Import resolution: attaches resolution edges (evidence: `crates/code-graph/src/v2/langs/custom/js/pipeline.rs`)
- Semantic extraction → SSA analysis: uses SSA values (evidence: `crates/code-graph/src/v2/dsl/engine.rs`)
- Language parsing → Symbol linking: links graph (evidence: `crates/code-graph/src/v2/pipeline.rs`)
- Symbol linking → Import resolution: resolves imports
- Symbol linking → Resolution rules: applies rules
- Language parsing → Parse tracing: records progress (evidence: `crates/code-graph/src/v2/pipeline.rs`)
- Lifecycle indexing → ClickHouse graph: writes batches (evidence: `crates/indexer/src/modules/sdlc/pipeline.rs`)
- Graph ontology → Lifecycle indexing: describes ETL pipelines (evidence: `crates/ontology/src/pipelines.rs`)
- Code indexing → ClickHouse graph: writes indexed graph
- AI agent → Orbit CLI: asks questions (evidence: `README.md`)
- Orbit CLI → Remote queries: routes remote queries (evidence: `crates/orbit-cli/src/main.rs`)
- Remote queries → Query and authorization: sends query
- MCP client → Query and authorization: queries graph (evidence: `README.md`)
- REST API client → Query and authorization: queries graph (evidence: `README.md`)
- GitLab Duo → Query and authorization: asks questions (evidence: `README.md`)
- Query and authorization → gRPC server: serves gRPC (evidence: `crates/orbit-server/src/grpc/server.rs`)
- Query and authorization → ClickHouse graph: queries graph (evidence: `README.md`)
- Query and authorization → AI agent: returns permitted results (evidence: `README.md`)
