Papers
Topics
Authors
Recent
Search
2000 character limit reached

Repository Structural Semantic Graph (RSSG)

Updated 6 July 2026
  • Repository Structural Semantic Graph (RSSG) is a graph-based representation that fuses structural code hierarchies with semantic annotations for comprehensive repository analysis.
  • It enables advanced tasks such as querying, ranking, and traversal by leveraging heterogeneous, multi-relational graphs over code entities.
  • Construction pipelines combine static parsing with LLM-driven semantic enrichment to capture code dependencies, data flows, and domain concepts.

Searching arXiv for papers on repository structural semantic graphs and related repository graph representations. Repository Structural Semantic Graph (RSSG) is a repository-level graph representation that unifies structural program relations with semantic annotations, embeddings, or higher-level abstractions so that codebases can be queried, ranked, traversed, summarized, or consumed by LLMs as structured context rather than as flat text. Across recent work, RSSG is instantiated as a heterogeneous, directed, often typed and attributed graph over entities such as repositories, projects, directories, files, classes, functions, statements, and domain entities, with edges capturing containment, imports, calls, inheritance, data flow, and repository-artifact links. The term is used explicitly in some systems and as a direct mapping for related constructs such as semantic code graphs, repository planning graphs, repository-aware knowledge graphs, and multi-view code graphs (Usai et al., 15 Jan 2026, Hu et al., 8 May 2026, Luo et al., 2 Feb 2026, Liu et al., 20 Jul 2025).

1. Definition and conceptual scope

RSSG denotes a graph that combines repository structure with semantic information at one or more granularities. In one explicit formulation, the repository is represented as a typed, attributed, directed multigraph G=(V,E,X)G = (V, E, X) whose nodes include directories, files, classes, and functions, and whose edges encode relations such as contains, imports, invokes, inheritance, and cross-artifact links (Hu et al., 8 May 2026). In another formulation specialized to multi-repository systems, the graph is defined as G=(V,E,A)G = (V, E, A) with node types {System,Project,Code,Entity}\{System, Project, Code, Entity\} and edge labels partitioned into structural relations {CONTAINS,DEPENDS_ON,CALLS,IMPLEMENTS}\{\text{CONTAINS}, \text{DEPENDS\_ON}, \text{CALLS}, \text{IMPLEMENTS}\} and semantic relations {CREATE,PRODUCE,CONFIGURE,REPRESENTS,RELATES_TO}\{\text{CREATE}, \text{PRODUCE}, \text{CONFIGURE}, \text{REPRESENTS}, \text{RELATES\_TO}\} (Usai et al., 15 Jan 2026). RepoScope likewise defines RSSG as a multi-view heterogeneous directed graph over Class, Function, and Attribute entities with structural/type, call, and import relations (Liu et al., 20 Jul 2025).

The structural component typically includes hierarchy and static dependency information: repository or package containment, import relations, call graphs, inheritance, ownership, and symbol visibility (Tao et al., 22 May 2025, Phan et al., 2024, Athale et al., 20 May 2025). The semantic component varies by system. It may consist of node text attributes such as code, comments, docstrings, and signatures (Tao et al., 22 May 2025); natural-language summaries and vector embeddings (Usai et al., 15 Jan 2026, Bevziuk et al., 10 Oct 2025); lifted verb–object functionality features attached to nodes (Luo et al., 2 Feb 2026); or domain entities and workflow-like action edges that link code to concepts such as Order, User, or Payment (Usai et al., 15 Jan 2026).

A recurring distinction in the literature is between repository-local structural graphs and richer repository structural semantic graphs. Structural-only graphs capture static dependencies but often do not expose system-wide workflows, domain logic, or higher-level intent (Usai et al., 15 Jan 2026). RSSG formulations attempt to bridge that gap by adding semantic descriptions, learned embeddings, artifact links, domain abstractions, or fine-grained program dependencies, depending on the target task.

2. Node and edge taxonomies

The node set of an RSSG is heterogeneous and task-dependent. A minimal repository-local schema in LARGER uses directories, files, classes, and functions, each carrying textual attributes such as file path, code block, or doc string (Hu et al., 8 May 2026). CGM expands this to REPO, PACKAGE, FILE, TEXTFILE, [CLASS](https://www.emergentmind.com/topics/colorado-learning-attitudes-about-science-survey-class), FUNCTION, and ATTRIBUTE (Tao et al., 22 May 2025). RepoHyper’s Repo-level Semantic Graph uses Function/Method, Class, and Script nodes, with script nodes representing file contents not captured as functions or classes (Phan et al., 2024). LogicLens adds System, Project, Code, and Entity nodes for cross-repository reasoning (Usai et al., 15 Jan 2026). ARISE extends structural nodes down to statement level, with node types {Directory, Module, Class, Function, Method, Statement} (Seddik et al., 4 May 2026). RepoSPD’s repository-level graph for patch detection goes further to statement, basic block, AST, and token granularity, with version labels {pre,post,common}\{pre, post, common\} attached to merged nodes (Wen et al., 2024).

Edge vocabularies are equally varied but cluster into a few stable families. Structural edges include containment, imports, call or invoke relations, inheritance, ownership, encapsulation, and file-to-symbol links (Hu et al., 8 May 2026, Phan et al., 2024, Tao et al., 22 May 2025). Semantic or higher-level relations include code-to-domain action links such as CREATE, PRODUCE, CONFIGURE, and REPRESENTS (Usai et al., 15 Jan 2026), as well as has_description links to semantic description nodes in graph-based code generation systems (Athale et al., 20 May 2025). Some systems also add repository-artifact relations, for example between issues, pull requests, files, classes, and functions via mentions or references edges (Yang et al., 27 Mar 2025). Program-semantics variants incorporate statement-level DataflowDefUse and DataflowUseDef edges (Seddik et al., 4 May 2026), or AST, CFG, CDG, DDG, and def-use relations in repository patch graphs (Wen et al., 2024).

The following table summarizes recurrent node and edge categories as they are instantiated in the cited systems.

Aspect Examples of nodes Examples of edges
Repository hierarchy REPO, PACKAGE, FILE, TEXTFILE; System, Project contains, CONTAINS
Code symbols CLASS, FUNCTION, METHOD, ATTRIBUTE, Code, Script calls, invokes, CALLS, imports, DEPENDS_ON, IMPLEMENTS, inheritance, Inherits
Fine-grained program units Statement, V_stmt, V_ast, V_bb DataflowDefUse, DataflowUseDef, R_cfg, R_cdg, R_ddg, R_ast_parent
Semantic abstractions Entity, Description, high-level architectural nodes CREATE, PRODUCE, CONFIGURE, REPRESENTS, RELATES_TO, has_description
Repository artifacts Issue, PR, optionally Commit, Contributor mentions, references, optional modifies, authored_by

This taxonomy suggests that RSSG is less a single fixed schema than a family of related graph formalisms. A plausible implication is that the graph should be matched to the downstream task: issue localization benefits from artifact links and shortest paths, code completion benefits from symbol- and call-centric structure, and repair or debugging benefits from finer data-flow or temporal structure.

3. Construction pipelines and semantic enrichment

Most RSSG pipelines begin with static parsing. Tree-sitter is a common choice for extracting classes, structs, and functions and for building containment and dependency edges across languages such as Java, Python, Go, and TypeScript (Usai et al., 15 Jan 2026). RepoHyper similarly uses Tree-sitter and Python’s AST, plus PyCG for call-graph construction in Python repositories (Phan et al., 2024). CGM describes a generic pipeline that walks the repository, builds hierarchical nodes, parses ASTs for classes, functions, and attributes, resolves imports and calls, strips child spans from parent nodes to reduce textual duplication, and then chunks long node text into units of up to 512 tokens (Tao et al., 22 May 2025).

Semantic enrichment is usually layered on top of this structural pass. LogicLens uses hierarchical prompting to generate concise three-sentence summaries for code nodes, aggregate them to project-level summaries, and synthesize system-level summaries; it then uses specialized prompts to extract domain entities and action relations between code and entities (Usai et al., 15 Jan 2026). Other systems attach docstrings, comments, and LLM-generated descriptions directly to code entities, often as separate description nodes or as node attributes with associated embeddings (Athale et al., 20 May 2025, Bevziuk et al., 10 Oct 2025). RPG-Encoder formalizes semantic lifting by attaching concise verb–object features ff to nodes and organizing them into a feature hierarchy over high-level and low-level repository nodes (Luo et al., 2 Feb 2026).

Several papers treat embeddings as a core RSSG attribute rather than as a separate retrieval artifact. LogicLens defines node embeddings f:V→Rdf: V \to \mathbb{R}^d and query embeddings g(q)∈Rdg(q) \in \mathbb{R}^d and uses cosine similarity

s(u,v)=f(u)⋅f(v)∥f(u)∥∥f(v)∥s(u, v) = \frac{f(u) \cdot f(v)}{\|f(u)\| \|f(v)\|}

for semantic search over nodes (Usai et al., 15 Jan 2026). LARGER attaches textual attributes G=(V,E,A)G = (V, E, A)0 to graph nodes and uses lexical search to find anchors, then expands locally in the graph (Hu et al., 8 May 2026). CGM computes CodeT5+-based embeddings for node text chunks and maps them into the decoder input space through a two-layer MLP adapter (Tao et al., 22 May 2025).

Incrementality is addressed unevenly across the literature. Some systems operate on static repository snapshots, especially in benchmark settings (Athale et al., 20 May 2025, Phan et al., 2024). Others provide explicit update mechanisms. LARGER aligns a cached graph G=(V,E,A)G = (V, E, A)1 to a new commit via the diff,

G=(V,E,A)G = (V, E, A)2

with cost G=(V,E,A)G = (V, E, A)3, and reports per-commit alignment in milliseconds (Hu et al., 8 May 2026). RPG-Encoder similarly performs local updates whose cost scales with the change set size and hierarchy depth, reducing token budget for maintenance from approximately G=(V,E,A)G = (V, E, A)4 to G=(V,E,A)G = (V, E, A)5, a 95.7% reduction (Luo et al., 2 Feb 2026).

4. Retrieval, traversal, and query semantics

RSSG is primarily useful because it supports structure-aware localization and traversal. Several systems operationalize this through graph-native scoring and bounded expansion. LogicLens defines a base score

G=(V,E,A)G = (V, E, A)6

where G=(V,E,A)G = (V, E, A)7 encodes node-class priors and G=(V,E,A)G = (V, E, A)8 neighborhood strength, then extracts induced subgraphs around top-ranked nodes (Usai et al., 15 Jan 2026). LARGER casts repository localization as selecting an active subgraph driven by lexical anchors aligned to graph nodes:

G=(V,E,A)G = (V, E, A)9

followed by confidence-filtered local expansion and bounded-context accumulation across interaction steps (Hu et al., 8 May 2026). Its theoretical analysis states recall dominance over a purely lexical loop and derives a bounded per-step augmentation cost {System,Project,Code,Entity}\{System, Project, Code, Entity\}0 (Hu et al., 8 May 2026).

Repository-level completion systems often use a search–expand–refine paradigm. RepoHyper first retrieves top-{System,Project,Code,Entity}\{System, Project, Code, Entity\}1 nearest nodes by embedding similarity, then expands by BFS or by frequent structural path types, and finally re-ranks candidates using GraphSAGE-based link prediction between a query node and expanded graph nodes (Phan et al., 2024). RepoScope combines four views—callers, predicted call chains, similar functions, and similar code fragments—and uses a call-chain prediction procedure over structural/type edges to infer likely callees in the yet-unimplemented target function (Liu et al., 20 Jul 2025). Its entity scoring function is

{System,Project,Code,Entity}\{System, Project, Code, Entity\}2

with {System,Project,Code,Entity}\{System, Project, Code, Entity\}3 in experiments (Liu et al., 20 Jul 2025).

Issue-resolution and repair systems emphasize multi-hop path reasoning. KGCompass ranks candidate functions by

{System,Project,Code,Entity}\{System, Project, Code, Entity\}4

where {System,Project,Code,Entity}\{System, Project, Code, Entity\}5 is the weighted shortest-path length from issue node {System,Project,Code,Entity}\{System, Project, Code, Entity\}6 to function {System,Project,Code,Entity}\{System, Project, Code, Entity\}7, with {System,Project,Code,Entity}\{System, Project, Code, Entity\}8 and {System,Project,Code,Entity}\{System, Project, Code, Entity\}9 (Yang et al., 27 Mar 2025). ARISE exposes slicing as a first-class graph query over statement-level data-flow edges, allowing backward and forward traversal within a function boundary from a seed variable and line (Seddik et al., 4 May 2026). DUALVIEW generalizes traversal across four view-specific graphs—module coupling, function call, class hierarchy, and program dependence—and composes them into a multiplex RSSG with a supra-adjacency

{CONTAINS,DEPENDS_ON,CALLS,IMPLEMENTS}\{\text{CONTAINS}, \text{DEPENDS\_ON}, \text{CALLS}, \text{IMPLEMENTS}\}0

enabling cross-view path composition (Zhang et al., 2 Jul 2026).

These formulations share a common premise: retrieval quality depends not only on node-text similarity but also on the graph’s typed local neighborhood, path structure, and interaction budget. This suggests that RSSG functions as both an indexing structure and a reasoning substrate.

5. Task-specific variants and applications

RSSG has been adapted to at least four distinct task families.

For repository-level code completion and generation, RSSG serves as a retrieval substrate that recovers cross-file context unavailable to flat similarity search. RepoHyper reports large gains over similarity-only retrieval in RepoBench, with retrieval accuracy improving by an average of 49% across subsets (Phan et al., 2024). RepoScope reports improvements on CoderEval and DevEval, reaching a 36.35% relative improvement in pass@1 on DevEval with Claude-3.5-Haiku and a 17.15% relative improvement on CoderEval with DeepSeek-V3 (Liu et al., 20 Jul 2025). GRACE uses a multi-level code graph with AST, CFG, DFG, type dependency, call, inheritance, and repository structure, and reports gains of +8.19% EM and +7.51% ES over the strongest graph-based RAG baselines using DeepSeek-V3 (Wang et al., 7 Sep 2025). CGM integrates repository graph structure directly into decoder attention and achieves a 43.00% resolution rate on SWE-bench Lite with Qwen2.5-72B, surpassing the previous best open-source model-based method by 12.33% (Tao et al., 22 May 2025).

For localization and navigation in coding agents, graph representations support file- and function-level search. LARGER improves file-level Acc@5 on LocBench by +13.9 points with tuned hyperparameters and +11.8 with fixed hyperparameters over the strongest baseline, while also improving MuLocBench, SWE-Atlas Test Writing, and SWE-Atlas Codebase QA (Hu et al., 8 May 2026). RPG-Encoder reaches 93.7% Acc@5 at function level on SWE-bench Verified and exceeds the best baseline by over 10% on SWE-bench Live Lite (Luo et al., 2 Feb 2026). DUALVIEW improves issue-resolution performance across multiple agents and model families by externalizing structure in persistent visual and textual graph slices (Zhang et al., 2 Jul 2026).

For debugging, fault localization, and automated repair, RSSG variants tend to add finer dependencies or artifact links. LogicLens reports emergent capabilities including impact analysis, symptom-based debugging, and log-fragment debugging arising from its semantic multi-repository graph (Usai et al., 15 Jan 2026). ARISE improves Function Recall@1 by 17.0 points and Line Recall@1 by 15.0 points over the SWE-agent baseline, and reaches 22.0% Pass@1 on SWE-bench Lite, a 4.7 percentage-point improvement (Seddik et al., 4 May 2026). KGCompass achieves 45.67% repair performance and 51.33% function-level localization on SWE-Bench-Lite at approximately {CONTAINS,DEPENDS_ON,CALLS,IMPLEMENTS}\{\text{CONTAINS}, \text{DEPENDS\_ON}, \text{CALLS}, \text{IMPLEMENTS}\}1 per repair, and reports that 69.7% of successfully localized bugs require multi-hop knowledge-graph traversals (Yang et al., 27 Mar 2025).

For security analysis and patch detection, the graph often becomes temporal and lower-level. RepoSPD constructs a repository-level graph by merging pre-patch and post-patch code property graphs and augmenting them with repository call edges, then fuses graph and sequence branches for classification (Wen et al., 2024). On SPI-DB* and PatchDB*, RepoSPD improves accuracy by 11.90% and 3.10% over the best baselines, respectively (Wen et al., 2024).

6. Evaluation patterns, strengths, and limitations

Evaluation results across the literature converge on a few robust patterns. First, graph-aware retrieval consistently outperforms lexical-only or vector-only retrieval. LARGER’s ablations show MuLocBench Acc@5 dropping from 55.7 to 48.2 without graph expansion and to 53.1 without confidence scoring (Hu et al., 8 May 2026). RepoHyper’s ablations show that pattern-based graph expansion plus a link predictor outperforms kNN-only and cosine-only reranking on RepoBench-R (Phan et al., 2024). LogicLens substantially improves human-rated accuracy and coherence relative to a vector baseline; the baseline has Accuracy High 0 and LogicLens reaches Accuracy High 69.5, while Coherence High rises from 17.39 to 52.2 (Usai et al., 15 Jan 2026).

Second, typed relations and local graph neighborhoods appear to be especially valuable when the task depends on non-textual structure. ARISE’s controlled ablation shows that gains come from the data-flow graph rather than merely from exposing a tool schema (Seddik et al., 4 May 2026). KGCompass finds that multi-hop traversals are necessary in 69.7% of successful localizations (Yang et al., 27 Mar 2025). RepoScope’s call chain prediction improves predicted callee F1 from 0.4352 for a similarity-only baseline to 0.603 (Liu et al., 20 Jul 2025).

Third, graph representations introduce their own failure modes. Static analysis misses dynamic dispatch, reflection, macros, or runtime imports (Tao et al., 22 May 2025, Seddik et al., 4 May 2026, Bevziuk et al., 10 Oct 2025). LLM-inferred semantics can be noisy or stale as repositories evolve (Usai et al., 15 Jan 2026). Dense neighborhoods can cause over-expansion unless controlled by confidence thresholds, node budgets, or summarization nodes (Hu et al., 8 May 2026, Zhang et al., 2 Jul 2026). Cross-repository version alignment, privacy, and access control remain non-trivial for multi-repository graphs (Usai et al., 15 Jan 2026).

A frequent misconception is that a structural graph alone suffices to solve repository reasoning. The surveyed systems do not support that conclusion. Structural-only graphs help with dependency recovery, but several papers argue that they struggle with domain logic, workflow reconstruction, or issue-to-code grounding unless augmented with semantic signals, artifact links, or finer def-use structure (Usai et al., 15 Jan 2026, Yang et al., 27 Mar 2025, Seddik et al., 4 May 2026). A second misconception is that semantic retrieval makes graph structure unnecessary. LARGER, RepoHyper, RepoScope, and GRACE all report that semantic similarity alone misses crucial dependencies, whereas hybrid graph-aware retrieval improves localization or generation (Hu et al., 8 May 2026, Phan et al., 2024, Liu et al., 20 Jul 2025, Wang et al., 7 Sep 2025).

7. Positioning and prospective directions

RSSG sits at the intersection of program analysis, software repository mining, graph representation learning, and LLM-based software engineering. Compared with ASTs, it broadens scope from file-local syntax to repository-level multi-relational structure (Tao et al., 22 May 2025, Yang et al., 27 Mar 2025). Compared with call graphs or dependency graphs, it adds semantic text, hierarchy, and sometimes artifact or domain links (Tao et al., 22 May 2025, Yang et al., 27 Mar 2025). Compared with code property graphs, it is often lighter-weight and more retrieval-oriented, though some variants such as RepoSPD adopt CPG-like lower-level structure (Wen et al., 2024). Compared with flat vector indexes, it supports multi-hop reasoning, induced subgraph extraction, and path-aware explanation (Usai et al., 15 Jan 2026, Hu et al., 8 May 2026).

Several future directions recur across papers. One is richer dynamic information: runtime traces, logs, telemetry, dynamic call graphs, test coverage overlays, and empirical usage statistics are repeatedly proposed as complements to static edges (Usai et al., 15 Jan 2026, Bevziuk et al., 10 Oct 2025, Zhang et al., 2 Jul 2026). Another is broader schema coverage, especially tests, configuration files, API specifications, CI/CD artifacts, deployment descriptors, and build metadata (Usai et al., 15 Jan 2026, Hu et al., 8 May 2026, Luo et al., 2 Feb 2026). A third is cross-repository and temporal modeling, including commit co-change graphs, version alignment, and longitudinal graph evolution (Usai et al., 15 Jan 2026, Luo et al., 2 Feb 2026, Zhang et al., 2 Jul 2026).

There is also a methodological split between graph-as-retrieval-substrate and graph-as-model-input. LARGER, RepoScope, KGCompass, and LogicLens primarily use the graph to localize or assemble context (Hu et al., 8 May 2026, Liu et al., 20 Jul 2025, Yang et al., 27 Mar 2025, Usai et al., 15 Jan 2026). CGM integrates graph structure directly into the decoder attention mask (Tao et al., 22 May 2025). DUALVIEW externalizes the graph visually as a persistent reasoning artifact for agents (Zhang et al., 2 Jul 2026). RPG-Encoder treats the graph as a bidirectional repository representation that closes the loop between comprehension and generation (Luo et al., 2 Feb 2026). This suggests that RSSG is evolving from a retrieval-only abstraction into a general interface layer between repository state, software analysis, and language-model reasoning.

In that broader sense, RSSG can be understood as a unifying abstraction for repository-aware software intelligence: a graph whose nodes ground code and artifacts, whose edges expose structural and semantic dependency, and whose attributes make those relations searchable, rankable, traversable, and, increasingly, directly consumable by agents and neural models.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Repository Structural Semantic Graph (RSSG).