Skip to content

Conversation

@matheu-s
Copy link

Changes introduced:

Adds visualize_graph.py, that generates an HTML visualization of the knowledge graph (graph_chunk_entity_relation.graphml):

Screenshot 2025-03-20 at 23 03 57

These changes are important, as they help the user to identify problems with unconnected nodes and easily debug the processed knowledge graph.

  • It adds the weights on the edge label of connected nodes.
  • All nodes have a tooltip with category, description and chunk source.
Screenshot 2025-03-20 at 23 17 29

How to test:

  1. Process a sample.txt or add a ready graph_chunk_entity_relation.graphml file.
  2. Run visualize_graph.py.
  3. Open knowledge_graph.html.

Obs: If preferred, the functionality could be implemented to automatically generate the visualization HTML, it if executes after graph creation:

PathRAG/PathRAG/storage.py

Lines 259 to 260 in 2785a12

NetworkXStorage.write_nx_graph(self._graph, self._graphml_xml_file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant