Dev.to
7/18/2026

Deterministic serialization for multi-agent LLM sessions - 3.45x fewer tokens than JSON, up to 9.9x for non-English content
Short summary
An open-source deterministic serialization protocol (SCP) that replaces JSON and natural language in multi-agent LLM communication with compact ID-stack strings resolved against a dictionary. Benchmarked on cl100k_base, it uses 3.45x fewer tokens than JSON and up to 9.9x fewer for non-English languages like Hindi. The protocol works for structured enumerable fields only, includes encoder/decoder Python code, and integrates with OpenAI and Anthropic prompt caching for further cost savings.
- •SCP protocol replaces JSON inter-agent messages with compact ID-stack strings, cutting tokens 3.45x
- •Non-English content sees 5-10x token reduction since tokenizer vocabularies are English-dominated
- •Works only for structured fields with fixed value spaces; natural language NLU still needed for initial parsing
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



