---
title: Organization Graph
description: Organization OS graph layer documentation for the organization graph derived from Organization Model Systems, resources, actions, entities, ontology catalogs, and typed links.
---
<!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
<!-- Regenerate: pnpm scaffold:sync -->


## Overview

The organization graph treats the organization model as the top-level ontology and bridges in Command View runtime topology. Command View is a lens over the shared graph, not a separate semantic model.

Graph contracts live in `@repo/core`; rendering lives in `@repo/ui`.

## Source of Truth

- `packages/core/src/organization-model/graph/types.ts`
- `packages/core/src/organization-model/graph/schema.ts`
- `packages/core/src/organization-model/graph/build.ts`
- `packages/core/src/organization-model/graph/link.ts`
- `packages/core/src/organization-model/__tests__/graph.test.ts`
- `packages/ui/src/features/operations/OrganizationGraphPage.tsx`
- `packages/ui/src/features/operations/organization-graph/`

## Model

Node kinds:

- `organization`
- `system`
- `role`
- `action`
- `entity`
- `event`
- `resource`
- `knowledge`
- `policy`
- `stage`
- `customer-segment`
- `offering`
- `goal`
- `surface`
- `navigation-group`

Edge kinds:

- `contains`
- `references`
- `maps_to`
- `uses`
- `governs`
- `governed-by`
- `links`
- `affects`
- `emits`
- `originates_from`
- `triggers`
- `applies_to`
- `effects`

System nodes come from the id-keyed `OrganizationModel.systems` map. Their graph IDs use `system:<id>`, such as `system:sales.crm`.

Resource, action, entity, policy, navigation, and ontology catalog edges are derived from canonical OM maps:

```ts
// ResourceEntry.systemPath => system -> resource contains
// SystemEntry.actions[] => system -> action uses
// Action.resourceId => action -> resource maps_to
// Action.affects[] => action -> entity affects
// Entity.links[] => entity -> entity links
// ResourceEntry.emits[] => resource -> event emits
// System.ontology.catalogTypes => ontology catalog nodes and relationships
// AgentResource.invocations[] => agent resource -> invocation target uses/references
```

## Build Pipeline

```ts
interface BuildOrganizationGraphInput {
  organizationModel: OrganizationModel
  commandViewData?: CommandViewData
}
```

`buildOrganizationGraph`:

1. Reads Organization Model Systems and derives `system:*` nodes.
2. Reads OM resources, including workflow, agent, integration, and script resources, as `resource` nodes.
3. Emits derived graph links from System, Resource, Action, Entity, Policy, Agent invocation, Knowledge, navigation, and ontology catalog contracts.
4. Bridges Command View runtime topology into resource nodes and relationship edges.
5. Returns a renderer-agnostic DTO.

## Lenses

UI lenses change presentation, not data:

- `default` -- broad map view.
- `command-view` -- operations-focused trace view.

## Package Boundary

- `@repo/core` owns graph DTOs, schemas, and build helpers.
- `@repo/ui` owns Cytoscape conversion, filtering, path tracing, panels, and presentation.
- `apps/command-center` owns route wiring.

## Verification

```bash
pnpm --filter @repo/core test -- organization-model graph
pnpm --filter @repo/ui test -- organizationGraph
pnpm --filter command-center build
```
