AI Systems Field Note: Agentic Workflows

Traditional LLM usage often follows a "Zero-Shot" pattern: you provide a prompt, and the model provides a single, immediate response. Agentic Workflows, however

专属插画
AI Systems Field Note: Agentic Workflows

AI Systems Field Note: Agentic Workflows

English

Concept: Agentic Workflows

Traditional LLM usage often follows a "Zero-Shot" pattern: you provide a prompt, and the model provides a single, immediate response. **Agentic Workflows**, however, shift the paradigm from "one-shot generation" to "iterative reasoning and action."

In an agentic workflow, the LLM is not just a text generator but a controller in a loop. It can plan steps, use tools (like searching the web or running code), observe the results, and then refine its next move based on those observations.

Practical Tradeoffs

| Feature | Zero-Shot Prompting | Agentic Workflows |

| :--- | :--- | :--- |

| **Latency** | Low (Single pass) | High (Multiple loops/tool calls) |

| **Reliability** | Variable (Prone to hallucinations) | Higher (Self-correction via feedback) |

| **Complexity** | Low (Simple prompt) | High (Requires state management & tool definitions) |

| **Cost** | Low (Minimal tokens) | Higher (Cumulative token usage per task) |

Example Scenario

**Task:** "Write a Python script to scrape news from a specific URL and summarize it."

* **Zero-Shot:** The model writes the code based on its training data. If the website structure has changed or the library version is different, the code fails, and the user must manually fix it.

* **Agentic Workflow:**

1. **Plan:** The agent decides to first inspect the URL structure.

2. **Act:** It writes and executes a small script to fetch HTML.

3. **Observe:** It sees the HTML structure and realizes it needs `BeautifulSoup`.

4. **Refine:** It updates the script with correct selectors and runs it again.

5. **Finalize:** Once successful, it summarizes the content.

---

简体中文 (zh-cn)

概念:智能体工作流 (Agentic Workflows)

传统的 LLM 使用模式通常遵循“零样本 (Zero-Shot)”模式:你提供一个提示词,模型给出一个即时的响应。而**智能体工作流**将范式从“单次生成”转变为“迭代推理与行动”。

在智能体工作流中,LLM 不仅仅是一个文本生成器,更是循环中的控制器。它可以规划步骤、使用工具(如搜索网络或运行代码)、观察结果,并根据这些观察结果来优化下一步行动。

实际权衡

| 特性 | 零样本提示 (Zero-Shot) | 智能体工作流 (Agentic Workflows) |

| :--- | :--- | :--- |

| **延迟** | 低(单次处理) | 高(多次循环/工具调用) |

| **可靠性** | 不稳定(易产生幻觉) | 更高(通过反馈进行自我修正) |

| **复杂度** | 低(简单的提示词) | 高(需要状态管理和工具定义) |

| **成本** | 低(Token 使用量极少) | 较高(每个任务的累计 Token 使用量大) |

应用场景示例

**任务:** “编写一个 Python 脚本来抓取特定 URL 的新闻并进行总结。”

* **零样本模式:** 模型根据训练数据编写代码。如果网站结构发生了变化或库版本不同,代码会运行失败,用户必须手动修复。

* **智能体工作流模式:**

1. **规划:** 智能体决定首先检查 URL 的结构。

2. **行动:** 它编写并执行一个小脚本来获取 HTML。

3. **观察:** 它观察到 HTML 结构,意识到需要使用 `BeautifulSoup`。

4. **优化:** 它使用正确的选择器更新脚本并再次运行。

5. **完成:** 在成功后,它对内容进行总结。

---

繁體中文 (zh-tw)

概念:代理工作流 (Agentic Workflows)

傳統的 LLM 使用模式通常遵循「零樣本 (Zero-Shot)」模式:你提供一個提示詞,模型給出一個即時的響應。而**代理工作流 (Agentic Workflows)** 將範式從「單次生成」轉變為「迭代推理與行動」。

在代理工作流中,LLM 不僅僅是一個文本生成器,更是循環中的控制器。它可以規劃步驟、使用工具(例如搜尋網路或執行程式碼)、觀察結果,並根據這些觀察結果來優化下一步行動。

實際權衡

| 特性 | 零樣本提示 (Zero-Shot) | 代理工作流 (Agentic Workflows) |

| :--- | :--- | :--- |

| **延遲** | 低(單次處理) | 高(多次循環/工具調用) |

| **可靠性** | 不穩定(易產生幻覺) | 更高(透過回饋進行自我修正)|

| **複雜度** | 低(簡單的提示詞)| 高(需要狀態管理與工具定義)|

| **成本** | 低(Token 使用量極少)| 較高(每個任務的累積 Token 使用量大)|

應用場景範例

**任務:** 「編寫一個 Python 腳本來抓取特定 URL 的新聞並進行總結。」

* **零樣本模式:** 模型根據訓練數據編寫程式碼。如果網站結構發生了變化或函式庫版本不同,程式碼會執行失敗,使用者必須手動修復。

* **代理工作流模式:**

1. **規劃:** 代理決定首先檢查 URL 的結構。

2. **行動:** 它編寫並執行一個小腳本來獲取 HTML。

3. **觀察:** 它觀察到 HTML 結構,意識到需要使用 `BeautifulSoup`。

4. **優化:** 它使用正確的選擇器更新腳本並再次執行。

5. **完成:** 在成功後,它對內容進行總結。

Status: 已验证完成

留言区

欢迎分享你的想法!

发表留言

0/500

加载留言中…