AI Agent Builder
Structured framework for building AI agents that work in production. Based on the Storm & Storm methodology.
When to Use
- - Designing a new AI agent from scratch
- Planning architecture for an automated workflow
- Reviewing or improving an existing agent's design
- Teaching someone how to build agents
The 8-Step Process
Follow these steps in order. Each step has a clear goal and concrete deliverables.
Step 1: Choose a Task
Pick ONE painful, repeating workflow. Not "AI in general."
- - Must be repeatable (weekly+), follow steps, have clear I/O
- Define success: "Given X, the agent should output Y so that Z happens."
Step 2: Map the Steps
Break the task into 4–7 steps: INPUT → ACTIONS → DECISION → OUTPUT
- - Classify each step: ⚖️ pure rules | 📖 heavy reading/writing | 🎯 judgement calls
- Choose infrastructure (no-code vs dev-friendly)
- You need: strong model + tool calling + basic logs
Step 3: Specify Inputs, Outputs & Tools
Treat the agent like an API, not a chatbot.
- - Define required input fields (text, file, URL, ID)
- Define structured outputs (JSON/template the system can trust)
- Attach tools: data (search/DB/CRM), action (email/Slack/tasks), orchestration (schedulers/webhooks/queues)
Step 4: Write the System Prompt
Create a clear role with: role definition, boundaries, style, 1–2 example conversations.
- - Use ReAct pattern: observe → think → act → reflect
Step 5: Add Memory
Three layers: conversation state, task memory, knowledge memory (vector store/file search).
- - Key question: "What does this agent need to remember for the next step to be smarter?"
Step 6: Add Safeguards
Gate high-risk actions (email, data changes, money) behind human approval.
- - Rules: never invent IDs, ask when ambiguous
- Log every tool call and decision for audit
Step 7: Build the Interface
Match to where users work: chat, Slack command, button in app, or web form.
Step 8: Test
For each real example: watch the trace, score correctness + efficiency + time saved.
- - Tighten prompts/tools/rules where it fails. Iterate.
Detailed Reference
For expanded details on each step, including selection criteria, classification examples, tool categories, memory layer patterns, and a pre-launch checklist:
→ Read references/guide.md
Output Format
When using this framework to design an agent, produce a design document covering:
CODEBLOCK0
AI Agent 构建器
用于构建可在生产环境中运行的AI代理的结构化框架。基于Storm & Storm方法论。
使用场景
- - 从零开始设计新的AI代理
- 规划自动化工作流的架构
- 审查或改进现有代理的设计
- 教授他人如何构建代理
8步流程
按顺序执行以下步骤。每个步骤都有明确的目标和具体的交付物。
第1步:选择任务
选择一个痛苦且重复的工作流。不是通用AI。
- - 必须是可重复的(每周以上)、有步骤可循、有明确的输入/输出
- 定义成功标准:给定X,代理应输出Y,以实现Z。
第2步:映射步骤
将任务分解为4-7个步骤:输入 → 操作 → 决策 → 输出
- - 对每个步骤进行分类:⚖️ 纯规则 | 📖 大量读写 | 🎯 判断决策
- 选择基础设施(无代码 vs 开发者友好)
- 你需要:强模型 + 工具调用 + 基础日志
第3步:明确输入、输出和工具
将代理视为API,而非聊天机器人。
- - 定义必需的输入字段(文本、文件、URL、ID)
- 定义结构化输出(系统可信任的JSON/模板)
- 附加工具:数据类(搜索/数据库/CRM)、操作类(邮件/Slack/任务)、编排类(调度器/Webhook/队列)
第4步:编写系统提示
创建清晰的角色定义:角色定义、边界、风格、1-2个示例对话。
- - 使用ReAct模式:观察 → 思考 → 行动 → 反思
第5步:添加记忆
三个层次:对话状态、任务记忆、知识记忆(向量存储/文件搜索)。
- - 关键问题:代理需要记住什么才能让下一步更智能?
第6步:添加安全措施
将高风险操作(邮件、数据变更、资金)置于人工审批之后。
- - 规则:绝不虚构ID,遇到歧义时询问
- 记录每次工具调用和决策以供审计
第7步:构建界面
匹配用户的工作环境:聊天、Slack命令、应用内按钮或Web表单。
第8步:测试
针对每个真实示例:查看追踪记录,评估正确性、效率和节省的时间。
详细参考
关于每个步骤的详细说明,包括选择标准、分类示例、工具类别、记忆层模式以及上线前检查清单:
→ 阅读 references/guide.md
输出格式
使用此框架设计代理时,需生成包含以下内容的设计文档:
代理设计:[名称]
任务与成功标准
[第1步输出]
步骤映射
[第2步输出 — 带分类的编号步骤]
输入/输出规范
[第3步输出 — 输入、输出、工具]
系统提示
[第4步输出 — 实际提示内容]
记忆架构
[第5步输出 — 哪些层次、存储内容]
安全措施
[第6步输出 — 门控操作、规则、日志记录]
界面
[第7步输出 — 选择的界面及原因]
测试计划
[第8步输出 — 示例输入、预期输出、评分标准]