# ozyyshr/repograph architecture

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

- Interactive diagram: https://gitdiagram.com/ozyyshr/repograph
- Repository: https://github.com/ozyyshr/repograph

## Overview

RepoGraph builds repository-level code graphs and exposes graph-based context retrieval to two SWE-bench workflows: Agentless localization/repair and SWE-agent interactive task solving. The documented core path is graph construction followed by search; Agentless separately structures a repository, localizes likely files and code locations, then generates and postprocesses repairs. SWE-agent runs an agent against a Docker-backed environment, with RepoGraph retrieval available as an added action. Edges reflect README statements and SOURCE INDEX references; unsampled integrations are shown only where documented.

Main entry points: [`SWE-agent/sweagent/agent/agents.py`](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/agents.py) (Agent Loop), [`agentless/repair/repair.py`](https://github.com/ozyyshr/repograph/blob/main/agentless/repair/repair.py) (Repair Generation), [`agentless/util/preprocess_data.py`](https://github.com/ozyyshr/repograph/blob/main/agentless/util/preprocess_data.py) (Data Preprocessing), [`agentless/fl/FL.py`](https://github.com/ozyyshr/repograph/blob/main/agentless/fl/FL.py) (File Localization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_graph["RepoGraph"]
  node_graph_build["Graph Construction<br/>[construct_graph.py]"]
  node_graph_utils["Graph Utilities<br/>[utils.py]"]
  node_graph_search["Graph Search<br/>[graph_searcher.py]"]
end

subgraph group_agentless["Agentless Workflow"]
  node_al_structure["Repo Structure"]
  node_al_preprocess["Data Preprocessing<br/>[preprocess_data.py]"]
  node_al_localize["File Localization<br/>[FL.py]"]
  node_al_loc_detail["Location Localization<br/>[localize.py]"]
  node_al_repair["Repair Generation<br/>[repair.py]"]
  node_al_rerank["Repair Reranking<br/>[rerank.py]"]
  node_al_postprocess["Patch Processing"]
  node_api_requests["Model Requests<br/>[api_requests.py]"]
end

subgraph group_swe["SWE-agent Runtime"]
  node_swe_entry["Task Runner<br/>[run.py]"]
  node_swe_agent["Agent Loop<br/>[agents.py]"]
  node_swe_model["Model Adapters<br/>[models.py]"]
  node_swe_parser["Action Parsing<br/>[parsing.py]"]
  node_swe_commands["Agent Commands<br/>[commands.py]"]
  node_swe_history["History Processing"]
  node_swe_env["Execution Environment<br/>[swe_env.py]"]
  node_graph_action["Graph Search Action<br/>[_code_graph.py]"]
end

subgraph group_web["SWE-agent Interface"]
  node_web_api["Web API<br/>[server.py]"]
  node_web_hooks["Run Hooks<br/>[hooks.py]"]
  node_web_app["Web App<br/>[App.js]"]
  node_web_run["Run View<br/>[Run.js]"]
end

node_repo["Target Repository"]
node_docker["Docker Runtime"]

node_repo -->|"analyzes"| node_graph_build
node_graph_build -->|"uses"| node_graph_utils
node_graph_search -->|"retrieves context"| node_repo
node_al_structure -->|"provides structure"| node_al_preprocess
node_al_preprocess -->|"feeds localization"| node_al_localize
node_al_localize -->|"delegates localization"| node_al_loc_detail
node_al_loc_detail -->|"uses repository structure"| node_al_structure
node_al_localize -->|"calls"| node_al_repair
node_al_repair -->|"requests completions"| node_api_requests
node_al_repair -->|"uses"| node_al_preprocess
node_al_repair -->|"uses"| node_al_postprocess
node_al_rerank -->|"uses"| node_al_postprocess
node_al_postprocess -->|"uses"| node_al_preprocess
node_swe_entry -->|"runs"| node_swe_agent
node_swe_entry -->|"creates"| node_swe_env
node_swe_agent -->|"queries"| node_swe_model
node_swe_agent -->|"parses actions"| node_swe_parser
node_swe_agent -->|"uses commands"| node_swe_commands
node_swe_agent -->|"processes history"| node_swe_history
node_swe_agent -->|"acts through"| node_swe_env
node_swe_env -->|"controls containers"| node_docker
node_swe_agent -->|"offers graph action"| node_graph_action
node_graph_action -.->|"searches graph"| node_graph_search
node_web_api -->|"starts run"| node_swe_entry
node_web_api -->|"registers hooks"| node_web_hooks
node_web_app -->|"routes to"| node_web_run
node_web_run -.->|"controls run"| node_web_api

click node_graph_build "https://github.com/ozyyshr/repograph/blob/main/repograph/construct_graph.py"
click node_graph_utils "https://github.com/ozyyshr/repograph/blob/main/repograph/utils.py"
click node_graph_search "https://github.com/ozyyshr/repograph/blob/main/repograph/graph_searcher.py"
click node_al_structure "https://github.com/ozyyshr/repograph/blob/main/agentless/get_repo_structure/get_repo_structure.py"
click node_al_preprocess "https://github.com/ozyyshr/repograph/blob/main/agentless/util/preprocess_data.py"
click node_al_localize "https://github.com/ozyyshr/repograph/blob/main/agentless/fl/FL.py"
click node_al_loc_detail "https://github.com/ozyyshr/repograph/blob/main/agentless/fl/localize.py"
click node_al_repair "https://github.com/ozyyshr/repograph/blob/main/agentless/repair/repair.py"
click node_al_rerank "https://github.com/ozyyshr/repograph/blob/main/agentless/repair/rerank.py"
click node_al_postprocess "https://github.com/ozyyshr/repograph/blob/main/agentless/util/postprocess_data.py"
click node_api_requests "https://github.com/ozyyshr/repograph/blob/main/agentless/util/api_requests.py"
click node_swe_entry "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/run.py"
click node_swe_agent "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/agents.py"
click node_swe_model "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/models.py"
click node_swe_parser "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/parsing.py"
click node_swe_commands "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/commands.py"
click node_swe_history "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/history_processors.py"
click node_swe_env "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/environment/swe_env.py"
click node_graph_action "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/config/commands/_code_graph.py"
click node_web_api "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/api/server.py"
click node_web_hooks "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/api/hooks.py"
click node_web_app "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/frontend/src/App.js"
click node_web_run "https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/frontend/src/Run.js"

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_graph_build,node_graph_utils,node_graph_search toneBlue
class node_al_structure,node_al_preprocess,node_al_localize,node_al_loc_detail,node_al_repair,node_al_rerank,node_al_postprocess,node_api_requests toneAmber
class node_swe_entry,node_swe_agent,node_swe_model,node_swe_parser,node_swe_commands,node_swe_history,node_swe_env,node_graph_action toneMint
class node_web_api,node_web_hooks,node_web_app,node_web_run toneRose
class node_repo,node_docker toneIndigo
```

## Components

### RepoGraph

- [Graph Construction](https://github.com/ozyyshr/repograph/blob/main/repograph/construct_graph.py): `repograph/construct_graph.py`
- [Graph Utilities](https://github.com/ozyyshr/repograph/blob/main/repograph/utils.py): `repograph/utils.py`
- [Graph Search](https://github.com/ozyyshr/repograph/blob/main/repograph/graph_searcher.py): `repograph/graph_searcher.py`

### Agentless Workflow

- [Repo Structure](https://github.com/ozyyshr/repograph/blob/main/agentless/get_repo_structure/get_repo_structure.py): `agentless/get_repo_structure/get_repo_structure.py`
- [Data Preprocessing](https://github.com/ozyyshr/repograph/blob/main/agentless/util/preprocess_data.py): `agentless/util/preprocess_data.py`
- [File Localization](https://github.com/ozyyshr/repograph/blob/main/agentless/fl/FL.py): `agentless/fl/FL.py`
- [Location Localization](https://github.com/ozyyshr/repograph/blob/main/agentless/fl/localize.py): `agentless/fl/localize.py`
- [Repair Generation](https://github.com/ozyyshr/repograph/blob/main/agentless/repair/repair.py): `agentless/repair/repair.py`
- [Repair Reranking](https://github.com/ozyyshr/repograph/blob/main/agentless/repair/rerank.py): `agentless/repair/rerank.py`
- [Patch Processing](https://github.com/ozyyshr/repograph/blob/main/agentless/util/postprocess_data.py): `agentless/util/postprocess_data.py`
- [Model Requests](https://github.com/ozyyshr/repograph/blob/main/agentless/util/api_requests.py): `agentless/util/api_requests.py`

### SWE-agent Runtime

- [Task Runner](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/run.py): `SWE-agent/run.py`
- [Agent Loop](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/agents.py): `SWE-agent/sweagent/agent/agents.py`
- [Model Adapters](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/models.py): `SWE-agent/sweagent/agent/models.py`
- [Action Parsing](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/parsing.py): `SWE-agent/sweagent/agent/parsing.py`
- [Agent Commands](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/commands.py): `SWE-agent/sweagent/agent/commands.py`
- [History Processing](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/agent/history_processors.py): `SWE-agent/sweagent/agent/history_processors.py`
- [Execution Environment](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/environment/swe_env.py): `SWE-agent/sweagent/environment/swe_env.py`
- [Graph Search Action](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/config/commands/_code_graph.py): `SWE-agent/config/commands/_code_graph.py`

### SWE-agent Interface

- [Web API](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/api/server.py): `SWE-agent/sweagent/api/server.py`
- [Run Hooks](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/api/hooks.py): `SWE-agent/sweagent/api/hooks.py`
- [Web App](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/frontend/src/App.js): `SWE-agent/sweagent/frontend/src/App.js`
- [Run View](https://github.com/ozyyshr/repograph/blob/main/SWE-agent/sweagent/frontend/src/Run.js): `SWE-agent/sweagent/frontend/src/Run.js`

### Other components

- **Target Repository**
- **Docker Runtime**

## Connections

- Target Repository → Graph Construction: analyzes (evidence: `README.md`)
- Graph Construction → Graph Utilities: uses (evidence: `repograph/construct_graph.py`)
- Graph Search → Target Repository: retrieves context (evidence: `README.md`)
- Repo Structure → Data Preprocessing: provides structure (evidence: `agentless/util/preprocess_data.py`)
- Data Preprocessing → File Localization: feeds localization (evidence: `agentless/fl/FL.py`)
- File Localization → Location Localization: delegates localization (evidence: `agentless/fl/localize.py`)
- Location Localization → Repo Structure: uses repository structure (evidence: `agentless/fl/localize.py`)
- File Localization → Repair Generation: calls (evidence: `agentless/fl/FL.py`)
- Repair Generation → Model Requests: requests completions (evidence: `agentless/repair/repair.py`)
- Repair Generation → Data Preprocessing: uses (evidence: `agentless/repair/repair.py`)
- Repair Generation → Patch Processing: uses (evidence: `agentless/repair/repair.py`)
- Repair Reranking → Patch Processing: uses (evidence: `agentless/repair/rerank.py`)
- Patch Processing → Data Preprocessing: uses (evidence: `agentless/util/postprocess_data.py`)
- Task Runner → Agent Loop: runs (evidence: `SWE-agent/run.py`)
- Task Runner → Execution Environment: creates (evidence: `SWE-agent/run.py`)
- Agent Loop → Model Adapters: queries (evidence: `SWE-agent/sweagent/agent/agents.py`)
- Agent Loop → Action Parsing: parses actions (evidence: `SWE-agent/sweagent/agent/agents.py`)
- Agent Loop → Agent Commands: uses commands (evidence: `SWE-agent/sweagent/agent/agents.py`)
- Agent Loop → History Processing: processes history (evidence: `SWE-agent/sweagent/agent/agents.py`)
- Agent Loop → Execution Environment: acts through (evidence: `SWE-agent/sweagent/agent/agents.py`)
- Execution Environment → Docker Runtime: controls containers (evidence: `SWE-agent/sweagent/environment/swe_env.py`)
- Agent Loop → Graph Search Action: offers graph action (evidence: `README.md`)
- Graph Search Action → Graph Search: searches graph
- Web API → Task Runner: starts run (evidence: `SWE-agent/sweagent/api/server.py`)
- Web API → Run Hooks: registers hooks (evidence: `SWE-agent/sweagent/api/server.py`)
- Web App → Run View: routes to (evidence: `SWE-agent/sweagent/frontend/src/App.js`)
- Run View → Web API: controls run
