Prompt-level optimization for LangGraph applications without changing graph structure
/plugin marketplace add hiroshi75/langgraph-architect/plugin install langgraph-architect@langgraph-architectOptimize prompts and parameters in your LangGraph application to improve accuracy, reduce costs, and enhance performance—without modifying the graph structure.
Optimize your LangGraph application according to the following objectives:
$ARGUMENTS
Unlike arch-tune which modifies graph structure, fine-tune focuses on:
At the start of the fine-tune command, use the TodoWrite tool to register all Phases as tasks.
Update each Phase to in_progress at the start and completed upon completion.
Purpose: Understand optimization targets and current state
Execution Steps:
Load Objective Settings
.langgraph-architect/fine-tune.mdIdentify Optimization Targets
find_symbol to locate LLM clients (ChatOpenAI, ChatAnthropic, etc.)find_referencing_symbols to identify prompt construction locationsCreate Target List
Output:
Purpose: Quantitatively measure current performance
Execution Steps:
Prepare Evaluation Environment
.langgraph-architect/evaluation/Baseline Measurement
Analyze Results
Output:
baseline_results.json - Detailed baseline metricsPurpose: Data-driven incremental optimization
Execution Steps:
Prioritize Improvements
Implement Optimization
Apply techniques based on the issue:
| Issue | Technique | Expected Gain |
|---|---|---|
| Low accuracy | Few-shot examples | +10-20% accuracy |
| Inconsistent output | Structured output format | -90% parse error |
| High cost | Model downgrade, prompt cache | -40-60% cost |
| Slow response | Streaming, parallel processing | -30-50% latency |
| Poor edge case | Chain-of-thought prompting | +15-25% accuracy |
Post-Improvement Evaluation
Decide Continuation
Output:
Purpose: Record achievements and finalize
Execution Steps:
Create Final Report
## Fine-Tune Results
### Summary
| Metric | Baseline | Final | Improvement |
| -------- | -------- | ------- | ----------- |
| Accuracy | X% | Y% | +Z% |
| Cost | $X/1000 | $Y/1000 | -Z% |
| Latency | Xms | Yms | -Z% |
### Changes Made
1. Node X: Added few-shot examples (+15% accuracy)
2. Node Y: Switched to structured output (-80% parse errors)
### Recommendations
- Further improvements possible with...
Git Commit
Output:
fine_tune_report.md - Complete optimization reportIf fine-tune cannot achieve goals after 3-5 iterations, consider:
/arch-tune to explore structural changes# Improve accuracy
/fine-tune "Improve classification accuracy to 95%"
# Reduce costs
/fine-tune "Reduce API costs by 40%"
# Multiple goals
/fine-tune "Improve accuracy to 90% while reducing latency by 30%"
User: /fine-tune "Improve response quality"
Claude:
1. [Phase 1] Analyzing codebase... Found 3 LLM-calling nodes
2. [Phase 2] Running baseline... Accuracy: 72%, Latency: 1.2s
3. [Phase 3] Optimizing node 'generate_response'...
- Added few-shot examples → Accuracy: 85% (+13%)
- Added structured output → Parse errors: 0 (-100%)
4. [Phase 4] Final results: Accuracy 85%, Latency 1.1s
Committed changes with report.