Skip to content

Commit 333f3e2

Browse files
committed
Add post about ai agent
1 parent 02b42cd commit 333f3e2

File tree

10 files changed

+250
-9
lines changed

10 files changed

+250
-9
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
+++
2+
title = 'Ai Agent Practices'
3+
date = 2025-12-31T13:50:09+08:00
4+
draft = false
5+
+++
6+
这是一篇基于视频 **《那些 Agent 神文没告诉你的事:照着做,系统只会更烂》** 整理的博客文章。
7+
8+
---
9+
10+
# 那些“Agent神文”没告诉你的真相:为什么照着做,系统反而更烂?
11+
12+
在 AI Agent 爆火的今天,很多开发者在看了 Anthropic 或各类技术大厂的“保姆级教程”后,恨不得立马给自己的系统上全套架构:子代理(Sub-agents)、复杂的记忆系统、多步规划……
13+
14+
但结果往往令人沮丧:**Token 烧得飞起,响应速度变慢,系统变得极难调试,且效果甚至不如一个简单的 Prompt。**
15+
16+
数字黑魔法频道的这期视频,深度复盘了 AI Agent 开发中那些“反直觉”的坑。如果你正在搭建 Agent,这几条“流血换来的教训”一定要看。
17+
18+
### 1. 架构设计的“反直觉”:别在不确定性上叠加复杂性
19+
20+
在传统软件开发中,先设计好完美的架构是美德。但在 AI 领域,这是一个巨大的陷阱。
21+
22+
* **API 优先原则**:如果一个任务(如写个标题、总结文章)能通过一次 API Call 解决,**千万不要用 Agent**
23+
* **Workflow vs. Agent**:如果任务步骤是固定的,且不需要用户中途参与(如自动视频剪辑流),请使用 **Workflow(工作流)**。只有当流程需要人的偏好介入,或者功能多到前端 UI 放不下时,才需要对话式 Agent。
24+
* **反向叠加**:AI 本身就是非确定性的系统,在它上面搭一层精致的架构,等于是**在不确定性上叠加了另一层不确定性**
25+
26+
### 2. 演进逻辑:Agent 是“被逼着”长大的
27+
28+
完美的架构不是设计出来的,而是根据需求一步步演化出来的:
29+
30+
1. **Baseline 第一**:不要一上来就用 LangGraph 等重型框架。先用最基础的 SDK 跑通核心逻辑,知道任务的底线在哪。
31+
2. **Prompt 由简入繁**:不要一上来就写万字说明书。先给简单的指令,看它在哪里出错,再针对性地添加限制条件或示例(Few-shot)。
32+
3. **能力不足再加工具**:当 Prompt 无法解决问题时(比如它需要搜索实时信息),再引入 Tool。你会发现每加一个工具,Agent 都会变聪明一点,这才是真正的“涌现”。
33+
34+
### 3. 高阶优化:上下文工程与记忆系统
35+
36+
当你的 Agent 开始变得复杂,你会遇到性能持续下降的问题。这时才需要引入大厂文里的“高级货”:
37+
38+
* **上下文隔离(Context Engineering)**:如果让 Agent 同时处理设计和写代码,上下文会互相干扰。通过 **Sub-agent 架构**,让不同角色只看到自己需要的那一小撮信息。
39+
* **内存 vs 外存**
40+
* **内存**:这轮对话结束就消失。
41+
* **外存**:跨轮次保存的状态(如 Todo List),防止 Agent 迷失方向。
42+
43+
44+
* **传“指针”不传内容**:在不同 Agent 之间传递长代码或大数据时,不要让它反复读写(烧 Token 且易出错),而是通过**文件系统传递路径或引用**
45+
46+
### 4. 调试:过程比结果更重要
47+
48+
对于长任务 Agent,如果它失败了,你必须知道它死在哪一步。
49+
**不要只存结果,要存全过程**:工具调用的顺序、每步消耗的 Token、哪些上下文被浪费了。只有回头读流程,你才知道如何把任务规划得更快、更省钱。
50+
51+
---
52+
53+
### 总结:不要让“优雅”成为绊脚石
54+
55+
那些大厂的“毕设级”架构图确实精妙,但它们是经过无数次实验后的终点,而不是你开发的第一步。
56+
57+
**不要一上来就追求架构的优雅。先跑起来,让需求推着系统去进化。**
58+
59+
**相关视频:** [那些 Agent 神文没告诉你的事:照着做,系统只会更烂](https://www.youtube.com/watch?v=b_9D7T0n4RA)
60+
61+
---

public/archives/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<!doctype html><html lang=en dir=auto><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>Archives | Liqiang'Log</title><meta name=keywords content><meta name=description content="archives"><meta name=author content="Liqiang Du"><link rel=canonical href=https://alpha731.github.io/archives/><meta name=google-site-verification content="XYZabc"><link crossorigin=anonymous href=/assets/css/stylesheet.fc220c15db4aef0318bbf30adc45d33d4d7c88deff3238b23eb255afdc472ca6.css integrity="sha256-/CIMFdtK7wMYu/MK3EXTPU18iN7/MjiyPrJVr9xHLKY=" rel="preload stylesheet" as=style><link rel=icon href=https://alpha731.github.io/%3Clin%3E><link rel=icon type=image/png sizes=16x16 href=https://alpha731.github.io/%3Clink%3E><link rel=icon type=image/png sizes=32x32 href=https://alpha731.github.io/%3Clink%20/%20absolute%20url%3E><link rel=apple-touch-icon href=https://alpha731.github.io/apple-touch-icon.png><link rel=mask-icon href=https://alpha731.github.io/%3Clink%20/%20absolute%20url%3E><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate hreflang=en href=https://alpha731.github.io/archives/><noscript><style>#theme-toggle,.top-link{display:none}</style><style>@media(prefers-color-scheme:dark){:root{--theme:rgb(29, 30, 32);--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:rgb(196, 196, 197);--code-block-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--theme)}.list:not(.dark)::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-thumb{border-color:var(--theme)}}</style></noscript><script async src="https://www.googletagmanager.com/gtag/js?id=G-NPJ8ZLBMWJ"></script><script>var doNotTrack=!1,dnt=navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack,doNotTrack=dnt=="1"||dnt=="yes";if(!doNotTrack){window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-NPJ8ZLBMWJ")}</script><meta property="og:title" content="Archives"><meta property="og:description" content="archives"><meta property="og:type" content="article"><meta property="og:url" content="https://alpha731.github.io/archives/"><meta property="og:image" content="https://alpha731.github.io/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta property="article:section" content><meta property="og:site_name" content="Liqiang'Log"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://alpha731.github.io/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:title content="Archives"><meta name=twitter:description content="archives"><script type=application/ld+json>{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Archives","item":"https://alpha731.github.io/archives/"}]}</script><script type=application/ld+json>{"@context":"https://schema.org","@type":"BlogPosting","headline":"Archives","name":"Archives","description":"archives","keywords":[],"articleBody":"","wordCount":"0","inLanguage":"en","image":"https://alpha731.github.io/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E","datePublished":"0001-01-01T00:00:00Z","dateModified":"0001-01-01T00:00:00Z","author":{"@type":"Person","name":"Liqiang Du"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://alpha731.github.io/archives/"},"publisher":{"@type":"Organization","name":"Liqiang'Log","logo":{"@type":"ImageObject","url":"https://alpha731.github.io/%3Clin%3E"}}}</script></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"?document.body.classList.add("dark"):localStorage.getItem("pref-theme")==="light"?document.body.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://alpha731.github.io/ accesskey=h title="Liqiang'Log (Alt + H)">Liqiang'Log</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)">
22
<svg id="moon" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg>
33
<svg id="sun" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=https://alpha731.github.io/posts/ title=Posts><span>Posts</span></a></li><li><a href=https://alpha731.github.io/archives/ title=Archives><span class=active>Archives</span></a></li><li><a href=https://alpha731.github.io/tags/ title=Tags><span>Tags</span></a></li><li><a href=https://alpha731.github.io/search/ title="Search (Alt + /)" accesskey=/><span>Search</span></a></li></ul></nav></header><main class=main><header class=page-header><h1>Archives
4-
<a href=/index.xml title=RSS aria-label=RSS><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23"><path d="M4 11a9 9 0 019 9"/><path d="M4 4a16 16 0 0116 16"/><circle cx="5" cy="19" r="1"/></svg></a></h1></header><div class=archive-year><h2 class=archive-year-header id=2024><a class=archive-header-link href=#2024>2024</a>
4+
<a href=/index.xml title=RSS aria-label=RSS><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23"><path d="M4 11a9 9 0 019 9"/><path d="M4 4a16 16 0 0116 16"/><circle cx="5" cy="19" r="1"/></svg></a></h1></header><div class=archive-year><h2 class=archive-year-header id=2025><a class=archive-header-link href=#2025>2025</a>
5+
<sup class=archive-count>&nbsp;1</sup></h2><div class=archive-month><h3 class=archive-month-header id=2025-December><a class=archive-header-link href=#2025-December>December</a>
6+
<sup class=archive-count>&nbsp;1</sup></h3><div class=archive-posts><div class=archive-entry><h3 class="archive-entry-title entry-hint-parent">Ai Agent Practices</h3><div class=archive-meta><span title='2025-12-31 13:50:09 +0800 CST'>December 31, 2025</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;95 words&nbsp;·&nbsp;Liqiang Du</div><a class=entry-link aria-label="post link to Ai Agent Practices" href=https://alpha731.github.io/posts/ai-agent-practices/></a></div></div></div></div><div class=archive-year><h2 class=archive-year-header id=2024><a class=archive-header-link href=#2024>2024</a>
57
<sup class=archive-count>&nbsp;1</sup></h2><div class=archive-month><h3 class=archive-month-header id=2024-September><a class=archive-header-link href=#2024-September>September</a>
68
<sup class=archive-count>&nbsp;1</sup></h3><div class=archive-posts><div class=archive-entry><h3 class="archive-entry-title entry-hint-parent">About</h3><div class=archive-meta><span title='2024-09-16 13:55:11 +0800 CST'>September 16, 2024</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;118 words&nbsp;·&nbsp;Liqiang Du</div><a class=entry-link aria-label="post link to About" href=https://alpha731.github.io/posts/first-post/></a></div></div></div></div></main><footer class=footer><span>&copy; 2025 <a href=https://alpha731.github.io/>Liqiang'Log</a></span> ·
79
<span>Powered by

public/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
<svg id="sun" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=https://alpha731.github.io/posts/ title=Posts><span>Posts</span></a></li><li><a href=https://alpha731.github.io/archives/ title=Archives><span>Archives</span></a></li><li><a href=https://alpha731.github.io/tags/ title=Tags><span>Tags</span></a></li><li><a href=https://alpha731.github.io/search/ title="Search (Alt + /)" accesskey=/><span>Search</span></a></li></ul></nav></header><main class=main><article class="first-entry home-info"><header class=entry-header><h1>👋Welcome to Liqiang&rsquo;Log</h1></header><div class=entry-content>Hi, this is Liqiang. I&rsquo;m documenting my thoughts this blog.</div><footer class=entry-footer><div class=social-icons><a href=https://x.com/Duliqiang target=_blank rel="noopener noreferrer me" title=X><svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
44
</a><a href=https://github.com/alpha731 target=_blank rel="noopener noreferrer me" title=Github><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37.0 00-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44.0 0020 4.77 5.07 5.07.0 0019.91 1S18.73.65 16 2.48a13.38 13.38.0 00-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07.0 005 4.77 5.44 5.44.0 003.5 8.55c0 5.42 3.3 6.61 6.44 7A3.37 3.37.0 009 18.13V22"/></svg></a></div></footer></article><article class=post-entry><header class=entry-header><h2 class=entry-hint-parent>About</h2></header><div class=entry-content><p>On Choosing What Matters There are many things a person can do in a lifetime. I have learned that trying to do everything usually means doing nothing well.
55
So I choose a few things and return to them quietly: reading to understand the world, training my body to stay grounded in it, building financial stability to earn freedom over time, and treating people with care—especially those closest to me. These are not ambitious goals. They are sustainable ones.
6-
...</p></div><footer class=entry-footer><span title='2024-09-16 13:55:11 +0800 CST'>September 16, 2024</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;118 words&nbsp;·&nbsp;Liqiang Du</footer><a class=entry-link aria-label="post link to About" href=https://alpha731.github.io/posts/first-post/></a></article></main><footer class=footer><span>&copy; 2025 <a href=https://alpha731.github.io/>Liqiang'Log</a></span> ·
6+
...</p></div><footer class=entry-footer><span title='2024-09-16 13:55:11 +0800 CST'>September 16, 2024</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;118 words&nbsp;·&nbsp;Liqiang Du</footer><a class=entry-link aria-label="post link to About" href=https://alpha731.github.io/posts/first-post/></a></article><article class=post-entry><header class=entry-header><h2 class=entry-hint-parent>Ai Agent Practices</h2></header><div class=entry-content><p>这是一篇基于视频 《那些 Agent 神文没告诉你的事:照着做,系统只会更烂》 整理的博客文章。
7+
那些“Agent神文”没告诉你的真相:为什么照着做,系统反而更烂? 在 AI Agent 爆火的今天,很多开发者在看了 Anthropic 或各类技术大厂的“保姆级教程”后,恨不得立马给自己的系统上全套架构:子代理(Sub-agents)、复杂的记忆系统、多步规划……
8+
但结果往往令人沮丧:Token 烧得飞起,响应速度变慢,系统变得极难调试,且效果甚至不如一个简单的 Prompt。
9+
数字黑魔法频道的这期视频,深度复盘了 AI Agent 开发中那些“反直觉”的坑。如果你正在搭建 Agent,这几条“流血换来的教训”一定要看。
10+
1. 架构设计的“反直觉”:别在不确定性上叠加复杂性 在传统软件开发中,先设计好完美的架构是美德。但在 AI 领域,这是一个巨大的陷阱。
11+
API 优先原则:如果一个任务(如写个标题、总结文章)能通过一次 API Call 解决,千万不要用 Agent。 Workflow vs. Agent:如果任务步骤是固定的,且不需要用户中途参与(如自动视频剪辑流),请使用 Workflow(工作流)。只有当流程需要人的偏好介入,或者功能多到前端 UI 放不下时,才需要对话式 Agent。 反向叠加:AI 本身就是非确定性的系统,在它上面搭一层精致的架构,等于是在不确定性上叠加了另一层不确定性。 2. 演进逻辑:Agent 是“被逼着”长大的 完美的架构不是设计出来的,而是根据需求一步步演化出来的:
12+
Baseline 第一:不要一上来就用 LangGraph 等重型框架。先用最基础的 SDK 跑通核心逻辑,知道任务的底线在哪。 Prompt 由简入繁:不要一上来就写万字说明书。先给简单的指令,看它在哪里出错,再针对性地添加限制条件或示例(Few-shot)。 能力不足再加工具:当 Prompt 无法解决问题时(比如它需要搜索实时信息),再引入 Tool。你会发现每加一个工具,Agent 都会变聪明一点,这才是真正的“涌现”。 3. 高阶优化:上下文工程与记忆系统 当你的 Agent 开始变得复杂,你会遇到性能持续下降的问题。这时才需要引入大厂文里的“高级货”:
13+
上下文隔离(Context Engineering):如果让 Agent 同时处理设计和写代码,上下文会互相干扰。通过 Sub-agent 架构,让不同角色只看到自己需要的那一小撮信息。
14+
内存 vs 外存:
15+
...</p></div><footer class=entry-footer><span title='2025-12-31 13:50:09 +0800 CST'>December 31, 2025</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;95 words&nbsp;·&nbsp;Liqiang Du</footer><a class=entry-link aria-label="post link to Ai Agent Practices" href=https://alpha731.github.io/posts/ai-agent-practices/></a></article></main><footer class=footer><span>&copy; 2025 <a href=https://alpha731.github.io/>Liqiang'Log</a></span> ·
716
<span>Powered by
817
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> &
918
<a href=https://github.com/adityatelange/hugo-PaperMod/ rel=noopener target=_blank>PaperMod</a></span></footer><a href=#top aria-label="go to top" title="Go to Top (Alt + G)" class=top-link id=top-link accesskey=g><svg viewBox="0 0 12 6" fill="currentColor"><path d="M12 6H0l6-6z"/></svg>

0 commit comments

Comments
 (0)