# Smart Routing for Sustainable Supply Chain Networks: An AI and Knowledge Graph Driven Approach
## 3 Methodology
### Prototype Architecture: Modular Agent-Based Design
This information is embedded into a prompt template aimed at guiding the LLM. The prompt imposes strict constraints to ensure the output reflects realistic cargo transport patterns. Only four transport modes are permitted: road, rail, sea, and air. Intermediate hubs are limited to logistics-relevant entities such as seaports, cargo airports, freight rail terminals, or truck terminals. The prompt explicitly forbids the use of passenger routes or abstract location types. The exact wording  
Figure 1: IAES technical application architecture: a schematic representation of the modular workflow, illustrating the execution of main tasks, agent interactions, integration with external data sources, and the Neo4j knowledge graph. The figure highlights the orchestrator logic, enrichment cycle, and the flow of information from raw company data to an actionable supply chain value. and structure of the prompt used is provided in Appendix A.1. The LLM answer shown as an example in Figure 2 is parsed into a sequence of steps, where each step contains a source node, a destination waypoint, and the intended mode of transport. These steps serve as a blueprint for downstream agents to fulfill the route. It is important to note that the RoutePlannerAgent does not verify the existence of the waypoints in the KG. This is the task of the SourceSearcherAgent, which will match, create, or enrich these entities. Its primary function is to search, match, or suggest waypoints using a combination of LLM-based suggestions, geospatial filtering, and graph-matching techniques. Upon receiving a list of route segments, the agent processes them step by step. For each intermediate waypoint, it constructs a query prompt (see Appendix A.2), asking it to return  
Figure 2: An example output generated by the RoutePlannerAgent for a requested route from supplier S25 to plant P2320. \begin{table}
\begin{tabular}{p{56.9 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Agent/Modules** & **Task** & **Role** & **Core Methode** & **Parameters/API** \\ \hline Coordinator Agent & \multirow{3}{*}{COORDINATE} & Manages the overall workflow in sequential phases & State machine logic & \\ \hline GraphScanner Agent & \multirow{3}{*}{ANALYZE} & Identifies graph properties, missing and incomplete routes & Cypher queries, graph traversal & \\ \hline RoutePlanner Agent & \multirow{3}{*}{ENRICH} & Suggests plausible multimodal cargo routes & LLM (GPT-4), custom prompt & Temperature = 0.3 \\ \hline SourceSearcher Agent & \multirow{3}{*}{ENRICH} & Geocodes planner output, resolves or creates waypoints & LLM (GPT-4), distance, and fuzzy name matching & Temperature = 0.1 Radius = 2 km Name similarity \(\geq\) 0.8 \\ \hline RouteEvaluator Agent & \multirow{3}{*}{ENRICH} & Quantifies route segments & \multirow{3}{*}{Mode-specific toolbox} & OSR, static methods \\ \cline{3-4} \cline{5-5} Neo4 jBuilder Agent & \multirow{3}{*}{STORE} & Writes or updates nodes and routes into Neo4j & Cypher queries & \\ \cline{3-4} \cline{5-5} Cleanup Agent & \multirow{3}{*}{STORE} & \multirow{3}{*}{Removes incomplete data} & Rule-based validation & \\ \cline{3-4} \cline{5-5} Selector & \multirow{3}{*}{SELECT} & Selects optimal routes for defined criteria & Dijkstra (Neo4j) & Custom weights, mode preferences, and country filters \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The main agents and modules of the IAES architecture, their assigned tasks, core methods, and key parameters. The table provides an overview of the primary software agents and modules implemented in the IAES, mapping each to its corresponding functional task, role in the workflow, and central methodological features. a single realistic and valid logistics hub, such as seaports, freight airports, train hubs, or truck terminals located in the target region and suited to the specified transport mode. The prompt restricts the response to a JSON structure that must include specific fields such as the name, latitude, longitude, type, and country code (see the example in Figure 3).