Framework Integrations
H2C is transport-agnostic and works as a drop-in semantic layer for all major AI agent frameworks. No adapters, no wrappers — just plain text.
LangGraph
Use H2C blocks as node output format and state schema. Each LangGraph node emits H2C blocks that downstream nodes parse deterministically, reducing token costs across multi-step graphs.
AutoGen
Replace verbose agent responses with structured H2C blocks. Agents communicate via typed blocks instead of natural language, enabling reliable multi-agent workflows with 83–96% fewer tokens.
CrewAI
H2C as standardized task output format. Each crew task produces H2C blocks with built-in versioning and cycle tracking, making handoff between crew members deterministic and auditable.
MCP (Model Context Protocol)
Transport H2C blocks via MCP tool calls as structured content. H2C's self-describing blocks are ideal for MCP's tool result format, providing compressed, parseable responses that any MCP client can consume.
Semantic Kernel
Use H2C for function result serialization. Instead of returning verbose natural language from SK functions, return H2C blocks that subsequent functions parse efficiently — cutting orchestration overhead by 70%+.
OpenAI Agents SDK
H2C as structured output format for agent handoffs. Replace natural language handoff descriptions with typed H2C blocks that include built-in retry counters and revision tracking.
Integration Patterns
System Prompt Injection
Include the H2C grammar in your framework's system prompt. Both your agents and the LLM immediately understand H2C blocks — zero configuration required.
Output Parsing
Parse H2C blocks from agent outputs using simple regex or string matching. The format is designed for deterministic extraction — no LLM call needed to parse.
State Injection
Serialize framework state (cycles, revisions, context) into H2C blocks. Pass them between agents as typed, versioned state that persists across framework boundaries.
Transport Agnostic
H2C is plain text. Use it over HTTP, WebSocket, MCP, stdin/stdout, or message queues. The protocol doesn't care about the transport layer.
Example: LangGraph Node with H2C
❌ Without H2C
# LangGraph node returns verbose NL
def architect_node(state):
response = llm.invoke(
"Design the architecture..."
)
# Response: ~800 tokens of natural language
return {"output": response}
✅ With H2C
# LangGraph node returns H2C blocks
def architect_node(state):
response = llm.invoke(
"Design using H2C format..."
)
# Response: ~50 tokens as H2C block
# [ARCH:PLAN]\nid:svc|fw:python3.11|...
return {"h2c_block": response}
Same architectural information, 94% fewer tokens. Downstream nodes parse H2C blocks deterministically.
Integrate H2C Today
No SDK needed. Add the grammar to your system prompt and start using H2C blocks with any framework.