显示HN:上下文网关 – 在到达LLM之前压缩代理上下文
Show HN: Context Gateway – Compress agent context before it hits the LLM

原始链接: https://github.com/Compresr-ai/Context-Gateway

## Compresr:AI 智能体即时上下文管理 Compresr 是一家YC支持的解决方案,旨在解决 Claude Code 和 Cursor 等 AI 智能体使用的 LLM(大型语言模型)的上下文长度限制。他们的 **Context Gateway** 充当中间人,在达到上下文限制*之前*悄无声息地压缩对话历史记录,从而消除令人沮丧的压缩等待时间。 安装只需一条命令即可完成。安装后,一个引导向导将帮助您为特定智能体配置网关,选择摘要模型,并设置压缩触发器(默认情况下为 75% 上下文使用率)。 Compresr 支持 Claude Code、Cursor、OpenClaw 和自定义智能体配置。它通过在后台预先计算摘要来工作,即使在进行长时间对话时也能确保即时响应时间。用户可以通过日志监控该过程。 Compresr 欢迎贡献 – 加入他们的 Discord 以获取更多信息并参与其中!

## 上下文网关:压缩LLM上下文以提升Agent性能 一个新的开源代理,**上下文网关** (github.com/compresr-ai),旨在通过智能压缩发送给大型语言模型 (LLM) 的上下文,来提升像Claude Code和OpenClaw这样的编码代理的性能。 核心问题:代理经常会将来自工具输出(如文件读取或grep结果)的无关“噪音”充斥到LLM上下文窗口中,从而降低准确性——这个问题会随着更长的上下文窗口而加剧。 上下文网关使用小型语言模型 (SLM) 来识别并保留工具输出中最具*信息量*的部分,压缩其余部分。它还具有工具描述的延迟加载和背景上下文压缩功能。用户可以获得消费上限、会话仪表板和Slack提醒。 早期反馈质疑与现有LLM压缩相比的速度提升,并对第三方工具修改关键上下文表示担忧。一些开发者认为此功能应该构建在代理框架*内部*,而不是作为独立产品存在。
相关文章

原文

Compresr

Instant history compaction and context optimization for AI agents

WebsiteDocsDiscord


Compresr is a YC-backed company building LLM prompt compression and context optimization.

Context Gateway sits between your AI agent (Claude Code, Cursor, etc.) and the LLM API. When your conversation gets too long, it compresses history in the background so you never wait for compaction.

# Install gateway binary
curl -fsSL https://compresr.ai/api/install | sh

# Then select an agent (opens interactive TUI wizard)
context-gateway

The TUI wizard will help you:

  • Choose an agent (claude_code, cursor, openclaw, or custom)
  • Create/edit configuration:
    • Summarizer model and api key
    • enable slack notifications if needed
    • Set trigger threshold for compression (default: 75%)

Supported agents:

  • claude_code: Claude Code IDE integration
  • cursor: Cursor IDE integration
  • openclaw: Open-source Claude Code alternative
  • custom: Bring your own agent configuration
  • No more waiting when conversation hits context limits
  • Compaction happens instantly (summary was pre-computed in background)
  • Check logs/history_compaction.jsonl to see what's happening

We welcome contributions! Please join our Discord to contribute.

联系我们 contact @ memedata.com