Repository navigation
feat: agents graph maps how agents, tools, tests and documents connect - #180
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PaulAsjes
force-pushed
the
pma/agents-graph
branch
from
October 27, 2026 17:04
018813e to
764f767
Compare
kraenhansen
approved these changes
Oct 28, 2026
kraenhansen
left a comment
Member
There was a problem hiding this comment.
I find the left to right diagrams a bit harder to read than the top to bottom, but I think that might just be a preference - I assume we could add a --direction option later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agent configs refer to tools, tests, knowledge-base documents and other agents by ID only, so a reviewer can't tell which agents a change to
tool_configs/x.jsonaffects, or who hands off to whom.agents graphfollows those references across every agent and branch inagents.jsonand draws each agent with what it connects to, in the terminal or as Mermaid.--usesanswers the reverse question ("which agents use this tool?") one tab-separated line per reference, for scripts and CI. Local files only, likeagents workflow diagram.Stacked on #179 (it reuses that PR's loading code and Mermaid rendering); retarget to
mainonce #179 merges.Example
elevenlabs agents graph "Acme Concierge"(a mock agent with a 13-node workflow, three handoffs and dashboard-only tools and tests):elevenlabs agents graph --uses lookup_order:elevenlabs agents graph --format mermaidon the test fixture project renders as:flowchart LR n_Agent_agent_billing["Agent · Billing"] n_Agent_agent_support["Agent · Support"] n_Agent_agent_support_agtbrch_beta["Agent · Support (branch 'beta')"] n_Tool_tool_from_dashboard[["Tool (external) · tool_from_dashboard"]] n_Tool_tool_lookup[["Tool · lookup_order"]] n_Tool_tool_refund[["Tool · issue_refund"]] n_Test_test_greets(["Test · Greets the caller"]) n_Document_doc_pricing[("Document · Pricing FAQ")] n_Agent_agent_billing --> n_Tool_tool_refund n_Agent_agent_billing --> n_Document_doc_pricing n_Agent_agent_support ==> n_Agent_agent_billing n_Agent_agent_support --> n_Tool_tool_from_dashboard n_Agent_agent_support --> n_Tool_tool_lookup n_Agent_agent_support --> n_Test_test_greets n_Agent_agent_support --> n_Document_doc_pricing n_Agent_agent_support_agtbrch_beta ==>|"via 'to_billing'"| n_Agent_agent_billing n_Agent_agent_support_agtbrch_beta --> n_Tool_tool_lookup n_Agent_agent_support_agtbrch_beta -->|"via 'refunds'"| n_Tool_tool_refund n_Agent_agent_support_agtbrch_beta --> n_Test_test_greets classDef t_tool fill:#fef3c7,stroke:#d97706,color:#78350f class n_Tool_tool_lookup,n_Tool_tool_refund t_tool classDef t_state fill:#ede9fe,stroke:#7c3aed,color:#4c1d95 class n_Test_test_greets t_state classDef t_subagent fill:#f1f5f9,stroke:#475569,color:#0f172a class n_Agent_agent_billing,n_Agent_agent_support,n_Agent_agent_support_agtbrch_beta t_subagent classDef t_unknown fill:#f3f4f6,stroke:#6b7280,stroke-dasharray:4 2,color:#111827 class n_Tool_tool_from_dashboard t_unknown classDef t_doc fill:#ecfccb,stroke:#65a30d,color:#365314 class n_Document_doc_pricing t_docDetails
prompt.tool_ids, workflow tool nodes andadditional_tool_ids; handoffs in thetransfer_to_agenttool andstandalone_agentnodes (a handoff naming a registered branch points at that branch);platform_settings.testing.attached_tests; knowledge-base documents inprompt.knowledge_baseandadditional_knowledge_base. References inside a workflow node's prompt override count too, and the Mermaid output labels those edges with the node they come from.COLUMNS), long IDs are shortened to their start and end, kept unique within the drawing. If it still doesn't fit, a note on stderr points at--format mermaid.--format mermaid(ormermaid-md, fenced) is the whole project as oneflowchart LR, sorted by ID so it diffs cleanly; handoffs are thick arrows.workflow diagram(IDs, escaping, shapes, colours, mmdflux drawing, terminal width, tangle counting) move fromdiagram.rsintomermaid.rs, with no change todiagramoutput.agents graphtakes the same--format ascii|mermaid|mermaid-mdvalues asworkflow diagram.find_agent, the agents.json entry listing and a config's local name are shared too.--usesin it to comment "this PR changes a tool used by agents X and Y".Testing
cargo test: all suites pass, including 13 unit tests ingraph.rs(each reference path, branch handoffs, external IDs, merged edges,--usesby ID and name, order independence, ID shortening) and 8 integration tests intests/agents_graph_test.rsagainst a fixture project, with no API key. The terminal test fails if any drawing has a crossing or merging line.--format mermaidoutput for the fixture and mock projects: both parse.cargo clippy --all-targets: no new warnings.🤖 Generated with Claude Code