Repository navigation
Feature Request: Visualize Agent Planning Graph for Better Readability and Maintainability #1913
Replies: 4 comments 1 reply
|
@anton-zom-ra, @johnsonr - thank you. Anton, good idea. I would rather frame it as a discussion than an issue. Discussions will go through the planning phase. |
yes,that's ok, please |
|
@anton-zom-ra - converted into a discussion as agreed. |
|
Picking up on the runtime view: here's a mockup of what the current plan and execution trace could look like, built only with open-source libraries (Cytoscape.js + dagre, both MIT). Live mockup: https://claude.ai/artifact/DFsj3szxVuzqAtm5PBvdUr It's a sample trace of a StarNewsFinder-style agent and isn't connected to Embabel yet. It shows:
There are better commercial graph tools, such as Cambridge Intelligence's KeyLines and ReGraph, but open source gets us most of the way. For a real implementation I'd lean towards React Flow (xyflow, MIT) with elkjs for layout. The bigger piece is on Embabel's side: the planning-graph export Anton proposes (actions, pre/post conditions, types, goals), plus the plan and process events Embabel already emits. With those in place, this viewer, an IDE plugin, or a Mermaid/DOT export each becomes a thin adapter. |
Uh oh!
There was an error while loading. Please reload this page.
Feature Request: Visualize Agent Planning Graph for Better Readability and Maintainability
Problem
Embabel's GOAP/planning model is powerful, but as an agent grows, it becomes difficult for someone who did not originally write the code to understand the overall behavior of the agent.
A significant part of the control flow is implicit and distributed across:
@Actioninput/output typesprepost@ConditionFor example:
The relationship is conceptually simple:
However, this relationship is not obvious from any single place in the source code.
The
@Conditionmay be defined in one class, referenced as apostcondition by another action, and consumed as aprecondition by another action elsewhere.The same issue also exists for dependencies inferred from Java method parameters and return types.
As a result, Embabel provides good local readability at the individual Action level, but the global readability of an Agent can become difficult as complexity increases.
Why this matters
For the original author, the implicit planning model is usually understandable because they already know the intended graph.
For other developers, however, understanding an Agent may require:
@Actionmethods@Conditionmethodspre/postreferenceThis becomes particularly difficult during:
Proposal
It would be very useful if Embabel could expose a static Agent Planning Graph derived from the registered Agent metadata.
For example:
Ideally the graph could include:
Possible Outputs
Even a simple machine-readable or text-based representation would be useful.
For example:
Mermaid
Graphviz DOT
Possible APIs could be something similar to:
or
or an actuator/dev endpoint such as:
A UI would be great, but even exporting the underlying graph model would allow IDE plugins and external visualization tools to be built.
Runtime View
A second, complementary feature could visualize the current plan during execution.
For example:
This would be different from the static Agent graph:
Embabel already has strong concepts around planning and replanning, so exposing these three views could significantly improve observability and developer experience.
Summary
The planning abstraction is one of Embabel's strengths, but it also moves control flow away from explicit Java code.
As Agents become larger, I think having a first-class way to inspect or visualize the resulting planning graph would make Embabel significantly easier to:
Would a planning graph/introspection API be something that fits the project's roadmap?
All reactions