diff --git a/lightrag_webui/src/hooks/useLightragGraph.tsx b/lightrag_webui/src/hooks/useLightragGraph.tsx index d7322413..b7477e97 100644 --- a/lightrag_webui/src/hooks/useLightragGraph.tsx +++ b/lightrag_webui/src/hooks/useLightragGraph.tsx @@ -578,6 +578,9 @@ const useLightrangeGraph = () => { if (sigmaGraph.hasEdge(newEdge.source, newEdge.target)) { continue; } + if (sigmaGraph.hasEdge(newEdge.target, newEdge.source)) { + continue; + } // Add the edge to the sigma graph newEdge.dynamicId = sigmaGraph.addDirectedEdge(newEdge.source, newEdge.target, {