我构建了一种方法,防止巨大的工具输出撑爆AI代理的上下文窗口
摘要
LeanCTX已更新,作为管理AI代理工具输出的网关,压缩大数据,擦除秘密,并通过MCP集成外部工具,以防止令牌爆炸。
相似文章
我构建了一个A2A上下文总线,帮助你确保每个智能体使用相同的优化上下文。
作者描述了在LeanCTX中构建一个A2A上下文总线的过程,使得多个AI智能体能够共享和同步项目上下文,解决了智能体视图孤立的问题,并实现了上下文在项目之间的可移植性。
@akshay_pachaar: https://x.com/akshay_pachaar/status/2053166970166772052
The article discusses a shift in AI agent tool usage from the 'MCP vs CLI' debate to 'Code Mode,' where agents write code to dynamically import tools, significantly reducing context window usage. It highlights Anthropic's approach and Cloudflare's implementation, demonstrating a 98.7% reduction in token consumption for specific tasks.
@hasantoxr: 所以我发现了一个GitHub仓库,它可以阻止AI代理无谓地消耗token。它叫Headroom。它是由一位……
Headroom是Netflix的Tejas Chopra开发的一个GitHub工具,它能在将输入(工具输出、日志、RAG块等)发送给LLM之前进行压缩,承诺在不改变答案的前提下减少60–95%的token。它支持Python/TypeScript库、本地代理、MCP服务器,以及针对流行编程代理的封装器。
@rwayne: Context Mode 解决了 AI Agent 的另一半上下文问题:工具输出沙箱化 + 会话持久化。 56 KB 的 Playwright 快照压缩到 299 字节,98% 的数据不进上下文。每次文件编辑、Git 操作、任务决策都存入…
Context Mode is a tool that solves AI agent context problems by sandboxing tool outputs and persisting sessions, achieving up to 98% compression of Playwright snapshots and using BM25 retrieval to reduce context window usage. It supports 15 platforms including Claude Code, Gemini CLI, VS Code Copilot, and is used by major tech companies.
@tom_doerr: 将 Claude Code 和 Cursor 的 token 成本降低 60-95% https://github.com/yvgude/lean-ctx
lean-ctx 是一个基于 Rust 的开源上下文运行时,通过文件读取压缩和 Shell 输出优化,将 Claude Code、Cursor、Copilot 等 AI 编程助手的 token 成本降低 60–95%。它以 Shell Hook 和 MCP Server 的形式运行,提供 56 个工具及多种读取模式。