7.5 KiB
name, description
| name | description |
|---|---|
| langgraph-master | Use when specifying or implementing LangGraph applications - from architecture planning and specification writing to actual code implementation. Also use for designing agent workflows or learning LangGraph patterns. This is a comprehensive guide for building AI agents with LangGraph, covering core concepts, architecture patterns, memory management, tool integration, and advanced features. |
LangGraph Agent Construction Skill
A comprehensive guide for building AI agents using LangGraph.
📚 Learning Content
01. Core Concepts
Understanding the three core elements of LangGraph
02. Graph Architecture
Six major graph patterns and agent design
- Workflow vs Agent Differences
- Prompt Chaining (Sequential Processing)
- Parallelization
- Routing (Branching)
- Orchestrator-Worker
- Evaluator-Optimizer
- Agent (Autonomous Tool Usage)
- Subgraph
03. Memory Management
Persistence and checkpoint functionality
04. Tool Integration
External tool integration and execution control
05. Advanced Features
Advanced functionality and implementation patterns
06. LLM Model IDs
Model ID reference for major LLM providers. Always refer to this document when selecting model IDs. Do not use models not listed in this document.
- Google Gemini model list
- Anthropic Claude model list
- OpenAI GPT model list
- Usage examples and best practices with LangGraph
Implementation Examples
Practical agent implementation examples
📖 How to Use
Each section can be read independently, but reading them in order is recommended:
- First understand LangGraph fundamentals in "Core Concepts"
- Learn design patterns in "Graph Architecture"
- Grasp implementation details in "Memory Management" and "Tool Integration"
- Master advanced features in "Advanced Features"
- Check practical usage in "Implementation Examples"
Each file is kept short and concise, allowing you to reference only the sections you need.
🤖 Efficient Implementation: Utilizing Subagents
To accelerate LangGraph application development, utilize the dedicated subagent langgraph-master-plugin:langgraph-engineer.
Subagent Characteristics
langgraph-master-plugin:langgraph-engineer is an agent specialized in implementing functional modules:
- Functional Unit Scope: Implements complete functionality with multiple nodes, edges, and state definitions as a set
- Parallel Execution Optimization: Designed for multiple agents to develop different functional modules simultaneously
- Skill-Driven: Always references the langgraph-master skill before implementation
- Complete Implementation: Generates fully functional modules (no TODOs or placeholders)
- Appropriate Size: Functional units of about 2-5 nodes (subgraphs, workflow patterns, tool integrations, etc.)
When to Use
Use langgraph-master-plugin:langgraph-engineer in the following cases:
-
When functional module implementation is needed
- Decompose the application into functional units
- Efficiently develop each function through parallel execution
-
Subgraph and pattern implementation
- RAG search functionality (retrieve → rerank → generate)
- Human-in-the-Loop approval flow (propose → wait_approval → execute)
- Intent analysis functionality (analyze → classify → route)
-
Tool integration and memory setup
- Complete tool integration module (definition → execution → processing → error handling)
- Memory management module (checkpoint setup → persistence → restoration)
Practical Example
Task: Build a chatbot with intent analysis and RAG search
Parallel Execution Pattern:
Planner → Decompose into functional units
├─ langgraph-master-plugin:langgraph-engineer 1: Intent analysis module (parallel)
│ └─ analyze + classify + route nodes + conditional edges
└─ langgraph-master-plugin:langgraph-engineer 2: RAG search module (parallel)
└─ retrieve + rerank + generate nodes + state management
Orchestrator → Integrate modules to assemble graph
Usage Method
-
Decompose into functional modules
- Decompose large LangGraph applications into functional units
- Verify that each module can be implemented and tested independently
- Verify that module size is appropriate (about 2-5 nodes)
-
Implement common parts first
- State used across the entire graph
- Common tool definitions and common nodes used throughout
-
Parallel Execution
Assign one functional module implementation to each langgraph-master-plugin:langgraph-engineer agent and execute in parallel
- Implement independent functional modules simultaneously
-
Integration
- Incorporate completed modules into the graph
- Verify operation through integration testing
Testing Method
- Perform unit testing for each functional module
- Verify overall operation after integration. In many cases, there's an API key in .env, so load it and run at least one successful test case
- If the successful case doesn't work well, code review is important, but roughly pinpoint the location, add appropriate logs to identify the cause, think carefully, and then fix.
Functional Module Examples
Appropriate Size (langgraph-master-plugin:langgraph-engineer scope):
- RAG search functionality: retrieve + rerank + generate (3 nodes)
- Intent analysis: analyze + classify + route (2-3 nodes)
- Approval workflow: propose + wait_approval + execute (3 nodes)
- Tool integration: tool_call + execute + process + error_handling (3-4 nodes)
Too Small (individual implementation is sufficient):
- Single node only
- Single edge only
- State field definition only
Too Large (further decomposition needed):
- Complete chatbot application
- Entire system containing multiple independent functions
Notes
- Appropriate Scope Setting: Verify that each task is limited to one functional module
- Functional Independence: Minimize dependencies between modules
- Interface Design: Clearly document state contracts between modules
- Integration Plan: Plan the integration method after module implementation in advance