Architecture-level tuning through parallel exploration of multiple graph structure changes
/plugin marketplace add hiroshi75/langgraph-architect/plugin install langgraph-architect@langgraph-architectBoldly modify the graph structure of LangGraph applications to improve performance. Explore multiple improvement proposals in parallel to identify the optimal configuration.
Optimize graph structure according to the following objectives:
$ARGUMENTS
While the fine-tune skill focuses on prompt and parameter optimization, the arch-tune command modifies the graph structure itself:
At the start of the arch-tune command, use the TodoWrite tool to register all Phases from the following sections as tasks. (It's recommended to include a reference to this file to avoid forgetting its contents.)
Update each Phase to in_progress at the start and completed upon completion.
Execution Steps:
arch-analysis skill
.langgraph-architect/evaluation/)Output:
analysis/baseline_performance.json - Baseline performance (including statistics)analysis/analysis_report.md - Current state analysis and issuesanalysis/improvement_proposals.md - Detailed improvement proposals (Proposal 1-5).langgraph-architect/evaluation/ - Evaluation program (created or verified)ā See arch-analysis skill for detailed procedures and workflow
Purpose: Implement graph structure for each improvement proposal
Execution Steps:
Create and Prepare Git Worktrees
Create independent working environments for each improvement proposal:
# Create worktree for each Proposal 1, 2, 3
git worktree add worktree/proposal-1 -b proposal-1
git worktree add worktree/proposal-2 -b proposal-2
git worktree add worktree/proposal-3 -b proposal-3
# Copy analysis results and .env to each worktree
for dir in worktree/*/; do
cp -r analysis "$dir"
cp .env "$dir"
done
# If evaluation program is in original directory, make it executable in each worktree
# (No copy needed if using shared .langgraph-architect/evaluation/)
Directory Structure:
project/
āāā worktree/
ā āāā proposal-1/ # Independent working environment 1
ā ā āāā analysis/ # Analysis results (copy **Copy as files after creating worktree, don't commit and pass!**)
ā ā ā āāā baseline_performance.json
ā ā ā āāā analysis_report.md
ā ā ā āāā improvement_proposals.md
ā ā āāā [project files]
ā āāā proposal-2/ # Independent working environment 2
ā āāā proposal-3/ # Independent working environment 3
āāā analysis/ # Analysis results (original)
āāā [original project files]
Parallel Implementation by langgraph-engineer
Launch langgraph-engineer agent for each Proposal:
Working worktree: worktree/proposal-X/
Improvement proposal: Proposal X (from analysis/improvement_proposals.md)
Task: Implement graph structure changes and test that it works correctly (add/modify nodes, edges, subgraphs)
Complete implementation as langgraph-engineer.
See agents/langgraph-engineer.md for details.
Parallel Execution Pattern:
Wait for All Implementations to Complete
Purpose: Optimize prompts and parameters for implemented graphs
Execution Steps:
Parallel Optimization by langgraph-tuner
After Phase 2 completion, launch langgraph-tuner agent for each worktree Proposal implementation:
Working worktree: worktree/proposal-X/
Improvement proposal: Proposal X (from analysis/improvement_proposals.md)
Optimization goal: [User-specified goal]
Note: Graph structure changes are completed in Phase 2. Skip Phase 2 and start from Phase 3 (testing).
Result report:
- Filename: `proposal_X_result.md` (save directly under worktree/proposal-X/)
- Format: Summarize experiment results and insights concisely
- Required items: Comparison table with baseline, improvement rate, key changes, recommendations
Execute optimization workflow as langgraph-tuner.
See agents/langgraph-tuner.md for details.
Parallel Execution Pattern:
Wait for All Optimizations to Complete
Important:
Purpose: Identify the best improvement proposal
Execution Steps:
Launch proposal-comparator agent:
Implementation reports: Read `proposal_X_result.md` from each worktree
- worktree/proposal-1/proposal_1_result.md
- worktree/proposal-2/proposal_2_result.md
- worktree/proposal-3/proposal_3_result.md
Optimization goal: [User-specified goal]
Execute comparative analysis as proposal-comparator.
See agents/proposal-comparator.md for details.
Purpose: Merge with user approval
Execution Steps:
Launch merge-coordinator agent:
Comparison report: analysis/comparison_report.md
Worktree: worktree/proposal-\*/
Execute user approval and merge as merge-coordinator.
See agents/merge-coordinator.md for details.
Create:
git worktree add worktree/<branch-name> -b <branch-name>
List:
git worktree list
Remove:
git worktree remove worktree/<branch-name>
git branch -d <branch-name>
Claude Code automatically executes in parallel by calling multiple Task tools in a single message.
worktree/ to .gitignoreEvaluation Program Location:
.langgraph-architect/evaluation/ (accessible from all worktrees)analysis/Unified Evaluation Conditions:
Evaluation Execution:
worktree/ directory# Execute arch-tune command
/arch-tune "Improve Latency to under 2.0s and Accuracy to over 90%"
Execution Flow:
Phase 1: arch-analysis skill generates 3-5 improvement proposals
Phase 2: Graph Structure Implementation
Phase 3: Prompt and Parameter Optimization
proposal_X_result.md)Phase 4: Compare results and identify best proposal
Phase 5: Merge after user approval
Example: See arch-analysis skill improvement_proposals section for detailed proposal examples for customer support chatbot optimization.