序
本篇由来,在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上践行自己的哲学感悟(七)