# Smart Routing for Sustainable Supply Chain Networks: An AI and Knowledge Graph Driven Approach
## 3 Methodology
### Prototype Architecture: Modular Agent-Based Design  
The architecture of the IAES is implemented as a Python-based pipeline of cooperating agents backed by the Neo4j GDB for storing the network data. It is designed to fulfill the following main tasks: Get, Analyze, Coordinate, Enrich, Store, Select, and Use, as mentioned in Section 3.1. The combination of tasks, process flows, and executing modules is illustrated in Figure 1.  
In the first step, the Importer (GET) imports raw data from external sources such as enterprise ERP, MES, and systems, and maps them into a Neo4j property graph. At the same time, a list of required transport connections (NeededRoutes) is extracted and handed to the Coordinator, which triggers the route planning and enrichment cycle as part of the Orchestrator. In the IAES architecture, the term Orchestrator refers to the overall control structure that governs the interaction between all agents for executing the ANALYZE, ENRICH, STORE, and COORDINATE tasks. This orchestration is technically realized through the central Coordinator agent, which sequentially invokes specialized sub-agents (GraphScanner, RoutePlanner, SourceSearcher, RouteEvaluator, Neo4 jBuilder, and Cleanup), while also managing data and task exchanges between them. The Coordinator thus acts as the execution core of the Orchestrator logic, supported by additional Python modules listed in Table 3.  
The GraphScannerAgent serves as the analytical entry point in the orchestrator pipeline. It systematically inspects the state of the supply chain KG to identify structural gaps and outdated data. The agent utilizes Cypher queries to extract all nodes by label (e.g., Plant, Customer, Waypoint) and all route relationships, including metadata. To detect missing routes, it compares the set of required node pairs (in the present case, imported from an Excel file named \"NeededRoutes.xlsx\") with the actual relationships in the graph. The agent searches for both direct paths and indirect paths, using the integrated breadth-first search traversal algorithm provided by Neo4j. Outdated routes are identified by evaluating the last update date property of each route against a user-defined threshold. Incomplete routes are detected by checking the respective property (availability = 1). All of these steps are modularly implemented, leveraging efficient batch operations and optimized Cypher queries to ensure high performance, even for large graphs. At the end of each scan, the agent compiles a structured and aggregated report. The result of the scans is then passed back to the CoordinatorAgent, which uses it to trigger the other connected agents, as illustrated in Figure 1. \begin{table}
\begin{tabular}{c c} \hline
**Tasks** & **Functionality** \\ \hline \multirow{4}{*}{Enrich} & Employs LLM agents and external APIs (e.g., \\  & OpenRouteService ORS, geolocation) to infer and propose new waypoints, create routes, enrich the new entities with information, and evaluate plausibility \\ \hline \multirow{2}{*}{Store} & Integrating enriched data back into the KG model for \\  & future access and optimization \\ \hline \multirow{2}{*}{Select} & Performing route selection, benchmarking, and \\  & optimization using [PERSON]’s algorithm from the graph \\  & data science library \\ \hline \multirow{2}{*}{Use} & Enables downstream applications such as LCA calculation, \\  & dashboarding, and strategic planning. \\ \hline \end{tabular}
\end{table} 
Table 2: _Cont._The RoutePlannerAgent serves as the conceptual engine of the Orchestrator pipeline. Its function is to generate (suggest) plausible and logistically multimodal transport routes between two nodes, which are requested through the GraphScanner scan report. The agent leverages an LLM-specific GPT-4 from OpenAI to synthesize feasible transport chains composed of one or more intermediate segments. To initiate a route plan, the agent receives a pair of node identifiers corresponding to the start and end locations with the associated information.