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
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.2.0.tar.gz.
File metadata
- Download URL: pyagent_compress-0.2.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
941957a091dc1b0704aa229372253aac95edcaedeb2440e1af242848b74a9e8e
|
|
| MD5 |
9ec67b4273d38d40f39590f04ed6ff45
|
|
| BLAKE2b-256 |
12a1b2fe0119eaf6cd1e219f18e55481c747671798c13ed15eecb73e35dbd449
|
Provenance
The following attestation bundles were made for pyagent_compress-0.2.0.tar.gz:
Publisher:
publish.yml on pyagent-core/pyagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyagent_compress-0.2.0.tar.gz -
Subject digest:
941957a091dc1b0704aa229372253aac95edcaedeb2440e1af242848b74a9e8e - Sigstore transparency entry: 1756483057
- Sigstore integration time:
-
Permalink:
pyagent-core/pyagent@00d72728c06b5339307ebe880888e9326c6d5e6e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pyagent-core
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00d72728c06b5339307ebe880888e9326c6d5e6e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyagent_compress-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pyagent_compress-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59fcb6de0fd9c2cc9be34f7c68899af8961b76869bc2c33f6ec297c69a0ff82e
|
|
| MD5 |
6b26c20bd2b78bcab542a9cdf823174f
|
|
| BLAKE2b-256 |
df40fb721fc047ff60b1e6d8ad2d3c9a3411cc4d460275e02c4bf3a6fae7902e
|
Provenance
The following attestation bundles were made for pyagent_compress-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on pyagent-core/pyagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyagent_compress-0.2.0-py3-none-any.whl -
Subject digest:
59fcb6de0fd9c2cc9be34f7c68899af8961b76869bc2c33f6ec297c69a0ff82e - Sigstore transparency entry: 1756483198
- Sigstore integration time:
-
Permalink:
pyagent-core/pyagent@00d72728c06b5339307ebe880888e9326c6d5e6e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pyagent-core
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00d72728c06b5339307ebe880888e9326c6d5e6e -
Trigger Event:
workflow_dispatch
-
Statement type: