Inter-agent message compression and token budget management for multi-agent LLM systems
Project description
pyagent-compress
Inter-agent message compression and token budget management for multi-agent LLM systems. Reduce token costs without losing key information.
Install
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
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyagent_compress-0.1.0.tar.gz.
File metadata
- Download URL: pyagent_compress-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3c34225ef9bf6e1cbc2702c07b6f7adc9d9a9b98a20e582f0ce148066d2ca02
|
|
| MD5 |
fc5b461f41fca7dc7b8096dfae65da22
|
|
| BLAKE2b-256 |
01b96d139b89e72cc70aa0548c334fbb91980509a582d3c1cb6250c48bf2d8cd
|
File details
Details for the file pyagent_compress-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyagent_compress-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2c7e28d5ee06a086a9c44fa9ad840cda72e8377b71227c470e88ba52ebcb227
|
|
| MD5 |
a7f771df2a8ff7eba9f50034a93ed55e
|
|
| BLAKE2b-256 |
860bddb8d73586455fe9dae254e892448ed835fc5e56a7b8c9a90110d99301a9
|