# rohit4034/repo-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/rohit4034/repo-intelligence
- Repository: https://github.com/rohit4034/repo-intelligence

## Overview

Repo Intelligence is a repository-analysis workbench: users import a repository, receive a static code graph and analysis artifacts, then explore architecture, flows, findings, technology, and source-grounded answers. The README documents the broader API capabilities; the worker excerpt shows the job’s analyze → persist → index ownership. Source excerpts are limited, so frontend-to-backend wiring and several backend internals are shown only where documented or referenced by the source index.

Main entry points: [`web/components/workspace.tsx`](https://github.com/rohit4034/repo-intelligence/blob/main/web/components/workspace.tsx) (Workspace), [`codebase_ingestion_engine/src/repo_intelligence/retrieval.py`](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/retrieval.py) (Search and indexing), [`codebase_ingestion_engine/src/repo_intelligence/worker.py`](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/worker.py) (Ingestion worker), [`web/lib/api.ts`](https://github.com/rohit4034/repo-intelligence/blob/main/web/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web workbench"]
  node_workbench["Workspace<br/>[workspace.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_search["Evidence search<br/>[search-panel.tsx]"]
  node_graph_view["Repository graph"]
  node_architecture_view["Architecture view"]
  node_reports_view["Reports<br/>[reports-panel.tsx]"]
  node_tech_view["Tech stack view"]
  node_ai_settings["AI settings<br/>[ai-settings.tsx]"]
end

subgraph group_service["API and jobs"]
  node_api["FastAPI service<br/>[api.py]"]
  node_jobs["Ingestion worker<br/>[worker.py]"]
  node_repo_access["Repository access<br/>[repositories.py]"]
end

subgraph group_analysis["Repository analysis"]
  node_analyzer["Static analyzer<br/>[analyzer.py]"]
  node_tech_stack["Stack detection<br/>[tech_stack.py]"]
end

subgraph group_knowledge["Retrieval and artifacts"]
  node_artifact_store[("Artifact and job store<br/>[storage.py]")]
  node_retrieval["Search and indexing<br/>[retrieval.py]"]
  node_models["Domain models<br/>[models.py]"]
  node_operations["Operations tracking<br/>[operations.py]"]
end

subgraph group_integrations["Accounts and AI"]
  node_auth["Authentication<br/>[auth.py]"]
  node_github["GitHub connection"]
  node_ai_providers["AI providers<br/>[providers.py]"]
  node_ai_config["AI configuration<br/>[ai_config.py]"]
  node_inference["AI inference<br/>[inference.py]"]
  node_settings["Service settings<br/>[settings.py]"]
end

node_developer(("Developer"))

node_developer -->|"uses"| node_workbench
node_workbench -.->|"requests data"| node_api_client
node_api_client -.->|"calls API"| node_api
node_search -->|"searches"| node_api_client
node_graph_view -->|"loads graph"| node_api_client
node_workbench -.->|"presents"| node_search
node_workbench -.->|"presents"| node_graph_view
node_workbench -.->|"presents"| node_architecture_view
node_workbench -.->|"presents"| node_reports_view
node_workbench -.->|"presents"| node_tech_view
node_api -.->|"queues work"| node_jobs
node_jobs -->|"analyzes repository"| node_repo_access
node_jobs -->|"gets job token"| node_github
node_jobs -->|"saves artifact"| node_artifact_store
node_jobs -->|"indexes artifact"| node_retrieval
node_jobs -->|"records failures"| node_operations
node_repo_access -.->|"analyzes source"| node_analyzer
node_analyzer -.->|"detects stack"| node_tech_stack
node_retrieval -->|"reads and writes"| node_artifact_store
node_retrieval -->|"uses models"| node_models
node_retrieval -->|"uses providers"| node_ai_providers
node_retrieval -->|"reads settings"| node_settings
node_retrieval -->|"selects configuration"| node_ai_config
node_retrieval -->|"uses inference"| node_inference
node_api -.->|"authenticates users"| node_auth
node_api -.->|"offers GitHub connection"| node_github
node_ai_settings -.->|"configures AI"| node_api_client

click node_workbench "https://github.com/rohit4034/repo-intelligence/blob/main/web/components/workspace.tsx"
click node_api_client "https://github.com/rohit4034/repo-intelligence/blob/main/web/lib/api.ts"
click node_search "https://github.com/rohit4034/repo-intelligence/blob/main/web/components/search-panel.tsx"
click node_graph_view "https://github.com/rohit4034/repo-intelligence/blob/main/web/components/repository-graph.tsx"
click node_architecture_view "https://github.com/rohit4034/repo-intelligence/blob/main/web/components/architecture-panel.tsx"
click node_reports_view "https://github.com/rohit4034/repo-intelligence/blob/main/web/components/reports-panel.tsx"
click node_tech_view "https://github.com/rohit4034/repo-intelligence/blob/main/web/components/tech-stack-panel.tsx"
click node_ai_settings "https://github.com/rohit4034/repo-intelligence/blob/main/web/components/ai-settings.tsx"
click node_api "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/api.py"
click node_jobs "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/worker.py"
click node_repo_access "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/repositories.py"
click node_analyzer "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/analyzer.py"
click node_tech_stack "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/tech_stack.py"
click node_artifact_store "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/storage.py"
click node_retrieval "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/retrieval.py"
click node_models "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/models.py"
click node_operations "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/operations.py"
click node_auth "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/auth.py"
click node_github "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/github_connection.py"
click node_ai_providers "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/providers.py"
click node_ai_config "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/ai_config.py"
click node_inference "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/inference.py"
click node_settings "https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/settings.py"

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_workbench,node_api_client,node_search,node_graph_view,node_architecture_view,node_reports_view,node_tech_view,node_ai_settings toneBlue
class node_api,node_jobs,node_repo_access toneAmber
class node_analyzer,node_tech_stack toneMint
class node_artifact_store,node_retrieval,node_models,node_operations toneRose
class node_auth,node_github,node_ai_providers,node_ai_config,node_inference,node_settings,node_developer toneIndigo
```

## Components

### Web workbench

- [Workspace](https://github.com/rohit4034/repo-intelligence/blob/main/web/components/workspace.tsx): `web/components/workspace.tsx`
- [API client](https://github.com/rohit4034/repo-intelligence/blob/main/web/lib/api.ts): `web/lib/api.ts`
- [Evidence search](https://github.com/rohit4034/repo-intelligence/blob/main/web/components/search-panel.tsx): `web/components/search-panel.tsx`
- [Repository graph](https://github.com/rohit4034/repo-intelligence/blob/main/web/components/repository-graph.tsx): `web/components/repository-graph.tsx`
- [Architecture view](https://github.com/rohit4034/repo-intelligence/blob/main/web/components/architecture-panel.tsx): `web/components/architecture-panel.tsx`
- [Reports](https://github.com/rohit4034/repo-intelligence/blob/main/web/components/reports-panel.tsx): `web/components/reports-panel.tsx`
- [Tech stack view](https://github.com/rohit4034/repo-intelligence/blob/main/web/components/tech-stack-panel.tsx): `web/components/tech-stack-panel.tsx`
- [AI settings](https://github.com/rohit4034/repo-intelligence/blob/main/web/components/ai-settings.tsx): `web/components/ai-settings.tsx`

### API and jobs

- [FastAPI service](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/api.py): `codebase_ingestion_engine/src/repo_intelligence/api.py`
- [Ingestion worker](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/worker.py): `codebase_ingestion_engine/src/repo_intelligence/worker.py`
- [Repository access](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/repositories.py): `codebase_ingestion_engine/src/repo_intelligence/repositories.py`

### Repository analysis

- [Static analyzer](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/analyzer.py): `codebase_ingestion_engine/src/repo_intelligence/analyzer.py`
- [Stack detection](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/tech_stack.py): `codebase_ingestion_engine/src/repo_intelligence/tech_stack.py`

### Retrieval and artifacts

- [Artifact and job store](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/storage.py): `codebase_ingestion_engine/src/repo_intelligence/storage.py`
- [Search and indexing](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/retrieval.py): `codebase_ingestion_engine/src/repo_intelligence/retrieval.py`
- [Domain models](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/models.py): `codebase_ingestion_engine/src/repo_intelligence/models.py`
- [Operations tracking](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/operations.py): `codebase_ingestion_engine/src/repo_intelligence/operations.py`

### Accounts and AI

- [Authentication](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/auth.py): `codebase_ingestion_engine/src/repo_intelligence/auth.py`
- [GitHub connection](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/github_connection.py): `codebase_ingestion_engine/src/repo_intelligence/github_connection.py`
- [AI providers](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/providers.py): `codebase_ingestion_engine/src/repo_intelligence/providers.py`
- [AI configuration](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/ai_config.py): `codebase_ingestion_engine/src/repo_intelligence/ai_config.py`
- [AI inference](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/inference.py): `codebase_ingestion_engine/src/repo_intelligence/inference.py`
- [Service settings](https://github.com/rohit4034/repo-intelligence/blob/main/codebase_ingestion_engine/src/repo_intelligence/settings.py): `codebase_ingestion_engine/src/repo_intelligence/settings.py`

### Other components

- **Developer**

## Connections

- Developer → Workspace: uses
- Workspace → API client: requests data
- API client → FastAPI service: calls API
- Evidence search → API client: searches (evidence: `web/components/search-panel.tsx`)
- Repository graph → API client: loads graph (evidence: `web/components/repository-graph.tsx`)
- Workspace → Evidence search: presents
- Workspace → Repository graph: presents
- Workspace → Architecture view: presents
- Workspace → Reports: presents
- Workspace → Tech stack view: presents
- FastAPI service → Ingestion worker: queues work
- Ingestion worker → Repository access: analyzes repository (evidence: `codebase_ingestion_engine/src/repo_intelligence/worker.py`)
- Ingestion worker → GitHub connection: gets job token (evidence: `codebase_ingestion_engine/src/repo_intelligence/worker.py`)
- Ingestion worker → Artifact and job store: saves artifact (evidence: `codebase_ingestion_engine/src/repo_intelligence/worker.py`)
- Ingestion worker → Search and indexing: indexes artifact (evidence: `codebase_ingestion_engine/src/repo_intelligence/worker.py`)
- Ingestion worker → Operations tracking: records failures (evidence: `codebase_ingestion_engine/src/repo_intelligence/worker.py`)
- Repository access → Static analyzer: analyzes source
- Static analyzer → Stack detection: detects stack
- Search and indexing → Artifact and job store: reads and writes (evidence: `codebase_ingestion_engine/src/repo_intelligence/retrieval.py`)
- Search and indexing → Domain models: uses models (evidence: `codebase_ingestion_engine/src/repo_intelligence/retrieval.py`)
- Search and indexing → AI providers: uses providers (evidence: `codebase_ingestion_engine/src/repo_intelligence/retrieval.py`)
- Search and indexing → Service settings: reads settings (evidence: `codebase_ingestion_engine/src/repo_intelligence/retrieval.py`)
- Search and indexing → AI configuration: selects configuration (evidence: `codebase_ingestion_engine/src/repo_intelligence/retrieval.py`)
- Search and indexing → AI inference: uses inference (evidence: `codebase_ingestion_engine/src/repo_intelligence/retrieval.py`)
- FastAPI service → Authentication: authenticates users
- FastAPI service → GitHub connection: offers GitHub connection
- AI settings → API client: configures AI
