SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2025.findings-emnlp.290 · EMNLP Findings · 2025

ReGraphRAG: Reorganizing Fragmented Knowledge Graphs for Multi-Perspective Retrieval-Augmented Generation

Yong Choi, Soohyeong Kim, Seok Hwang, Junghyoun Kim, Jeonghyeon Park

Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2025.findings-emnlp.290.json · badge: /api/ran/2025.findings-emnlp.290.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ToBeSuperior/ReGraphRAG canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_mdhash_id Ran
ran; our contract draft was wrong, not the code
ToBeSuperior/ReGraphRAG/regraph/utils.py
code served (permissive licence) · get_code("43ca51a2b239d45d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from hashlib import md5

# The function compute_mdhash_id takes:
# - content: a string that will be encoded and hashed
# - prefix: a string prefix to prepend to the hash (default '')

# Read the function body:
# - content.encode() is called, so content must be a string
# - prefix is concatenated with the hash result, so it must be a string

ARGS = {
    'content': 'hello world',
    'prefix': 'test_'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
convert_response_to_json Ran
ran; our contract draft was wrong, not the code
ToBeSuperior/ReGraphRAG/regraph/utils.py
code served (permissive licence) · get_code("5bd1327a0a1c46aa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import logging
import re
from typing import Any, Union, List, Optional

logger = logging.getLogger('lightrag')

def locate_json_string_body_from_string(content: str) -> Union[str, None]:
    """Locate the JSON string body from a string"""
    try:
        maybe_json_str = re.search('{.*}', content, re.DOTALL)
        if maybe_json_str is not None:
            maybe_json_str = maybe_json_str.group(0)
            maybe_json_str = maybe_json_str.replace('\\n', '')
            maybe_json_str = maybe_json_str.replace('\n', '')
            maybe_json_str = maybe_json_str.replace("'", '"')
            return maybe_json_str
    except Exception:
        pass
        return None

def convert_response_to_json(response: str) -> dict[str, Any]:
    json_str = locate_json_string_body_from_string(response)
    assert json_str is not None, f'Unable to parse JSON from response: {response}'
    try:
        data = json.loads(json_str)
        return data
    except json.JSONDecodeError as e:
        logger.error(f'Failed to parse JSON: {json_str}')
        raise e from None


# Setup code to construct valid arguments
ARGS = {
    "response": '{"name": "test", "value": 42, "nested": {"key": "data"}}'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_namespace Ran
ran, violated the contract we drafted
ToBeSuperior/ReGraphRAG/regraph/namespace.py
code served (permissive licence) · get_code("cad2192dedaa609f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from typing import Iterable

def is_namespace(namespace: str, base_namespace: str | Iterable[str]):
    if isinstance(base_namespace, str):
        return namespace.endswith(base_namespace)
    return any((is_namespace(namespace, ns) for ns in base_namespace))

# Test case 1: namespace is a string, base_namespace is a string
namespace_1 = "model.layer.weight"
base_namespace_1 = "weight"

# Test case 2: namespace is a string, base_namespace is an iterable of strings
namespace_2 = "model.layer.bias"
base_namespace_2 = ["weight", "bias", "norm"]

ARGS = {
    "namespace": namespace_1,
    "base_namespace": base_namespace_1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
lazy_external_import Ran
ran; our contract draft was wrong, not the code
ToBeSuperior/ReGraphRAG/regraph/lightrag.py
code served (permissive licence) · get_code("c5d52c7f50d771d0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import inspect

torch.manual_seed(0)

# The function lazy_external_import takes:
# - module_name: str - the name of a module to import from
# - class_name: str - the name of a class within that module

# The function uses these parameters to:
# 1. Get the caller's frame and module
# 2. Extract the package from the caller's module
# 3. Return a function that lazily imports the specified class from module_name
#    using the caller's package as context

# For testing, we need valid module and class names that exist
# We'll use standard library modules that are guaranteed to exist

ARGS = {
    "module_name": "collections",
    "class_name": "OrderedDict"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
locate_json_string_body_from_string Ran
ran; our contract draft was wrong, not the code
ToBeSuperior/ReGraphRAG/regraph/utils.py
code served (permissive licence) · get_code("80c44d13f9ca5b14")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
from typing import Any, Union, List, Optional

def locate_json_string_body_from_string(content: str) -> Union[str, None]:
    """Locate the JSON string body from a string"""
    try:
        maybe_json_str = re.search('{.*}', content, re.DOTALL)
        if maybe_json_str is not None:
            maybe_json_str = maybe_json_str.group(0)
            maybe_json_str = maybe_json_str.replace('\\n', '')
            maybe_json_str = maybe_json_str.replace('\n', '')
            maybe_json_str = maybe_json_str.replace("'", '"')
            return maybe_json_str
    except Exception:
        pass
        return None


# Setup: The function takes a single parameter 'content' which is a string.
# It searches for JSON-like content (anything between curly braces) and cleans it up.
# We need to provide a test string that contains JSON.

ARGS = {
    "content": "Here is some text before the JSON: {'key': 'value', 'nested': {'data': 123}} and some text after"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_namespace Ran
ran; our contract draft was wrong, not the code
ToBeSuperior/ReGraphRAG/regraph/namespace.py
code served (permissive licence) · get_code("06b039948070c887")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "prefix": "app_",
    "base_namespace": "config.settings"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
chunking_by_token_size Not yet run
unverified (harvested, no recorded run)
ToBeSuperior/ReGraphRAG/regraph/operate.py
code served (permissive licence) · get_code("09a6c78ea06fb3a9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
lazy_external_import 4 other papers
4 same year, order not determinable
2501.06713 (2025-01)
MiniRAG: Towards Extremely Simple Retrieval-Augmented Generation
2502.14902 (2025-02)
PathRAG: Pruning Graph-based Retrieval Augmented Generation with Relational Paths
2503.21322 (2025-03)
HyperGraphRAG: Retrieval-Augmented Generation via Hypergraph-Structured Knowledge Representation
and 1 more not named here
is_namespace 2 other papers
1 dated earlier, 1 later
2410.05779 (2024-10)
LightRAG: Simple and Fast Retrieval-Augmented Generation
2602.20459 (2026-02)
PRESCIENCE: A Dataset and Benchmark for Scientific Forecasting

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recent advancements in Retrieval-Augmented Generation (RAG) have improved large language models (LLMs) by incorporating external knowledge at inference time. Graph-based RAG systems have emerged as promising approaches, enabling multi-hop reasoning by organizing retrieved information into structured graphs. However, when knowledge graphs are constructed from unstructured documents using LLMs, they often suffer from fragmentation-resulting in disconnected subgraphs that limit inferential coherence and undermine the advantages of graph-based retrieval. To address these limitations, we propose ReGraphRAG, a novel framework designed to reconstruct and enrich fragmented knowledge graphs through three core components: Graph Reorganization, Perspective Expansion, and Query-aware Reranking. Experiments on four benchmarks show that ReGraphRAG outperforms state-ofthe-art baselines, achieving over 80% average diversity win rate. Ablation studies highlight the key contributions of graph reorganization and especially perspective expansion to performance gains. Our code is available at: https://github.com/ToBeSuperior/ReGraphRAG * Corresponding author * The prompt used for entity and relation extraction is detailed in Appendix A.1

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2025.findings-emnlp.290")
get_code_for_paper("2025.findings-emnlp.290")
have("2025.findings-emnlp.290")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2025.findings-emnlp.290.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2025.findings-emnlp.290.svg)](https://syntology.ai/paper/2025.findings-emnlp.290)

Connect an agent — have() is free.