Spaces:
Build error
Build error
Commit History
-
feat: Add AWS Strands Agents SDK integration
## Description Add Headroom integration with AWS Strands Agents SDK, enabling automatic context optimization and tool output compression for Strands-based agents. Fixes #14 ## Type of Change - [x] New feature (non-breaking change that adds functionality) - [x] Documentation update ## Changes Made ### Core Integration (`headroom/integrations/strands/`) - **HeadroomHookProvider** - Implements Strands `HookProvider` interface for automatic tool output compression via `AfterToolCallEvent`. Compresses verbose tool outputs before they enter conversation context. - **HeadroomStrandsModel** - Model wrapper that extends Strands `Model` base class for message-level optimization. Implements all required abstract methods: `stream()`, `get_config()`, `update_config()`, `structured_output()`. - **Provider auto-detection** - Automatically detects appropriate Headroom provider (Anthropic, OpenAI, Google) based on wrapped Strands model type. - **`strands-agents` as optional dependen…2550bb7
-
docs: update documentation for IntelligentContext TOIN + CCR integration
Updates across multiple docs to reflect the new message-level compression with TOIN + CCR integration: - docs/ccr.md: Add CCR-enabled components table, message-level CCR section - docs/ARCHITECTURE.md: Expand Transform 6 with TOIN + CCR integration details - docs/configuration.md: Add CCR integration config and marker format - docs/proxy.md: Add CCR integration note for context management - docs/README.md: Update to reference IntelligentContextManager as default Also adds examples/test_intelligent_context_toin_ccr.py for scale testing the TOIN + CCR integration with real API calls.485ea38 -
Add hierarchical memory system with graph + vector storage
Implement comprehensive memory system supporting: - Local backend (SQLite + FTS5 + HNSW) for zero-dependency operation - Mem0 backends (Neo4j + Qdrant) for production graph memory - DirectMem0Adapter for optimized pre-extracted data (bypasses LLM) - Memory extraction with facts, entities, and relationships - Proxy integration with --memory flag for automatic memory injection Key components: - headroom/memory/backends/: LocalBackend, Mem0Backend, DirectMem0Adapter - headroom/memory/system.py: MemorySystem with tool-based interface - headroom/memory/extraction.py: Entity and relationship extraction - headroom/proxy/memory_handler.py: Proxy integration layer - headroom/prediction/feature_extractor.py: Content analysis features Testing: - 217 new memory system tests covering all backends - LoCoMo evaluation framework for memory quality assessment - Integration tests for proxy memory functionality Also removes deprecated example files in favor of focused test coverage.eb1c19a
-
Add quality retention eval and fix linting for Python 3.12
- Add quality_retention_eval.py for needle-in-haystack testing to verify intelligent compression retains critical information (100% retention achieved) - Add intelligent_context_integration_test.py for comprehensive pipeline testing - Add test_progressive_summarizer.py with 36 tests for ProgressiveSummarizer - Add HeadroomConfig parameter to HeadroomClient for direct config injection - Update pipeline.py with IntelligentContextManager wiring and logging - Fix all ruff linting issues and format for Python 3.12 compatibility - Add comprehensive_eval.py benchmark for multi-scenario evaluation - Add real_data_demo.py for production-scale volume testing - Add reasoning agent test examples (groq, debug)bd2d447 -
Merge pull request #6 from smartwatermelon/claude/docs-macos-deployment-20260119
Add macOS LaunchAgent deployment guide and templates18e01a0
-
fix(deployment): correct port placeholder in LaunchAgent plist template
Claude Code Bot +1: Claude Sonnet 4.5The plist template was using ${HEADROOM_PROXY_PORT} in ProgramArguments, but LaunchAgent doesn't expand environment variables in that context. Changed to use __PORT__ placeholder which install.sh replaces via sed. This fixes the "invalid int value" error when starting the proxy service. AI review: Clean (via pre-commit hook) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>063b6e8 -
docs(deployment): add macOS LaunchAgent deployment guide and templates
Claude Code Bot +1: Claude Sonnet 4.5Add comprehensive macOS deployment support for running headroom proxy as a persistent background service using LaunchAgent. This enables automatic startup, crash recovery, and proper lifecycle management for local development environments. Files added: - examples/deployment/macos-launchagent/com.headroom.proxy.plist.template - examples/deployment/macos-launchagent/install.sh (shellcheck-clean) - examples/deployment/macos-launchagent/uninstall.sh (shellcheck-clean) - examples/deployment/macos-launchagent/shell-integration.sh (bash + zsh) - examples/deployment/macos-launchagent/README.md - docs/macos-deployment.md Key features: - Configurable port via HEADROOM_PROXY_PORT environment variable (default: 8787) - Automated installation and uninstallation scripts - Shell integration supporting both bash and zsh - Comprehensive documentation with troubleshooting guide - All shell scripts are shellcheck-clean (zero errors, warnings, or info messages) Files modified: - .gitignore: Added CLAUD…3ac2620 -
Fix HeadroomAgnoModel to optimize tool outputs at invoke level
Previously, HeadroomAgnoModel called wrapped_model.response() which ran the tool execution loop internally. This meant tool outputs (often 60k+ chars) were never optimized - only the initial messages were compressed. The fix delegates response() to the inherited Model.response(), which calls self.invoke() for each API call. Our invoke() override optimizes messages before delegating to wrapped_model.invoke(), ensuring tool outputs are compressed on every API request. Results from multi_tool_agent_test.py with Claude Sonnet: - Tokens before optimization: 25,713 - Tokens after optimization: 6,100 - Tokens saved: 19,613 (76.3%) - Both baseline and optimized found all critical information Also adds: - multi_tool_agent_test.py: Real function calling test with 4 tools - multi_tool_compression_test.py: Direct compression test - README update with multi-tool agent test results39a55b4 -
Rewrite README with verified before/after examples
- Replace marketing claims with actual API test results - Add needle-in-haystack test: critical error at position 67/100 - Show real JSON compression: 100 entries → 6 entries (93.9% reduction) - Verified with Claude Sonnet: 87.6% fewer tokens, 4/4 correct answers - Add example scripts for reproducing the tests8766d83
-
Add persistent memory system with zero-latency inline extraction
Features: - with_fast_memory(): Zero-latency inline extraction (Letta-style) - Memory extracted as part of LLM response, no extra API calls - Semantic retrieval with local embeddings (sub-50ms) - with_memory(): Background extraction for non-blocking memory - SQLite + FTS5 storage with vector similarity search - Multi-user isolation by user_id Memory enables temporal compression - extract key facts instead of carrying full conversation history (4000 tokens → 50 tokens). Includes: - Comprehensive test suite (71 new tests) - Documentation (docs/memory.md) - Benchmark examples comparing approaches - E2E test with LLM-as-judge evaluation9c9bb30
-
v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs
Features: - CCR Response Handler: Automatically intercepts and handles headroom_retrieve tool calls - CCR Context Tracker: Multi-turn awareness with proactive expansion of relevant compressed content - New CCR demo script showing before/after flow Documentation: - Restructured README from 885 lines to 190 lines for better DevEx - Split detailed docs into focused guides: ccr.md, sdk.md, configuration.md, text-compression.md, llmlingua.md, metrics.md, errors.md - Updated docs/README.md index with all new documentation Tests: - Added comprehensive tests for Response Handler (32 tests) - Added comprehensive tests for Context Tracker (32 tests) - All 977 tests passingd724f14
-
Fix all ruff lint and format errors for CI
- Fix E402: Move module-level imports to top of file - Fix F401: Add noqa for availability check imports - Fix F402: Rename loop variables shadowing imports - Fix E722: Replace bare except with except Exception - Fix B904: Add exception chaining (from e) - Fix F811: Remove duplicate imports - Fix B027: Add noqa for empty close() method - Fix E741: Rename ambiguous variable l -> label - Fix I001: Import sorting issues - Apply ruff format to all 106 files All 902 tests pass.e4a41fa -
Publish headroom-ai v0.2.0 to PyPI with DevEx fixes
- Renamed package from 'headroom' to 'headroom-ai' (PyPI name conflict) - Fixed numpy/jinja2 imports to be lazy (core install no longer crashes) - Fixed SQLite default path (now uses temp directory) - Fixed f-string {tool} crash in proxy server - Updated README with correct package name and examples - Added quickstart and troubleshooting docs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>90d3aea
-
Prepare for OSS release v0.2.0
This commit prepares Headroom for public open source release with comprehensive documentation, licensing, and community infrastructure. License & Legal: - Add Apache 2.0 LICENSE file - Add NOTICE file with third-party attributions - Add SECURITY.md for vulnerability reporting Community: - Add CONTRIBUTING.md with contribution guidelines - Add CODE_OF_CONDUCT.md (Contributor Covenant) - Add GitHub issue templates (bug report, feature request) - Add pull request template Documentation: - Update README.md with compelling value proposition - Add docs/getting-started.md - Add docs/proxy.md for proxy server documentation - Add docs/transforms.md for transform reference - Add docs/api.md for API reference - Add examples/README.md Package Infrastructure: - Add headroom/py.typed for PEP 561 compliance - Add headroom/cli.py for CLI entry point - Add .github/workflows/ci.yml for CI pipeline - Add .github/workflows/publish.yml for PyPI publishing - Update pyproject.toml with proper metadata N…175746c -
Initial commit: Headroom SDK - LLM context optimization toolkit
A comprehensive SDK for optimizing LLM context windows, reducing token usage while preserving critical information for AI agents. Core Features: - SmartCrusher: Statistical compression of tool outputs (70-85% reduction) - CacheAligner: Prefix optimization for prompt cache hits - RollingWindow: Intelligent context window management - BM25/Hybrid relevance scoring for smart item selection Integrations: - OpenAI and Anthropic provider support - LangChain integration (ChatModel, Callbacks, Runnable) - MCP (Model Context Protocol) integration for tool compression Test Coverage: - 372 tests passing across all modules - 35 performance benchmarks - Real-world agent evaluations with 88% token savings Key Components: - headroom/transforms/: Core compression transforms - headroom/providers/: OpenAI and Anthropic support - headroom/integrations/: LangChain and MCP integrations - headroom/relevance/: BM25 and hybrid scoring - headroom/pricing/: Model pricing registry - benchmarks/: Performance …9c7d451