2025-05-15

28 篇热帖

1. Human (quarter--mile.com)

Human Written by a human [0] Imagine, for a moment, a world with no humans. Just machines, bolts and screws, zeros and ones. There is no emotion. There is...

2. Malicious compliance by booking an available meeting room (www.clientserver.dev)

In 2011, Larry Page became CEO of Google and tried to fix meetings. But his new policies were no match for Google Calendar pedants.

3. LLMs get lost in multi-turn conversation (arxiv.org)

Abstract page for arXiv paper 2505.06120: LLMs Get Lost In Multi-Turn Conversation

4. Coinbase says hackers bribed staff to steal customer data, demanding $20M ransom (www.cnbc.com)

The incident may cost Coinbase up to $400 million to fix, the company estimated.

6. New research reveals the strongest solar event ever detected, in 12350 BC (phys.org)

An international team of scientists has discovered an extreme spike in radiocarbon corresponding to the year 12350 BC during the dusk of the last Ice Age. However, the strength of the event could not be assessed earlier because of the lack of an appropriate model. It has now been identified as the most powerful solar particle storm known to date—a colossal space weather storm that struck Earth 14,300 years ago. This recent finding expands the timeline and intensity of known solar activity and sets a new upper boundary for such solar phenomena.

7. EU ruling: tracking-based advertising [...] across Europe has no legal basis (www.iccl.ie)

Landmark court decision against “TCF” consent pop ups on 80% of the internet

8. XAI's Grok suddenly can't stop bringing up "white genocide" in South Africa (arstechnica.com)

The topic has long been a hobbyhorse of X owner Elon Musk.

10. California sent residents' personal health data to LinkedIn (themarkup.org)

The state’s health insurance exchange transmitted pregnancy and domestic abuse data during a marketing campaign. It is reviewing its website practices.

11. Project Verona: Fearless Concurrency for Python (microsoft.github.io)

Research programming language for concurrent ownership

13. Show HN: Min.js style compression of tech docs for LLM context (github.com)

llm-min.txt:用于LLM上下文的技术文档压缩方案

核心概述

llm-min.txt 是一种受 min.js 启发、用于压缩技术文档的工具,旨在为大型语言模型提供高效、结构化的知识输入。它通过AI将冗长的文档提炼成超紧凑的结构化知识清单(SKF格式),解决了LLM知识截止、现有文档文件过大或依赖黑箱服务的问题。

问题与现有方案

LLM存在知识截止日期,导致其对最新软件库了解不足。现有解决方案包括:

  • llms.txt:社区贡献的参考文件,但文件可能极其庞大(超80万token),超过许多AI的上下文窗口限制。
  • Context7:动态提供上下文信息的服务,但其工作机制不完全透明,且主要适用于GitHub仓库或现有llms.txt文件。

解决方案:llm-min.txt

理念:借鉴Web开发中的min.js(去除冗余的JavaScript),为技术文档创建一个“机器优化”版本。 产出:一个llm-min.txt文件,使用结构化知识格式,仅包含理解一个库使用方法所必需的核心信息,格式专为AI助手优化,而非人类阅读。

结构化知识格式详解

llm-min.txt采用SKF格式,其核心结构如下:

  1. 头部元数据:包含格式标识、源文档、时间戳和主要命名空间。
  2. 三个核心部分
    • 定义部分:描述库的静态方面,如类、方法、属性等,每个条目有全局唯一ID。
    • 交互部分:捕获动态行为,如方法调用、组件使用、错误处理等。
    • 用法模式部分:提供具体的使用示例,展示核心功能的常见工作流。
  3. 配套指南文件llm-min-guideline.md 提供解码SKF格式所需的详细说明,是AI正确解释llm-min.txt的必备伴侣。

效果与优势

  • 显著压缩:与原始文档相比,token数量通常减少90-95%,甚至超过97%。
  • 高效解析:高度结构化的格式便于AI快速处理和理解。
  • 直接应用:在AI编码助手的对话中引用这些文件,助手即可立即获得该库的详细知识,提高代码生成成功率。

快速入门

  1. 安装
    • 用户:pip install llm-min && playwright install
    • 开发者:克隆仓库,创建虚拟环境,使用 uv sync 安装依赖。
  2. 配置API密钥:需要设置 GEMINI_API_KEY 环境变量或通过命令行提供。
  3. 生成文件:使用命令行工具。
    • 输入源选项
      • -i/--input-folder:处理本地文档文件夹。
      • -pkg/--package:处理Python包的文档网站。
      • -u/--doc-url:处理指定的文档网站URL。
    • 配置选项:包括输出目录、输出名称、库版本、爬取页面/深度限制、分块大小等。
    • 示例命令llm-min -pkg "typer" -o my_docs -p 50
  4. 编程使用:可通过 LLMMinGenerator 类集成到Python应用中。

工作原理

采用多阶段AI处理流程(使用Google Gemini模型):

  1. 输入处理:根据命令行选项从包、URL或本地文件夹收集文档。
  2. 文本准备:清洗文档并分块,原始文本保存为 llm-full.txt
  3. 三步AI分析流水线
    • 第一步:生成全局术语表(内部使用,不输出):识别技术实体并分配全局ID。
    • 第二步:生成定义与交互:基于术语表和文档块,提取并累积结构化的定义和交互条目。
    • 第三步:生成用法模式:基于已生成的定义、交互和文档块,提取并累积具体的使用模式。
  4. 最终组装:将头部、三个核心部分组装成最终的 llm-min.txt 清单文件。

未来计划

  • 预生成文件公共仓库:建立社区共享平台,避免用户重复生成。
  • 基于代码的文档推断:探索通过源代码分析(AST)自动生成文档摘要。
  • MCP服务器集成:当前设计更偏向提供可靠的静态上下文,暂不优先考虑。

常见问题

  • 需要什么模型生成? 生成需要强推理能力的模型(如Gemini),但生成的文件可供任何有能力的编码模型使用。
  • 是否保留所有信息? 否,这是一种有损压缩,优先保留编程相关细节,省略解释性文字。
  • 生成为何耗时? 涉及多阶段AI分析,但生成一次后可重复使用。
  • 成本如何? 根据文档大小和复杂度,处理一个中等规模库预计花费0.01至1.00美元。
  • 能否离线处理? 可以,使用 --input-folder 处理本地文件时,只需在压缩阶段调用Gemini API。

项目信息

  • 许可证:MIT
  • 贡献:欢迎通过GitHub仓库提交问题报告、功能建议和代码更改。
14. Show HN: Semantic Calculator (king-man+woman=?) (calc.datova.ai)

Semantic calculator for words. Compute and explore values of expressions like king - man + woman = queen.

15. Llama from scratch (2023) (blog.briankitano.com)

Llama from scratch

I want to provide some tips from my experience implementing a paper. I'm going to cover my tips so far from implementing a dramatically...

16. Show HN: Muscle-Mem, a behavior cache for AI agents (github.com)

Muscle-Mem:AI代理的行为缓存

muscle-mem 是一个用于AI代理的行为缓存Python SDK。其核心目标是让LLM脱离重复性任务的关键路径,通过缓存已学习的工具调用轨迹来提升速度、减少变异性和消除token成本,适用于那些“本可以成为脚本”的场景。

核心概念与工作原理

muscle-mem 并非代理框架,而是一个可以与现有代理集成的引擎。工作流程如下:

  1. 环境识别:引擎通过 Checks 判断当前环境是否与缓存的轨迹匹配(缓存命中)或为新环境(缓存未命中)。
  2. 任务执行
    • 命中缓存:确定性重放已学习的工具调用轨迹。
    • 未命中缓存:将任务交给你的代理处理。
  3. 轨迹收集:执行过程中,代理的工具调用事件会被收集并作为新轨迹添加到缓存中。

关键在于 缓存验证:用户需要为每个工具定义环境特征(通过 Checks),以确定在何种条件下可以安全重用缓存的操作。

主要功能与API

安装

pip install muscle-mem。API处于v0阶段,生产环境建议固定版本。

引擎 (Engine)

引擎封装你的代理,作为任务执行器。它管理缓存并决定何时调用你的代理。

from muscle_mem import Engine
engine = Engine()
engine.set_agent(your_agent).finalize()
# 调用代理
engine("do some task") # 首次缓存未命中,由代理执行
engine("do some task") # 再次调用,缓存命中,直接重放轨迹

可以使用 tags 参数为不同任务创建独立的缓存桶。

工具插桩 (Tool Instrumentation)

使用装饰器来记录代理调用的工具,以便引擎记录动作。

  • 函数工具@engine.function() 装饰普通函数。
  • 方法工具@engine.method() 装饰对象方法。需要使用 engine.set_context() 提供运行时对象(如API客户端),以在重放时注入为 self

检查 (Checks) - 缓存验证的核心

Check 是用于验证缓存是否安全使用的基本组件。每个 Check 包含:

  • capture 回调:从当前环境提取相关特征。
  • compare 回调:判断当前环境与缓存环境是否匹配。

可以将 Check 附加到工具装饰器上,作为 pre_check(执行前验证)或 post_check(执行后验证)。

顶层参数 (Top Level Parameters)

用于处理需要每次运行时动态变化的参数。例如表单填写中的用户名。通过 engine() 调用时的 params 参数指定。记录轨迹时,引擎会将工具调用中匹配的参数映射到顶层参数,使其在缓存重放时可以替换为新值。

示例与资源

文档末尾提供了一个整合所有概念的示例脚本,展示了一个带有基于时间戳检查的缓存行为。此外,还指向了一个更实际的计算机使用代理(CUA)实现示例。

项目鼓励反馈,提供了相关的博客文章链接和Discord社区入口。

17. Copaganda: How Police and the Media Manipulate Our News (www.teenvogue.com)

Alec Karakatsanis's new book Copaganda: How Police and the Media Manipulate Our News criticizes how the media covers — and enables — policing.

19. Show HN: Real-Time Gaussian Splatting (github.com)

Live Gaussian Splatting for RGBD Camera Streams. Contribute to axbycc/LiveSplat development by creating an account on GitHub.

20. My Engineering Craft Regressed (lemmy.ml)

Anubis 是网站管理员为保护服务器免受 AI 公司激进爬虫而设置的系统。爬虫活动会导致网站停机,使资源无法访问。该系统采用类似 Hashcash 的工作量证明方案:在个人用户层面,额外负载可忽略;但在大规模爬虫时,成本累积会使爬虫变得昂贵。这是一个临时解决方案,旨在为开发更精细的指纹识别技术(如通过字体渲染识别无头浏览器)争取时间,从而避免向更可能为合法用户的访问者显示挑战页面。Anubis 依赖现代 JavaScript 功能,因此用户需禁用 JShelter 等可能干扰这些功能的插件。

23. Pathfinding (juhrjuhr.itch.io)

Hello! I've recently been working on the pathfinding for NPCs in my game, which is something I've been looking forward to for a while now since it's a nice chunky problem to solve. I thought I'd write...

24. Show HN: Undetectag, track stolen items with AirTag (undetectag.com)

Make your AirTag more efficient against thieves

26. In the US, a rotating detonation rocket engine takes flight (arstechnica.com)

Hypersonics is one of the critical technologies to remain ahead of our national competitors."

27. Show HN: Turn any workflow diagram into compilable, running and stateful code (workflows.diagrid.io)

Upload your diagram and get code generated in your favorite language

28. MicroPython v1.25.0 (github.com)

MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems - Release ROMFS, alif port, RISCV inline assembler, DTLS, mpremote recursive remove · micropython/micropython