LightRAG icon indicating copy to clipboard operation
LightRAG copied to clipboard

[Question]: How to visualise the Knowledge Graph?

Open leonardoaraujosantos opened this issue 6 months ago • 1 comments

Do you need to ask a question?

  • [x] I have searched the existing question and discussions and this question is not already answered.
  • [x] I believe this is a legitimate question, not just a bug or feature request.

Your Question

There is any way to export the knowledge graph to a JSON file ? Or maybe any format which I can later visualise ?

Additional Context

No response

leonardoaraujosantos avatar May 27 '25 16:05 leonardoaraujosantos

What knowledge graph type are you talking about? NetworkXStorage? If that is the case you probably mean that you have a graphml file and you want to visualize it.

The way I usually do this is https://gephi.org/ download this gephi app and import the file here. Then at the bottom you can turn on the labels and on the left you can color the entities to their types.

This won't look clean at all haha, but it is at least a way to visualize it if you don't want to use the WebUI of LightRAG.

frederikhendrix avatar May 28 '25 20:05 frederikhendrix

If you're using the default NetworkXStorage, you can refer to the example provided in the official repository here:

🔗 graph_visual_with_html.py

You simply need to load the generated .graphml file, and the script will handle the rest for visualization.

Ja1aia avatar Jun 03 '25 09:06 Ja1aia

Export functions are listed here. Also the light-rag server found here has a json export function on the API tab which works well and is super easy to use.

But I will admit that I am a bit confused by the question because the lightrag-server works so well to visualize the KG.

johnshearing avatar Jun 04 '25 16:06 johnshearing