显示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代理上下文 一个新的开源代理,**上下文网关** (https://github.com/Compresr-ai),旨在通过在工具输出到达LLM *之前*对其进行压缩,来提高编码代理(如Claude Code)的性能。它解决的核心问题是“上下文衰退”—— 随着上下文窗口变得过大,即使token限制增加,准确性也会下降。 该网关使用小型语言模型 (SLM) 来识别并仅保留基于工具意图的最相关信息。它提供主动压缩、工具描述的延迟加载、支出上限、会话跟踪和Slack警报等功能。一个关键功能是 `expand()` 函数,允许模型在需要时请求原始的、未压缩的数据。 讨论集中在该项目的商业模式(可能被收购)、LLM提供商(如Anthropic)添加类似功能(如他们新的1M上下文窗口)时可能存在的冗余,以及压缩是否优于总结(网关开发者认为压缩可以避免信息丢失)。 用户也在探索它与现有解决方案的比较,以及它对速度和输出质量的影响。
相关文章

原文

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