Rethinking LLM Agent Communication Protocols: Practice and Low-Level Design
HTTP/JSON works well for people but is costly and clumsy for LLM agents. This article covers schema “token tax,” stateful handshake, protocol-level agent identity, and semantic metadata—plus a conceptual native protocol design, remaining limits, and a path that still fits cloud-native stacks.
When you run large-model inference and serving on general cloud infrastructure such as Baidu AI Cloud, the network protocol under the stack directly affects compute cost and latency. Connecting LLM agents to backend business logic and application orchestration often exposes a problem that is easy to miss and expensive to ignore: HTTP/JSON is well suited to humans, but inefficient and heavy for agents. This piece records the pain points we hit while redesigning a native agent communication protocol, the technical choices, and some lower-level thoughts on future architecture.
Starting point: the invisible “token tax”
If you have wired an LLM to a conventional REST backend, you have likely seen the same pattern: a large share of tokens is spent re-parsing the same data shape.
Take a typical paginated product API, GET /products. In JSON, every row and every page repeats field names such as id, name, price, description, category, and inventory. After the first row, the model already “knows” the mapping. HTTP/JSON has no notion that the schema is already in context, so the bytes still go over the wire, the tokenizer still walks every token, and you still pay for the redundancy.
Internal load tests on real traffic showed that on schema-dense APIs (catalogs, ledgers, social feeds, and similar), repeated schema often accounts for about 30% to 60% of response tokens. The exact share depends on the workload, but the issue is real. GraphQL can reduce unused fields, but field names still travel with every record, so redundancy is not solved at the root.
That observation alone would not justify a new protocol. Listing the ways HTTP feels wrong for agents produced a longer list and forced a look at the stack.
Three protocol-level challenges
When we tried to bind agents natively to orchestration, we kept hitting the following issues; the first three matter most.
1. Schema redundancy and the lack of a stateful protocol
JSON is stateless, so every payload must carry full structure. A stateful handshake helps: on first contact, the agent registers and caches schema. Later messages can send compact value arrays or binary streams, or refer to an agreed schema by index. That cuts token cost and leaves the context window for actual reasoning.
2. No first-class agent identity or scope
HTTP auth was built for human users (or services pretending to be them). When an LLM agent calls APIs on a user’s behalf, the protocol cannot answer in a standard way:
- Which authority issued this agent?
- What is its scope and permission boundary?
- Has the grant been revoked?
Today teams stuff a JWT in a Bearer header and hope the API gateway validates it. It works, but every team reinvent the same wheel, and identity logic sinks into business code. A native agent protocol should carry an identity claim in the header—trust-chain signatures, fine-grained scopes, and revocation checks—so gateways and servers can enforce security out of the box.
3. Semantic overhead: prompts instead of protocol
REST returns raw JSON; the model must infer what each field means. We end up writing heavy system prompts: created_at is a timestamp, status: 2 means shipped, category is an enum. That teaching happens at inference time, on every call. The protocol ignores it. Schema should carry machine-readable semantic metadata.
Design sketch: a native agent protocol
We tried to fuse semantics, identity, and transport. A conceptual comparison:
Typical REST JSON:
{"products": [{"id": 101, "name": "Laptop", "price": 999.99, "status": 2},{"id": 102, "name": "Mouse", "price": 19.99, "status": 1}]}
The model pays tokens for field names and still needs extra prompt text for status: 2.
Conceptual native response (after handshake):
{"schema_ref": "prod_list_v1","semantic_map": {"status": {"0": "pending", "1": "in_stock", "2": "shipped"}},"data": [[101, "Laptop", 999.99, 2],[102, "Mouse", 19.99, 1]]}
In this shape:
- Schema compression.
schema_refpoints at the cached field list from the handshake; the payload is compact arrays, so token use drops sharply. - Semantics in the protocol.
semantic_mapmoves enum meaning out of the system prompt. The agent framework can map2to “shipped” before the LLM sees the data, reducing reasoning load. - Identity up front. Headers (not the body) must carry a signed agent credential; the gateway checks it and keeps auth out of business logic.
Open questions and next steps
We have taken a first step and plan a reproducible benchmark later, but several boundaries are still unclear.
Schema-cache lifetime is hard. When backend fields change, agents need a clean invalidate-and-rehandshake path so mismatched schema does not crash parsing. Models also differ in how well they read compact arrays without field names; some lose accuracy. The protocol may need to fall back to named JSON depending on the target model.
We are not claiming this design is complete. Protocol work is a long systems problem. We want feedback from people who have thought about agent traffic at the protocol layer, and a path that respects LLM constraints while still fitting modern cloud-native infrastructure.
