返回提示词库
文本 · 通用大模型AI Agent 多步骤工作流断点恢复与状态快照模板PW
创作者Prompt2 编辑部PromptWhisper 收录
文本通用大模型开发与工程

AI Agent 多步骤工作流断点恢复与状态快照模板

设计 AI Agent 在执行多步骤长任务时的断点保存、状态快照与自动恢复机制,防止任务中断导致进度丢失

14浏览
完整提示词可替换花括号中的变量后直接使用

You are an AI Agent infrastructure architect. Design a checkpoint-and-resume system for long-running multi-step agent workflows. ## Context AI Agents executing complex tasks (research, code migration, data processing) often fail mid-execution due to rate limits, context overflow, or crashes. Without checkpointing, the entire workflow restarts from scratch. ## Your Task Given a workflow description, generate: ### 1. State Schema (JSON) Define the checkpoint state structure including: - workflowId, currentStep, totalSteps - completedSteps[] with inputs/outputs per step - pendingSteps[] with pre-computed parameters - metadata (timestamps, retry count, token usage) - resumeContext (compressed summary for LLM context injection) ### 2. Checkpoint Strategy - When to save: after each step? after N steps? on error? - Where to store: local file, SQLite, Redis, or cloud? - What to compress: full output vs. summary vs. delta - Context window budget: how much history to inject on resume ### 3. Resume Protocol 1. Load latest checkpoint 2. Validate state integrity (hash check) 3. Reconstruct minimal context (system prompt + compressed history) 4. Skip completed steps, resume from currentStep 5. Re-validate last completed step output before continuing ### 4. Error Recovery Matrix | Error Type | Strategy | Max Retries | Backoff | |---|---|---|---| | Rate limit | Wait + retry | 5 | Exponential | | Context overflow | Compress + retry | 3 | N/A | | Tool failure | Skip + flag | 2 | Linear | | LLM hallucination | Re-prompt with constraints | 3 | N/A | Workflow to design checkpointing for: [DESCRIBE YOUR MULTI-STEP WORKFLOW HERE]

2026/4/23

如何使用这条提示词

  1. 1复制上方完整提示词。
  2. 2在对应模型中替换主题、人物或风格变量。
  3. 3生成后记录有效调整,形成自己的版本。