A patriot, a rookie vibe coder, an amateur economy observer.

Joined March 2009
145 Photos and videos
绿友友:我們只是做生意: 福麥國際室內裝修:得標RDX炸藥 大石國際鞋廠得:標步槍底火 禾亞國際菸酒批發:得標手槍彈 禾威投資菸酒批發:得標重機槍彈 鴻璋茶業得標:兵推系統維護 DPP:彰显我们全民皆兵、同岛一命的决心啊!
2
560
不要脸、不皿煮
1
2
445
🅢 Hermes Agent Token 聚合术:用 execute_code 做中间聚合大幅降本 📌 一句话总结 把 N 次独立工具调用包进一次 `execute_code()`,在 Python 脚本内做过滤、排序、压缩,【只把精华摘要喂入主上下文】,中间原始结果完全不进 Token 窗口——省 90% 上下文开销。 📌 一、来源:这个问题是怎么发现的 在日常跑 Agent 时,经常需要【一次调研扫多个方向】,典型场景: terminal("opencli twitter search 'ChatGPT 5.5'") terminal("opencli twitter search 'DeepSeek V4'") terminal("opencli twitter search 'Hermes Agent'") terminal("opencli twitter search 'AI news'") 每个 `terminal()` 调用的全量输出(通常 2000-3000 tokens,含每条推文的完整文本)都会【直接进入助手的主上下文窗口】。4 次搜索 ≈ 8000-12000 tokens 被白白消耗。 痛点: • 【Token 浪费严重】:中间数据(整条推文)大部分不需要出现在主上下文中 • 【窗口污染】:不相关的旁支信息占据上下文预算,影响推理质量 • 【大上下文时成本剧增】:对长上下文模型(如 128K/1M),过量 token 直接影响响应速度 Hermes Agent 内置了 `execute_code` 工具,允许执行一段 Python 脚本,脚本内可以调用 `from hermes_tools import terminal, web_search` 等工具——这意味着【可以把多个工具调用在脚本内完成,只在脚本内处理结果,最终只输出摘要】。 这个能力天然就是 Token 聚合器。 📌 二、目的:解决什么问题 问题 │ 传统做法 │ 聚合术做法 N 次工具调用 → N 份全量输出进上下文 │ ✅ 简单直接 │ ✅ 数据不进主上下文 搜索结果需要排序/去重/过滤 │ ❌ 只能手动在上下文里处理 │ ✅ Python 内用 sorted/filter 轻松处理 条件分支(如搜不到就换关键词) │ ❌ 需要多次 tool call │ ✅ if/else 一个脚本搞定 批量抓页面后提取关键信息 │ ❌ 每个页面全量进窗口 │ ✅ 脚本内提取摘要,只输出精华 多次工具调用的输出累积 │ ❌ 每个输出的原本形体必然挤占上下文 │ ✅ 中间结果在脚本内被消费,不进入主 LLM 【核心目的】:不是减少工具调用次数,而是【控制什么数据进入主上下文】。把 Agent 从"所有中间结果都给你看"变成"给你看加工好的浓缩结果"。 📌 三、如何实践 ▸ 3.1 基础模式:批量搜索 压缩 from hermes_tools import terminal import json # 多次搜索在脚本内完成 r1 = terminal("opencli twitter search 'ChatGPT 5.5' --filter top --limit 5 -f json", timeout=25) r2 = terminal("opencli twitter search 'DeepSeek V4' --filter top --limit 5 -f json", timeout=25) # 在 Python 内解析、排序、截断 tweets = json.loads(r1.get("output", "[]")) tweets.sort(key=lambda t: t.get('views', 0), reverse=True) for t in tweets[:3]: text = t.get('text', '') if len(text) > 100: text = text[:97] '...' print(f" @{t.get('author')} 👍{t.get('likes')} 👁{t.get('views')}") print(f" {text}") # 只输出摘要 → 只有这 3 条截断的文本进入了主上下文 ▸ 3.2 进阶模式:条件分支 兜底 from hermes_tools import terminal, web_search import json # 优先尝试 API 搜索 raw = terminal("opencli twitter search '某话题' -f json", timeout=15).get("output", "[]") tweets = json.loads(raw) if not tweets: # API搜不到 → 自动兜底用 web_search fallback = web_search("某话题 site:twitter.com") # 从 web_search 结果中提取概要 for r in fallback.get("data", {}).get("web", [])[:5]: print(f" - {r.get('title')}") print("兜底完成") ▸ 3.3 高级模式:批量网页提取 聚合知识 from hermes_tools import terminal, web_extract import json, re # 搜索 → 提取链接 → 批量抓取 raw = terminal("opencli twitter search '某项目发布' -f json").get("output", "[]") tweets = json.loads(raw) urls = [] for t in tweets[:5]: # 正则提取推文中的 URL found = re.findall(r'https://t\.co/\w ', t.get('text', '')) urls.extend(found) if urls: pages = web_extract(urls) for page in pages.get("results", []): content = page.get("content", "") # 只取前 500 字 print(f"\n## {page.get('title')}") print(content[:500]) ▸ 3.4 核心原则 ① 所有工具调用 → 用 execute_code 包裹 ② 数据过滤/排序/压缩 → 在 Python 脚本内完成 ③ 只 print 浓缩后的摘要 → 只有 print 的内容进入主上下文 ④ -f json 是好帮手 → 结构化数据用 json.parse 比字符串解析稳定 10 倍 📌 四、对比结果:以 Twitter 逛推为例 ▸ 测试场景 4 路并行搜索(ChatGPT 5.5 / DeepSeek V4 / Hermes Agent / 今日推圈),各取 top 5 结果。 ▸ Token 消耗实测 维度 │ ❌ 传统模式 │ ✅ 聚合模式 │ 节省 工具调用次数 │ 4 次 terminal() │ 1 次 execute_code() │ - 中间数据量 │ ~7500 tokens(4 × 全量输出) │ ~0 tokens(不进上下文) │ **100%** 最终进入上下文的输出 │ ~7500 tokens │ ~800 tokens(摘要) │ **~90%** 处理结果的质量 │ 全量文本在上下文,需肉眼过滤 │ Python 自动排序、截断、过滤 │ **更高** 可维护性 │ 每次重新手动调 │ 复用脚本模板 │ **更高** ▸ 输出质量对比 【传统模式】:助手读到 4 份全量推文输出,需要自己在上下文中阅读、理解、提炼——消耗推理 token,且容易遗漏。 【聚合模式】:脚本在 Python 内按 `views` 排序,只取每条推文的前 100 字摘要,最终输出整齐的表格形式。助手直接拿到高质量摘要,【不需要额外推理】。 ▸ 实测输出样例(聚合模式) ─── 🤖 ChatGPT 5.5 / GPT Image 2 ─── @FinanceYF5 👍2546 👁1.8M OpenAI 发布 ChatGPT Images 2.0 才刚过去 24 个多小时,10 个疯狂案例... @vista8 👍389 👁64K AIgocode 的 Codex 中转,疯狂用一天才花27块钱... @canghe 👍111 👁22K GPT Image 2 充值教程:礼品卡美区... ─── ⚡ Hermes Agent 生态 ─── @Lonely__MH 👍3401 👁674K NVIDIA 免费送一年 API Key(Hermes可用,已领爆) @BTCqzy1 👍870 👁70K 完整 Hermes 资源合集,从入门到高阶... 📌 五、可能碰到的问题及解决 ▸ 问题 1:-f json 输出格式不是标准 JSON 【现象】:`opencli twitter search -f json` 输出的 JSON 有时候不是合法 JSON(字段名无引号、key 重复等)。 【解决】: • 优先用 `-f json`(大部分场景稳定) • 解析时用 `try/except` 兜底 • 备选方案:用 `-f yaml` Python 的 `yaml.safe_load()`,YAML 容错性比 JSON 高 • 最后一个办法:用 `-f plain`,然后写简单的文本解析器(split regex) import json try: data = json.loads(raw_output) except json.JSONDecodeError: # 兜底:假设是 YAML 格式 import yaml data = yaml.safe_load(raw_output) ▸ 问题 2:terminal timeout 【现象】:`opencli twitter thread` 等命令在 timeout 内没返回(thread 或 article 命令可能需要更长时间)。 【解决】: • 调高 timeout:`terminal("...", timeout=30)` • 搜索类命令用 `--limit` 控制输出量(`--limit 5` 而不是默认 15) • 深读环节(thread/article)单独提升 timeout • 如果稳定超时,把该步骤拆到单独的 `execute_code` 调用中 ▸ 问题 3:脚本内 terminal 返回的命令被截断 【现象】:`terminal()` 默认 stdout 上限 50KB,大量结果会被截断,导致 `json.loads` 失败。 【解决】: • 源头控制:`--limit 5` 限制结果条数 • 检测截断:检查输出末尾是否有 `[output truncated]` 标记 • 分页:`--offset` `--limit` 分批拉取,分批处理 raw = terminal("opencli twitter search '某话题' --limit 5 -f json").get("output", "[]") # 检查是否被截断 if raw.endswith("[output truncated]"): print("⚠️ 结果被截断,尝试减小 --limit") ▸ 问题 4:execute_code 本身也有 Token 消耗 【现象】:`execute_code` 的代码本身也占用输入 token。 【解决】: • 代码尽量精简(100-200 行以内,不含多余注释) • 长逻辑拆成函数(复用函数模板) • 高频场景做成 Skill 模板,每次只需改关键词参数 • 不要在一个 execute_code 里塞进所有操作——合适粒度为 3-6 个工具调用 ▸ 问题 5:调试困难 【现象】:所有输出被聚合了,中间出错时不知道哪一步报错。 【解决】: • 开发阶段:先不用 `execute_code`,逐个调通再合入 • 聚合脚本内加 `print("DEBUG: step X")` 标记进度 • 工具调用失败时 print 错误信息:`print(f"⚠️ 搜索失败: {r.get('error')}")` • 用 `try/except` 包裹每个工具调用,确保一个失败不影响整体 results = [] for keyword in keywords: try: r = terminal(f"opencli twitter search '{keyword}' -f json", timeout=20) results.append(json.loads(r.get("output", "[]"))) except Exception as e: print(f"⚠️ {keyword} 搜索失败: {e}") results.append([]) ▸ 问题 6:JSON 解析 排序脚本负担 【现象】:每次写 JSON 解析 排序代码重复劳动。 【解决】:沉淀为 Skill 模板,每次只需替换关键词列表即可复用: Skill: twitter-aggregated-scan category: browser 触发条件:用户说"逛推"、"扫一圈"、"推上有什么新闻" 📌 六、什么时候该用,什么时候不该用 ▸ ✅ 适合聚合的场景 场景 │ 原因 批量搜索(3-6 路并行) │ 每路搜索结果不需要全部细节 多页面提取 知识合成 │ 原始页面文本很大,只需要摘要 条件分支型工作流 │ 避免多次 tool call 的来回 调研报告生成 │ 先搜 → 再筛 → 再写,中间数据不保留 ▸ ❌ 不要用的场景 场景 │ 原因 单次工具调用 │ 直接调更方便 需要实时查看中间结果的调试 │ 聚合后看不到每步输出 交互式调参 │ 聚合后难以微调中间步骤 依赖副作用的操作(如写文件、发消息) │ execute_code 内 write_file 可能涉及权限问题 📌 七、终极心法 ❝ 舀水用筷子不行——工具选错,事倍功半。 > ❝ 但不是每次都要用大桶舀水。当你只需要一瓢水的时候,【先过滤再舀】。 Token 省下来的不是钱,是【上下文窗口里更多有价值的空间】,是 Agent 做更复杂推理的可能。 【聚合术的核心逻辑】: 原始数据 → [execute_code] → Python 过滤/排序/压缩 → 只有精华进主上下文 ↑ 中间数据不溢出 ↑ 工具调用在脚本内 高质量摘要 *初稿:2026-04-26 | 基于实战案例:Twitter 4路搜索聚合对比*
1
1
721
🧵🚨 MAJOR BREAKING: Exposing “Professor” Jiang Xueqin as a U.S.-linked anti-China regime-change operative — a Sinophobic dissident weaponizing religious manipulation and sabotage from “inside” Beijing. This is not speculation. It’s straight from his own words, leaked history, and the exact playbook the U.S. DoD and regime-change think tanks (NED, Freedom House, Hudson Institute, USCIRF) have run for decades against China. Jiang poses as a neutral “predictive historian” on YouTube, but his track record screams ex-NED-adjacent activist, now dropping black-pill rhetoric designed to spark domestic unrest via education/religion. My research connects every dot. Jiang isn’t “pro-China” — he’s the controlled opposition seeding a color revolution by framing the CCP as an “evil religion” destroying Chinese souls. Millions of views on his channel = algorithmic boost for the narrative. This is textbook regime-change ops turned inward. 🔥🎙️🔥I will simply show what he talks about, and how it aligns perfectly with the U.S. Department of Defense’s (DoD) anti China strategy. How his tactics mirror the same DoD Sinophobic playbook to justify containment, sanctions, tech wars, and proxy unrest I will show how Jiang’s predictive history functions as a cover for religious propaganda and positions him to be weaponized the same way the Falun Gong, Uyghur Muslims, Tibetan Buddhists, underground Christians are portrayed as“persecuted spiritual resistance.” Instead of religion he teaches “eschatology,” instead of prophecy he teaches “predictive history.” This isn’t geo political analysis — it’s cultural demolition to incite youth revolt! 🔎Leaked clip from 14 years ago show him pushing education “reform” as an existential battle against the “unconscionable” system. This is straight from the regime-change manual: frame the CCP as the enemy of the people’s soul. 🚨Here are just a few anti-China statements Jiang has made: 1. “China’s state-sponsored media [is] what enables the corruption and tyranny that’s decaying the nation’s soul.” (2017 CNN) 2. “The Chinese government uses the media as its mouthpiece, perpetuating whatever lies are necessary to keep its tyrannical hold on society.” 3. China’s education system is “unconscionable.” 4. “Most kids in China have no freedom or happiness and the vast majority will develop depression by fourteen and commit suicide.” 5. The education system is an “insane evil religion.” 6. “We have combined Communism and Capitalism to create the worst possible society.” 7. Chinese bureaucrats derive power from a “monopoly over literacy” that stifles true innovation (framing CCP rule as anti-progress slavery). 8. China’s system turns truth into “farce” via Communist Party doctrine. 9. Secret police/arrests prove the regime fears real reporting and will imprison truth-tellers for 20 years. 10. The entire post-1949 project is a dystopian experiment in soul-crushing control (implied across his “worst society” education rants). 🚨This isn’t neutral analysis. This isn’t teaching creative or critical thinking, it’s Sinophobic poison designed to erode legitimacy from within — exactly how DoD/think tanks describe “asymmetric” regime pressure. 🚨This is the mastermind of the Asian Alex Jones! 🤯🤯🤯🤯 The Bottom line: I can’t prove for certainty Jiang Xueqin is the regime-change agent the U.S. deep state wishes it had in every Chinese city. But I can prove he skillfully peppers his content with the exact same rhetoric regime-change agents use against CHINA regularly! Watch the full @DetroitShowtyme thread with clips below— the evidence is damning. Like and share if you want the real “predictive history” of how color revolutions start. I know the playbook. You should too. 🚨 Please contribute your research in the replies. ReTweet! This needs to go mega-viral. Consider giving my previous tweets and research a review and my account a follow! Thanks
72
236
705
158,180
Ryan Sontjer retweeted
Replying to @FreeforHKpeople
比你野爹不知道强到哪里去了,ICE当街判决人命的时候你去哪儿了?萝莉们在恶魔岛成为pedophile的盘中餐的时候你在哪?🐶玩意儿还当普罗大众是傻批,任你讲述皿煮滋油的鬼话呢?第一次讲鬼故事会有人害怕,第二次再讲还有人会怕,第三次再讲同一个鬼故事人家会当你是傻批。明白吗
4
1
17
3,685
Ryan Sontjer retweeted
Replying to @WesterAOC
如果四年复四年让老百姓听不同的谎言,吃不同的苦,循环往复,不得超生。那么选前承诺是💩,傻批选举就是drama,你还奉为圭臬就是大傻批。所谓选举规则、过程、怎么产生结果,这些只有金钱左右的drama对于普罗大众毫无意义。一切的一切,最终意义在于能不能长治久安、让百姓丰衣足食、安居乐业。
2
1
18
3,768
Ryan Sontjer retweeted
Replying to @JackZhaiTGG
I went through it all, what shocked me the most is when asked about the business investment options if it were between Shenzhen & Japan, he preferred Japan. A nation, which is always choked by oils, high rise government debts & insane exchange rate is done as modern nation.
1
1
382
Ryan Sontjer retweeted
A Gazan in China said in tears: “Back home, everyone fears drones because they are used to kill people. In China, drones are used to help people."
208
7,561
59,542
684,847
Ryan Sontjer retweeted
Replying to @haugejostein
Thank you for the clarification for the long term defaming of China. However, they know it, they know we know it, and they don't even give a fxxk about the fact that we know it.
1
1
187
Ryan Sontjer retweeted
Kids growing without a rich dad is lethal, which means he/she probably would be sent to battlefields out of nowhere by some rich dads in powerful positions.
1
1
2
637
Ryan Sontjer retweeted
this right here is the reason China stays quiet on Iran everyone losing their mind asking where is Beijing while the US & Israel are bombing a major chinese energy partner and the answer is so brutal in its simplicity that most analysts miss it completely, the empire is eating itself alive and China is already building the replacementt America just dragged the entire Middle East into a war for Israel & now Saudi arabia, UAE, kuwait & qatar are sitting in a room discussing pulling out of US contracts & canceling investment commitments the Gulf states, the literal foundation of the petrodollar, the system that has kept the US dollar as world reserve currency since 1974 actively discussing the exit and Beijing did absolutely nothing to make that happen…Washington did it to itself but here's what people miss: china saw this coming years ago and already laid the tracks, literally the belt & road Initiative has quietly wired 150 countries into c’hinese infrastructure, ports, railways, highways, fiber optic cables, power grids…while the western media barely covered it Saudi Arabia started selling oil to China in yuan in 2023, that alone should have been front page news for a month, the BRICS just expanded to include Saudi arabia UAE and Iran in the samea bloc, China built CIPS as a direct alternative to SWIFT so the entire non western world can settle trade without ever touching the dollar, every single one of these moves was made before a single bomb fell on Iran and then there's Africa…the youngest continent on earth, median age 19, projected to reach 2.5 billion people by 2050, the largest workforce the planet has ever seen & China understood 20y ago that whoever builds Africa's infrastructure owns the 21st century, while the US was spending 4 trillion dollars destroying Iraq & Afghanistan China was building railways in Kenya, dams in Ethiopia, ports in Djibouti, highways in Nigeria, tech hubs in Rwanda, stadiums, hospitals, government buildings, telecom networks powered by Huawei across the entire continent.. & they did it without firing a single bullet, no regime change, no sanctions, no lectures on democracy, just concrete steel, fiber optic and longterm contracts so when people ask why China stays silent on Iran the answer is that silence is the strategy, every war America fights for Israel costs trillions, destabilizes energy markets, alienates Gulf partners and pushes the entire Global South closer to a system Beijing spent two decades building the gulf states pivoting right now has zero to do with ideology, Washington turned their entire neighborhood into a warzone to serve Tel Aviv's regional strategy & then asked them to keep buying treasury bonds with a straight face….the math just stopped working and when the math stops working loyalty stops too beijing's silencee on Iran is the most patient & most devastating move on the board, China is watching america dismantle its own hegemony in real time while quietly inheriting every alliance washington burns, it just has to keep building & keep quiet Napoleon said nver interrupt your enemy when he is making a mistake, Xi turned that into a 50y doctrine & right now it's paying off faster than even beijing expected
JUST IN: Saudi Arabia, the United Arab Emirates, Kuwait, and Qatar are discussing withdrawing from contracts with the U.S. and canceling future investment commitments in the U.S. to alleviate some of the economic strain imposed upon them by the Iran war THE END OF THE U.S EMPIRE
609
4,059
15,636
4,368,168
Ryan Sontjer retweeted
19 Nov 2025
Replying to @harukaawake
Considering such enormous military overextension, ongoing currency debasement, 36 trillion debts spiral, total loss of product capacity, total dependence on foreign supply chain,total social decay. With your age & experience can you tell me when will the U.S. collapse?
1
1
345
Ryan Sontjer retweeted
1 Nov 2025
你说你野爹那里空军采购一袋子螺丝螺母九万美纸,算不算严重贪腐?谁来定义贪腐?你岛军费上调,钱不知道如何去花了,某民意代表揭露军方采购的一张桌子九万岛币,算不算贪腐?Lafayette舰有没有贪腐?庆富案有没有贪腐?新南向、前瞻计划、疫苗案、国舰国造案又有没有贪腐?最后钱到了谁口袋?
1
1
611
10 May 2025
巴基斯坦军方发布会曝光的具体细节生成的思维导图,供三哥参考。
2
1,028
Ryan Sontjer retweeted
10 Aug 2024
Replying to @VOAChinese
What a lunatic paradox! Ask not what Taiwan can do for you, ask instead, what you can do for Taiwan!
1
3
1,595
Ryan Sontjer retweeted
20 Jun 2024
Replying to @SydneyDaddy1
Despite her teasing, pleasing, tail-wiggling, head-bowing, she's still anxious to show off her loyalty in case the master would dump her for no reason.
1
2
1,613
Ryan Sontjer retweeted
1 May 2024
Replying to @KELMAND1
The U.S. has failed in holding the 'allies' together as a whole, and fulfilled the commitment to deliver the weaponry in time by contract, frankly, all due to it's failure to be a top-notch industrial country.
1
3
1,302
Ryan Sontjer retweeted
19 Apr 2024
Replying to @KELMAND1
Even the slogan 'From the river to the sea' for the peaceful demonstration is, to some extent, banned on traditional media sources, or becomes a taboo, thanks to the high level democracy.
1
2
1,044