Refactor GraphRAG into standalone tool

This commit is contained in:
Ján Pták 2026-10-11 00:21:47 +02:00
parent f38ebf65f7
commit 043db73ee6
12 changed files with 8 additions and 7 deletions

View File

@ -26,6 +26,7 @@ RUN python -m pip install --no-cache-dir \
COPY app ./app
COPY scripts ./scripts
COPY tools ./tools
RUN mkdir -p data

0
tools/__init__.py Normal file
View File

View File

View File

@ -5,11 +5,11 @@ import json
from pathlib import Path
from typing import Any
from scripts.graph_db import (
from .graph_db import (
create_neo4j_driver,
get_neo4j_settings,
)
from scripts.graphrag import (
from .graphrag import (
GRAPH_SCOPE,
build_graph_payload,
)
@ -17,7 +17,7 @@ from scripts.graphrag import (
PROJECT_ROOT = Path(
__file__
).resolve().parents[1]
).resolve().parents[2]
DOCUMENTS_FILE = (
PROJECT_ROOT

View File

@ -1283,7 +1283,7 @@ def search_graph(
limit: int = DEFAULT_LIMIT,
max_entities: int = DEFAULT_MAX_ENTITIES,
) -> dict[str, Any]:
from scripts.graph_db import (
from .graph_db import (
create_neo4j_driver,
get_neo4j_settings,
)

View File

@ -1,4 +1,4 @@
from scripts.graph_db import verify_neo4j_connection
from .graph_db import verify_neo4j_connection
def main() -> None:

View File

View File

@ -4,7 +4,7 @@ from typing import Any
import pytest
import scripts.graph_search as graph_search
import tools.graphrag.graph_search as graph_search
class FakeSession:

View File

@ -1,6 +1,6 @@
from __future__ import annotations
from scripts.graphrag import (
from tools.graphrag.graphrag import (
build_graph_payload,
extract_explicit_proposal_title,
extract_works,