agentic-radar icon indicating copy to clipboard operation
agentic-radar copied to clipboard

[Feature] Export Graph JSON

Open DJurincic opened this issue 9 months ago • 1 comments

Is there an existing issue for the same feature request?

  • [x] I have checked the existing issues.

Describe the feature request

Add an option to export the standardized JSON configuration of the graph from which the visualization is made.

Do you have any ideas for the technical implementation?

This should result in an additional optional CLI argument that supports the export of the graph JSON.

DJurincic avatar Mar 20 '25 07:03 DJurincic

This feature is already implemented! 🎉

You can export graph JSON using the existing --export-graph-json flag:

# Export graph as JSON
agentic-radar scan langgraph --export-graph-json -o graph.json -i /path/to/code

# Works with any framework
agentic-radar scan crewai --export-graph-json -o workflow.json -i ./my-project

Features included:

  • Automatic file extension conversion (.html.json)
  • Pretty-printed JSON output with proper indentation
  • Environment variable support (AGENTIC_RADAR_EXPORT_GRAPH_JSON=true)
  • Full GraphDefinition export with nodes, edges, agents, and tools

The implementation has been available since the codebase was structured with Pydantic models. The JSON export uses GraphDefinition.model_dump_json(indent=2) to ensure clean, readable output.

Example output structure:

{
  "name": "workflow_name",
  "nodes": [...],
  "edges": [...],
  "agents": [...],
  "tools": [...]
}

This issue can be closed as completed. Consider updating the README to document this feature for better discoverability.

michaeloboyle avatar Sep 05 '25 18:09 michaeloboyle