headroom
社区使用中by headroomlabs-ai
Headroom 是一个面向 AI Agent 的上下文压缩层,可在内容到达 LLM 之前压缩工具输出、日志、文件、RAG 块及对话历史,在保持答案质量的前提下显著减少 token 消耗(JSON 数据可减少 60-95%,编码 Agent 减少 15-20%)。它以 Python/TypeScript 库、代理服务器、MCP server 及命令行包装器等多种形式提供,支持
安装配置
将以下配置添加到你的 AI 编程助手中
预览配置(粘贴到 claude_desktop_config.json 或 Cursor 设置中)
{
"mcpServers": {
"headroom": {}
}
}启动命令
npm install headroom-ai # TypeScript SDK only — noJSON配置
{}描述
<p align="center"><a href="https://trendshift.io/repositories/20881" target="_blank"><img src="https://trendshift.io/api/badge/repositories/20881" alt="chopratejas%2Fheadroom | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a></p>
Headroom compresses everything your AI agent reads — tool outputs, logs, RAG chunks, files, and conversation history — before it reaches the LLM. Same answers, fraction of the tokens.
<p align="center"> <img src="HeadroomDemo-Fast.gif" alt="Headroom in action" width="820"> <br/><sub>Live: 10,144 → 1,260 tokens — same FATAL found.</sub> </p>What it does
- Library —
compress(messages)in Python or TypeScript, inline in any app - Proxy —
headroom proxy --port 8787, zero code changes, any language - Agent wrap —
headroom wrap claude|codex|grok|copilot|cursor|aider|opencode|cline|continue|goose|openhands|openclaw|vibe|omp|zcodein one command; undo withheadroom unwrap <tool> - MCP server —
headroom_compress,headroom_retrieve,headroom_statsfor any MCP client - Cross-agent memory — shared store across Claude, Codex, Gemini, Grok, auto-dedup
headroom learn— mines failed sessions, writes corrections toCLAUDE.local.md(default, gitignored) orCLAUDE.md/AGENTS.md/GEMINI.md/GROK.md- Output token reduction — trims what the model writes back (not just what you send): drops ceremony/restated code and skips deep "thinking" on routine steps. See Output token reduction.
- Reversible (CCR) — originals are cached for retrieval on demand
How it works (30 seconds)
Your agent / app
(Claude Code, Cursor, Codex, LangChain, Agno, Strands, your own code…)
│ prompts · tool outputs · logs · RAG results · files
▼
┌────────────────────────────────────────────────────┐
│ Headroom (runs locally — your data stays here) │
│ ──────────────────────────────────────────────── │
│ CacheAligner → ContentRouter → CCR │
│ ├─ SmartCrusher (JSON) │
│ ├─ CodeCompressor (AST) │
│ └─ Kompress-v2-base (text, HF) │
│ │
│ Cross-agent memory · headroom learn · MCP │
└────────────────────────────────────────────────────┘
│ compressed prompt + retrieval tool
▼
LLM provider (Anthropic · OpenAI · Bedrock · …)
- ContentRouter — detects content type, selects the ri…
统计信息
66k
星标
5.1k
Fork
Python
语言
2026/8/16
更新
Apache-2.0
开源协议
标签
相关服务器
MODULAR-RAG-MCP-SERVER
MODULAR-RAG-MCP-SERVER 是一个可插拔、可观测的模块化 RAG(检索增强生成)服务框架,通过 MCP 协议对外暴露工具接口,支持 Copilot、Claude 等 AI 助手直接调用。项目涵盖混合检索、多模态图像处理、RAG 评估与全链路追踪等核心能力,并内置 Skill 驱动开发流程,适合作为大模型岗位的学习与面试实战项目。
private-gpt
PrivateGPT 是一个开源 API 层,将本地模型转化为生产级 AI 应用,提供 RAG、工具调用、MCP 连接器、text-to-sql 等能力。它本身不运行模型,而是通过 OpenAI 兼容接口连接 Ollama、vLLM 等推理服务器,并遵循 Claude API 规范,适合构建私有化、本地部署的 AI 产品。
anki-mcp-server
anki-mcp-server 是一个基于 Model Context Protocol (MCP) 的服务器,使 AI 助手能够与 Anki 间隔重复闪卡应用进行交互。它提供 42 个 MCP 工具,涵盖复习、卡片管理、笔记编辑等操作,支持自然语言驱动的个性化学习体验,并可与 Claude Desktop 等 AI 客户端集成。该项目处于 Beta 阶段,适合希望将 AI 能
SurfSense
SurfSense 是一款开源的 NotebookLM 替代品,专为 AI agents 设计,提供开放网络研究平台。它通过统一的 REST API 或 MCP server 连接 Reddit、YouTube、Instagram、Google Search 等实时数据源,返回结构化 JSON 数据,并内置知识库、引用检索与自动化报告功能。项目支持自托管,适合需要实时网络数据与