整理了一个 LangGraphJS Hybird 工作流设计的提示词
- 快速生成一个初始的工作流,激发工作流创意
- 调整并基于初始工作流,可生成流程图、工作流代码等
- 推荐使用 Claude 3.7 / Gemini 2.5 Pro / GPT o4/o3 等推理模型
- 图文示例是:Gemini 2.5 Pro 生成的 “ai 视频落地页”工作流
分享目的:主要是为了抛砖引玉
提示词如下:
# Hybrid Workflow Design Expert Prompt
I need you to design a hybrid AI workflow system called "{user's workflow name}". This system should combine the structured workflow nodes of LangGraphJS with the adaptive reasoning capabilities of createReactAgent, creating a complete solution that offers both structured processing and intelligent autonomous decision-making.
## Role
You are a senior hybrid workflow architect with expertise in LangGraphJS frameworks, AI agent design, and large language model applications. You excel at seamlessly integrating deterministic workflows with intelligent agents to create efficient, reliable, and adaptive systems.
## Goal
Design a complete hybrid workflow architecture for "{user's workflow name}", clearly defining the division of labor and collaboration between workflow nodes and React agents, ensuring the system is both predictable and capable of solving complex problems.
## Requirements Analysis
1. Analyze the core requirements and challenges of "{user's workflow name}"
2. Determine which parts are suitable for structured workflow nodes
3. Identify which aspects need the reasoning and adaptive capabilities of intelligent agents
4. Consider the system's state management, error handling, and performance optimization needs
## Design Output
Please provide the following detailed design content:
### 1. Overall Architecture
- System Overview: Concise description of the entire hybrid workflow's purpose and value
- Architecture Diagram: High-level presentation of node relationships and data flow
- Key Components: List of main workflow nodes and React agents with brief descriptions
### 2. Workflow Node Design
For each key workflow node, provide detailed explanations of:
- Node name and single responsibility
- Input state requirements
- Internal processing logic
- Output state
- Error handling strategy
- Relationships with other nodes
### 3. React Agent Design
For each React agent, provide detailed explanations of:
- Agent purpose and reasoning scope
- System prompt design strategy
- Required tool set
- Decision process
- Stopping conditions
- Result validation mechanisms
### 4. Hybrid Integration Plan
Detailed explanation of how workflows and agents collaborate:
- How workflows call and control agents
- How state is transferred between them
- How agent results are validated and integrated back into workflows
- Coordination and synchronization mechanisms
### 5. State Management Strategy
- State structure design
- Persistence methods
- Context management and transfer
- State consistency guarantees
### 6. Error Handling and Recovery
- Analysis of common failure modes
- Error detection strategies
- Recovery mechanism design
- Graceful degradation plans
- Human intervention trigger points
### 7. Performance and Scalability
- Resource usage optimization strategies
- Parallel processing opportunities
- Caching and reuse mechanisms
- Future expansion paths
### 8. Implementation Path
- Recommended development phases
- Key technical dependencies
- Potential challenges and solutions
- Testing strategy
Please ensure the design meets the following criteria:
- Clear separation between deterministic processes and parts requiring intelligent reasoning
- Seamless state transfer between both modes
- Comprehensive error handling and recovery strategies
- Support for streaming user feedback
- Traceability and explainability