AI Compact Protocol - Token-efficient communication for multi-agent systems.
AICP is a compact, line-oriented wire format that reduces AI-to-AI communication tokens by 50-65% compared to JSON. It uses shared glossaries for compression and supports translation to/from human-readable formats.
Multi-agent systems waste tokens on verbose JSON/HTTP chatter. AICP cuts costs by using:
python
from aicp_protocol import Session, Message
# Create compact message
session = Session(version="1", session_id="demo-001")
session.glossary = {"R1": "customer_refund_window"}
session.messages.append(Message(
op="upd", ref="ticket/8812", fields={"status": "closed", "reason": "R1"}
))
# To wire format (~63% fewer tokens than JSON)
wire = session.to_wire()
text
VER:1
SID:demo-001
GLOSS: R1=customer_refund_window
MSG:
op:upd ref:ticket/8812 status=closed reason=R1
opMeaningupdUpdate resourcecreateCreate resourcedelDeleteqryQueryackAcknowledgenotifyNotify
bash
clawhub install aicp-protocol
Or manual:
bash
git clone https://github.com/christen-family/aicp-protocol
cd aicp-protocol
Full specification and examples in the GitHub repo.
MIT - Christen Family Open Source