Metadata-Version: 2.4
Name: pyagent-compress
Version: 0.1.0
Summary: Inter-agent message compression and token budget management for multi-agent LLM systems
License: MIT
Keywords: LLM,agents,compression,efficiency,tokens
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pyagent-patterns>=0.1.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# pyagent-compress

**Inter-agent message compression and token budget management** for multi-agent LLM systems. Reduce token costs without losing key information.

## Install

```bash
pip install pyagent-compress
```

## Components

- **MessageCompressor** — Reduce message size by removing filler and ranking sentences
- **AgentPruner** — Detect and remove non-contributing agents
- **InteractionPruner** — Detect consensus and prune redundant rounds
- **TokenBudget** — Enforce per-agent and per-workflow token limits
- **CompressMiddleware** — Auto-compress agent outputs

## Quick Example

```python
from pyagent_compress import MessageCompressor, TokenBudget

compressor = MessageCompressor(target_ratio=0.5)
result = compressor.compress("Let me think about this... Basically, revenue grew 15%.")
print(f"Savings: {result.savings_pct:.0%}")

budget = TokenBudget(workflow_limit=50_000, per_agent_limit=10_000)
budget.consume("agent_a", 3000)
```
