序
本篇由來,在COC上我當面感謝了組委會和姜寧老師,隨即被姜寧老師催稿,本來當天晚上寫了一個流水賬,感覺甚為不妥。于是決定慢慢寫,緩緩道來。要同時兼顧Show me the code,Show me the vide。希望能形成一個從不同側面觀測我自己Community Over Code 2025參會心的,收獲的內容集合。
感覺這個系列正慢慢變成一場開發過程的圖文慢直播,肯能有助于大家一步一步的從零開始構建自己的Agent。
我定了一個番茄鐘,每天寫稿大概1~2個鐘,寫到哪兒算哪兒。
今天也對內容進行了調整把前略改成附錄了,頗有一種寫論文的感覺。
BTW,知乎我一般隔一天發。插曲可以TL;DR。
詞匯表
異人智能,我從KK和建忠老師的直播,個人筆記,了解到的詞匯,我很喜歡。大家請自行替換為大模型,Agent就好了。
今兒吃了一個教訓結合這教訓來談談數據驅動
我們今天先上教訓然后倒敘來講。
教訓,我DeepSeek半年沒用了50塊,今兒畫超額了
從頭講,畢竟也在一些開源讀書會里,也算是個人的閱讀哲學了。
可能關注我朋友圈的朋友都知道我有個自動化的job幫我讀論文。最近讀完了《浪潮將至》以及完成了今年各種預定的技術峰會論壇參與和演講之后,我就想著升級一下我這個論文閱讀器,做的通用一點。
我原本的目的:
- 過濾一些營銷號的傳播學手段,設計了事實核查。
- 我不喜歡看那么多定狀補的內容,比較喜歡主謂賓。從而看事實,減少被他人觀點影響。
- 以后內容滿天飛,包括LLM生成的,需要上LLM這樣效率的手段加以對抗。
所以呢,想著就是拿過來一篇文章,比如本文吧。讓DeepSeek先讀一遍,然后把重點畫出來,自己在做點指標,用指標卡一下文章內容。
就如我之前Agent是作者個人或者團體的一些強烈的哲學表達提到的,邊Sir講,要有數據能力。我寫好了閱讀提示詞,把過濾器也做好了。
然后,這是性能——一個非功能指標爆炸的例子
其實,如果我提早加好了指標,我早就知道可能會炸了。但是懶嘛~
還是簡單的show me the code/show me the vibe過一下提示詞
You are a professional linguist and are currently conducting an analysis of an article that will be used to teach your classmates in class. The topic is to analyze through practice how students can identify communication methods and their harmful effects in communication studies.Please note that the author and source of this article are not reliable and may not necessarily be trustworthy, so the author may intentionally deceive people. A random article as a teaching case is very helpful for students to browse content online in their daily lives.You will have a structured analysis framework and type your finding in a digital system. Students will fill a digital form and start their study.Analysis steps:Step one, please score according to the following formula:- Core Component (CC)=Subject (S)+Predicate (P)+Object (O)- Modifier (MC)=attributive (Attr)+adverbial (Adv)+complement (Comp)+other modifiers (OM)Step two, please organize the emotional intensity of the modifying elements. As the general modifying part is the author's viewpoint or comment, please organize the intensity of this part (1-10) and score it.Step three, please list one by one the possible communication methods in the original sentence, for each item, please construct search terms based on the results of steps one and three for readers to practice fact checking. possible communication methods including:- Information screening and one-sided presentation, including but not limited to: biased generalization, selective reporting, and survivorship bias- Concept and issue manipulation, including but not limited to: concept switching, labeling, stigmatization, emotional manipulation- Factual manipulation, including but not limited to: fabricating facts, taking out of context, and misleading data- Communication and psychological manipulation, including but not limited to: repeated reinforcement, creating opposition, spiral of silence- Media environment manipulation, including but not limited to: agenda setting, information overload, authoritative endorsementQuality requirement:- All your output should basing on the original sentence.- You output will always in json string which starts from { and end with } to help students with digital form.Example:...Next, I will send you the article sentence by sentence.
為了防止大量低分內容污染總結,我設置了一個過濾規則,于是乎,代碼邏輯就變成這樣子了。
當時我想著,既然把文章整體仍給DeepSeek要Token(T),那么我一句一句扔進去應該也是一樣的Token數量。但考慮到逐句分析的時候,效果比整體仍進去要好,對吧?對吧?我能從T個token里拿到10個信息的話,為啥我就拿到5個信息就心甘情愿了呢?
例子
前(好比直接算面積)
請幫我從以下文章中提取xxx信息:
句子一。。。二。。。。N
后(好比微積分)
請幫我從句子中提取xxx信息,我將逐句提供給你(微分)
緩存結果
請幫我從以下結果中總結xxx(積分)
天下沒有免費的午餐
我:我理解處理的過程不一樣,因為效果和結果不一樣,但是我沒想到token居然也會不一樣。
友人:獨立句子會被kv cache分成獨立的空間
我:! 懂了
對的,考慮到kv cache的不同,當你把一篇文章分成10份給DeepSeek的時候實際上是十份獨立的kv cache,自然要分開計費,自然就貴了。
至于我為什么開了那么多個鏈接,issue. Strands Agent的并發實際上沒寫能支撐多少,因為連接池炸了,于是乎我每次就new了一個pool。但,每個句子的pool好像沒共享,于是乎。。。
說實話我最近總有DeepSeek賬戶里充的錢要用光預感,沒想到啊,沒想到。果然是應驗了,只能說監控沒做到位。
教訓:業務要可觀測,Agent的狀態要可觀測,性能指標也要可觀測!
附錄
思考
Agent是作者個人或者團體的一些強烈的哲學表達
Strands Agent實戰
Strands Agent 前文
Community Over Code 2025獲得的花絮(Strands Agent踩坑記錄,被AWS的speaker催更
)
Agent從零開發
沒用langchain什么的腳手架,從DeepSeek官網的首次調用 API 開始,一步一步,面向DeepSeek開始對話的開發實戰記錄。
沒有Vibe Coding IDE, 學生可以從這個過程看底層一步一步怎么做的,為什么這么做。
如果想學習古法編程的朋友,可以一步一步從零自學。
理解原理,如果后續langchain全面收費的話,大家可以知道什么部分為什么這么設計,方便遷移。
是Conference還是Hackathon?Community Over Code 2025上踐行自己的哲學感悟(一)
是Conference還是Hackathon?Community Over Code 2025上踐行自己的哲學感悟(二)
是Conference還是Hackathon?Community Over Code 2025上踐行自己的哲學感悟(三)
是Conference還是Hackathon?Community Over Code 2025上踐行自己的哲學感悟(插曲篇)
是Conference還是Hackathon?Community Over Code 2025上踐行自己的哲學感悟(五)
是Conference還是Hackathon?Community Over Code 2025上踐行自己的哲學感悟(六)
是Conference還是Hackathon?Community Over Code 2025上踐行自己的哲學感悟(七)