# syntaxpriest/openvisio-oss architecture

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

- Interactive diagram: https://gitdiagram.com/syntaxpriest/openvisio-oss
- Repository: https://github.com/syntaxpriest/openvisio-oss

## Overview

OpenVisio indexes repositories into a deterministic symbol/import/call graph, then serves ranked, token-budgeted context to coding agents through MCP and visualizes the graph in Atlas and City views. The main path is repository selection → parsing and graph construction → ranking and queries → agent response or viewer visualization. Edges are limited to relationships visible in excerpts, the source index, or README; some viewer and indexing internals are unsampled.

Main entry points: [`mcp/src/server.ts`](https://github.com/syntaxpriest/openvisio-oss/blob/main/mcp/src/server.ts) (MCP server), [`viewer/src/App.tsx`](https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/App.tsx) (Viewer workspace), [`core/src/rank.ts`](https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/rank.ts) (Centrality ranking), [`mcp/src/tools.ts`](https://github.com/syntaxpriest/openvisio-oss/blob/main/mcp/src/tools.ts) (Agent tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_engine["Graph engine"]
  node_treesitter["Tree-sitter parsing<br/>[treesitter.ts]"]
  node_grammars["Language grammars"]
  node_graphbuild["Graph construction<br/>[build.ts]"]
  node_graphmodel[("Code graph<br/>[types.ts]")]
  node_ranking["Centrality ranking<br/>[rank.ts]"]
  node_context["Context resolution<br/>[resolve.ts]"]
  node_search["Content search<br/>[search.ts]"]
  node_queries["Graph queries<br/>[query.ts]"]
end

subgraph group_agent["Agent interface"]
  node_mcpserver["MCP server<br/>[server.ts]"]
  node_tools["Agent tools<br/>[tools.ts]"]
  node_spotlight["Live spotlight<br/>[spotlight.ts]"]
end

subgraph group_viewer["Local viewer"]
  node_viewerapp["Viewer workspace<br/>[App.tsx]"]
  node_atlas["Atlas view<br/>[AtlasView.tsx]"]
  node_city["City view<br/>[CityView.tsx]"]
  node_localapi["Local graph API<br/>[route.ts]"]
end

subgraph group_indexer["Browser indexing"]
  node_githubindex["GitHub indexing<br/>[github.ts]"]
  node_browserindex["Browser indexer<br/>[index.ts]"]
  node_browserparse["Browser parsing<br/>[treesitter.ts]"]
end

node_developer(("Developer"))
node_repository["Repository"]
node_mcpclient(("MCP client"))
node_externalgithub(("GitHub"))

node_developer -->|"selects"| node_repository
node_repository -->|"indexes"| node_mcpserver
node_mcpserver -->|"builds graph"| node_graphbuild
node_graphbuild -.->|"parses files"| node_treesitter
node_treesitter -->|"uses grammar"| node_grammars
node_graphbuild -.->|"produces"| node_graphmodel
node_mcpserver -->|"computes centrality"| node_ranking
node_mcpserver -->|"starts optionally"| node_spotlight
node_mcpclient -->|"connects"| node_mcpserver
node_mcpserver -->|"registers tools"| node_tools
node_tools -->|"resolves context"| node_context
node_tools -->|"searches content"| node_search
node_tools -.->|"queries graph"| node_queries
node_ranking -->|"ranks imports"| node_graphmodel
node_context -->|"uses ranking"| node_ranking
node_search -->|"uses ranking"| node_ranking
node_queries -->|"uses ranking"| node_ranking
node_developer -->|"opens viewer"| node_viewerapp
node_viewerapp -->|"renders atlas"| node_atlas
node_viewerapp -->|"renders city"| node_city
node_viewerapp -->|"indexes GitHub"| node_githubindex
node_githubindex -->|"fetches repository"| node_externalgithub
node_githubindex -->|"indexes files"| node_browserindex
node_browserindex -->|"parses files"| node_browserparse
node_viewerapp -->|"requests local graph"| node_localapi
node_mcpserver -.->|"publishes live focus"| node_spotlight

click node_treesitter "https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/parse/treesitter.ts"
click node_grammars "https://github.com/syntaxpriest/openvisio-oss/tree/main/core/src/parse/grammars"
click node_graphbuild "https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/build.ts"
click node_graphmodel "https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/types.ts"
click node_ranking "https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/rank.ts"
click node_context "https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/resolve.ts"
click node_search "https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/search.ts"
click node_queries "https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/query.ts"
click node_mcpserver "https://github.com/syntaxpriest/openvisio-oss/blob/main/mcp/src/server.ts"
click node_tools "https://github.com/syntaxpriest/openvisio-oss/blob/main/mcp/src/tools.ts"
click node_spotlight "https://github.com/syntaxpriest/openvisio-oss/blob/main/mcp/src/spotlight.ts"
click node_viewerapp "https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/App.tsx"
click node_atlas "https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/components/graph/AtlasView.tsx"
click node_city "https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/components/city/CityView.tsx"
click node_githubindex "https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/indexer/github.ts"
click node_browserindex "https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/indexer/index.ts"
click node_browserparse "https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/indexer/treesitter.ts"
click node_localapi "https://github.com/syntaxpriest/openvisio-oss/blob/main/ui/app/api/local-graph/route.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_treesitter,node_grammars,node_graphbuild,node_graphmodel,node_ranking,node_context,node_search,node_queries,node_mcpclient toneBlue
class node_mcpserver,node_tools,node_spotlight toneAmber
class node_viewerapp,node_atlas,node_city,node_localapi toneMint
class node_githubindex,node_browserindex,node_browserparse toneRose
class node_developer,node_repository,node_externalgithub toneIndigo
```

## Components

### Graph engine

- [Tree-sitter parsing](https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/parse/treesitter.ts): `core/src/parse/treesitter.ts`
- [Language grammars](https://github.com/syntaxpriest/openvisio-oss/tree/main/core/src/parse/grammars): `core/src/parse/grammars`
- [Graph construction](https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/build.ts): `core/src/build.ts`
- [Code graph](https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/types.ts): `core/src/types.ts`
- [Centrality ranking](https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/rank.ts): `core/src/rank.ts`
- [Context resolution](https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/resolve.ts): `core/src/resolve.ts`
- [Content search](https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/search.ts): `core/src/search.ts`
- [Graph queries](https://github.com/syntaxpriest/openvisio-oss/blob/main/core/src/query.ts): `core/src/query.ts`

### Agent interface

- [MCP server](https://github.com/syntaxpriest/openvisio-oss/blob/main/mcp/src/server.ts): `mcp/src/server.ts`
- [Agent tools](https://github.com/syntaxpriest/openvisio-oss/blob/main/mcp/src/tools.ts): `mcp/src/tools.ts`
- [Live spotlight](https://github.com/syntaxpriest/openvisio-oss/blob/main/mcp/src/spotlight.ts): `mcp/src/spotlight.ts`

### Local viewer

- [Viewer workspace](https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/App.tsx): `viewer/src/App.tsx`
- [Atlas view](https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/components/graph/AtlasView.tsx): `viewer/src/components/graph/AtlasView.tsx`
- [City view](https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/components/city/CityView.tsx): `viewer/src/components/city/CityView.tsx`
- [Local graph API](https://github.com/syntaxpriest/openvisio-oss/blob/main/ui/app/api/local-graph/route.ts): `ui/app/api/local-graph/route.ts`

### Browser indexing

- [GitHub indexing](https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/indexer/github.ts): `viewer/src/indexer/github.ts`
- [Browser indexer](https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/indexer/index.ts): `viewer/src/indexer/index.ts`
- [Browser parsing](https://github.com/syntaxpriest/openvisio-oss/blob/main/viewer/src/indexer/treesitter.ts): `viewer/src/indexer/treesitter.ts`

### Other components

- **Developer**
- **Repository**
- **MCP client**
- **GitHub**

## Connections

- Developer → Repository: selects
- Repository → MCP server: indexes (evidence: `mcp/src/server.ts`)
- MCP server → Graph construction: builds graph (evidence: `mcp/src/server.ts`)
- Graph construction → Tree-sitter parsing: parses files
- Tree-sitter parsing → Language grammars: uses grammar (evidence: `core/src/parse/treesitter.ts`)
- Graph construction → Code graph: produces
- MCP server → Centrality ranking: computes centrality (evidence: `mcp/src/server.ts`)
- MCP server → Live spotlight: starts optionally (evidence: `mcp/src/server.ts`)
- MCP client → MCP server: connects
- MCP server → Agent tools: registers tools (evidence: `mcp/src/server.ts`)
- Agent tools → Context resolution: resolves context (evidence: `mcp/src/tools.ts`)
- Agent tools → Content search: searches content (evidence: `mcp/src/tools.ts`)
- Agent tools → Graph queries: queries graph
- Centrality ranking → Code graph: ranks imports (evidence: `core/src/rank.ts`)
- Context resolution → Centrality ranking: uses ranking
- Content search → Centrality ranking: uses ranking (evidence: `core/src/search.ts`)
- Graph queries → Centrality ranking: uses ranking (evidence: `core/src/query.ts`)
- Developer → Viewer workspace: opens viewer
- Viewer workspace → Atlas view: renders atlas (evidence: `viewer/src/App.tsx`)
- Viewer workspace → City view: renders city (evidence: `viewer/src/App.tsx`)
- Viewer workspace → GitHub indexing: indexes GitHub (evidence: `viewer/src/App.tsx`)
- GitHub indexing → GitHub: fetches repository
- GitHub indexing → Browser indexer: indexes files (evidence: `viewer/src/indexer/github.ts`)
- Browser indexer → Browser parsing: parses files (evidence: `viewer/src/indexer/index.ts`)
- Viewer workspace → Local graph API: requests local graph (evidence: `viewer/src/App.tsx`)
- MCP server → Live spotlight: publishes live focus (evidence: `mcp/src/server.ts`)
