# abhigyanpatwari/gitnexus architecture

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

- Interactive diagram: https://gitdiagram.com/abhigyanpatwari/gitnexus
- Repository: https://github.com/abhigyanpatwari/gitnexus

## Overview

GitNexus turns a repository into a searchable knowledge graph: users run analysis, the ingestion pipeline extracts and resolves code relationships, and the resulting index supports agent tools, CLI queries, and web exploration. The graph also represents embeddings, impact and trace analysis, semantic rename, Git-diff review, wiki generation, and automatic reindexing. Source excerpts establish selected pipeline, embedding, storage-resolution, and web-client links; README statements support documented capabilities where implementation excerpts are unavailable.

Main entry points: [`gitnexus/src/cli`](https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/cli) (CLI commands), [`gitnexus/src/core/ingestion/pipeline.ts`](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/ingestion/pipeline.ts) (Code ingestion), [`gitnexus/src/core/embeddings/embedding-pipeline.ts`](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/embeddings/embedding-pipeline.ts) (Vector embeddings), [`gitnexus/src/storage/storage-resolver.ts`](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/storage/storage-resolver.ts) (Index storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Indexing and analysis"]
  node_ingestion["Code ingestion<br/>[pipeline.ts]"]
  node_graph[("Knowledge graph<br/>[graph.ts]")]
  node_embedding["Vector embeddings"]
  node_augmentation["Graph queries<br/>[engine.ts]"]
end

subgraph group_storage["Index and search"]
  node_storage[("Index storage")]
end

subgraph group_interfaces["User interfaces"]
  node_cli["CLI commands"]
  node_mcp["MCP tools<br/>[server.ts]"]
  node_web["Web explorer<br/>[App.tsx]"]
  node_backend["Backend client<br/>[backend-client.ts]"]
  node_appstate["UI state<br/>[useAppState.tsx]"]
end

subgraph group_extensions["Extended capabilities"]
  node_impact["Impact and trace"]
  node_rename["Semantic rename"]
  node_diff["Git diff review"]
  node_wiki["Code wiki<br/>[llm-client.ts]"]
  node_autosync["Automatic reindex"]
end

node_user(("Developer"))
node_provider(("Configured AI provider"))

node_user -->|"runs analysis"| node_cli
node_cli -->|"indexes repository"| node_ingestion
node_ingestion -->|"builds graph"| node_graph
node_ingestion -.->|"generates vectors"| node_embedding
node_embedding -.->|"publishes vectors"| node_storage
node_user -->|"uses agent tools"| node_mcp
node_user -->|"explores index"| node_web
node_web -->|"connects through"| node_backend
node_appstate -->|"requests backend"| node_backend
node_cli -.->|"queries graph"| node_augmentation
node_user -->|"checks impact"| node_impact
node_user -->|"previews rename"| node_rename
node_user -->|"reviews changes"| node_diff
node_user -->|"generates wiki"| node_wiki
node_provider -.->|"supplies model"| node_wiki
node_cli -->|"starts watch"| node_autosync
node_storage -->|"resolves graph path"| node_graph

click node_cli "https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/cli"
click node_ingestion "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/ingestion/pipeline.ts"
click node_graph "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/graph/graph.ts"
click node_embedding "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/embeddings/embedding-pipeline.ts"
click node_storage "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/storage/storage-resolver.ts"
click node_mcp "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/mcp/server.ts"
click node_web "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus-web/src/App.tsx"
click node_backend "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus-web/src/services/backend-client.ts"
click node_appstate "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus-web/src/hooks/useAppState.tsx"
click node_augmentation "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/augmentation/engine.ts"
click node_impact "https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/cli"
click node_rename "https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/core"
click node_diff "https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/cli"
click node_wiki "https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/wiki/llm-client.ts"
click node_autosync "https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/core/auto-sync"

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_ingestion,node_graph,node_embedding,node_augmentation toneBlue
class node_storage toneAmber
class node_cli,node_mcp,node_web,node_backend,node_appstate toneMint
class node_impact,node_rename,node_diff,node_wiki,node_autosync toneRose
class node_user,node_provider toneIndigo
```

## Components

### Indexing and analysis

- [Code ingestion](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/ingestion/pipeline.ts): `gitnexus/src/core/ingestion/pipeline.ts`
- [Knowledge graph](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/graph/graph.ts): `gitnexus/src/core/graph/graph.ts`
- [Vector embeddings](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/embeddings/embedding-pipeline.ts): `gitnexus/src/core/embeddings/embedding-pipeline.ts`
- [Graph queries](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/augmentation/engine.ts): `gitnexus/src/core/augmentation/engine.ts`

### Index and search

- [Index storage](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/storage/storage-resolver.ts): `gitnexus/src/storage/storage-resolver.ts`

### User interfaces

- [CLI commands](https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/cli): `gitnexus/src/cli`
- [MCP tools](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/mcp/server.ts): `gitnexus/src/mcp/server.ts`
- [Web explorer](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus-web/src/App.tsx): `gitnexus-web/src/App.tsx`
- [Backend client](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus-web/src/services/backend-client.ts): `gitnexus-web/src/services/backend-client.ts`
- [UI state](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus-web/src/hooks/useAppState.tsx): `gitnexus-web/src/hooks/useAppState.tsx`

### Extended capabilities

- [Impact and trace](https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/cli): `gitnexus/src/cli`
- [Semantic rename](https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/core): `gitnexus/src/core`
- [Git diff review](https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/cli): `gitnexus/src/cli`
- [Code wiki](https://github.com/abhigyanpatwari/gitnexus/blob/main/gitnexus/src/core/wiki/llm-client.ts): `gitnexus/src/core/wiki/llm-client.ts`
- [Automatic reindex](https://github.com/abhigyanpatwari/gitnexus/tree/main/gitnexus/src/core/auto-sync): `gitnexus/src/core/auto-sync`

### Other components

- **Developer**
- **Configured AI provider**

## Connections

- Developer → CLI commands: runs analysis (evidence: `README.md`)
- CLI commands → Code ingestion: indexes repository (evidence: `README.md`)
- Code ingestion → Knowledge graph: builds graph (evidence: `gitnexus/src/core/ingestion/pipeline.ts`)
- Code ingestion → Vector embeddings: generates vectors
- Vector embeddings → Index storage: publishes vectors
- Developer → MCP tools: uses agent tools (evidence: `README.md`)
- Developer → Web explorer: explores index (evidence: `README.md`)
- Web explorer → Backend client: connects through (evidence: `gitnexus-web/src/App.tsx`)
- UI state → Backend client: requests backend (evidence: `gitnexus-web/src/hooks/useAppState.tsx`)
- CLI commands → Graph queries: queries graph
- Developer → Impact and trace: checks impact (evidence: `README.md`)
- Developer → Semantic rename: previews rename (evidence: `README.md`)
- Developer → Git diff review: reviews changes (evidence: `README.md`)
- Developer → Code wiki: generates wiki (evidence: `README.md`)
- Configured AI provider → Code wiki: supplies model (evidence: `README.md`)
- CLI commands → Automatic reindex: starts watch (evidence: `README.md`)
- Index storage → Knowledge graph: resolves graph path (evidence: `gitnexus/src/storage/storage-resolver.ts`)
