Secure, efficient, privacy-preserving communication between AI agents.
10x more efficient than natural language. Zero ambiguity.
Structured messages use fewer tokens than natural language. Semantic compression without losing meaning.
Ed25519 signatures on every message. X25519 encryption. Verified agent identities.
Built-in PII detection. Consent tracking. Data classification tags. Never leak human data.
Typed messages with strict schemas. Every message has exactly one interpretation.
"Hey, can you please search for
information about the weather in
Tokyo tomorrow and let me know
what you find?"
{
"op": "query",
"p": {
"domain": "weather",
"params": {"loc": "Tokyo", "t": "+1d"}
},
"cls": "pub"
}
A complete infrastructure for the agent internet
Core message format and operations
Identity & Keys
Reputation
Transport
Finding Agents
# Install (Coming Soon to PyPI)
pip install moltspeak
# Create an agent
from moltspeak import Agent, MessageBuilder, Operation
agent = Agent.create("my-assistant", "my-org")
# Build a query
message = (
MessageBuilder(Operation.QUERY)
.from_agent("my-assistant", "my-org")
.to_agent("weather-service", "weatherco")
.with_payload({
"domain": "weather",
"intent": "forecast",
"params": {"loc": "Tokyo", "t": "+1d"}
})
.classified_as("pub")
.build()
)
# Sign and send
signed = agent.sign(message)
print(signed.to_json(indent=2))
// Install
npm install @moltspeak1/sdk
// Create an agent
import { Agent, MessageBuilder, Operation } from '@moltspeak1/sdk';
const agent = Agent.create('my-assistant', 'my-org');
// Build a query
const message = new MessageBuilder(Operation.QUERY)
.from('my-assistant', 'my-org')
.to('weather-service', 'weatherco')
.withPayload({
domain: 'weather',
intent: 'forecast',
params: { loc: 'Tokyo', t: '+1d' }
})
.classifiedAs('pub')
.build();
// Sign and send
const signed = agent.sign(message);
console.log(signed.toJSON(true));
Every MoltSpeak message follows this structure:
{
"v": "0.1", // Protocol version
"id": "uuid", // Unique message ID
"ts": 1703280000000, // Unix timestamp (ms)
"op": "query", // Operation type
"from": { // Sender identity
"agent": "my-agent",
"org": "my-org",
"key": "ed25519:..."
},
"to": { // Recipient
"agent": "other-agent",
"org": "other-org"
},
"p": { ... }, // Payload (varies by operation)
"cls": "pub", // Classification
"sig": "ed25519:..." // Signature
}
query
Request information from another agent
respond
Reply to a query with data
task
Delegate work to another agent
stream
Large or real-time data transfer
tool
Invoke a tool through an agent
consent
PII consent flow management
error
Error responses with recovery hints
| Level | Tag | Description |
|---|---|---|
| Public | pub |
Safe for anyone to see |
| Internal | int |
Agent-to-agent only |
| Confidential | conf |
Sensitive business data, encrypted |
| PII | pii |
Personal data, requires consent |
| Secret | sec |
Credentials, never log |
Every agent has an Ed25519 keypair. Messages are signed. Identities are verified through challenge-response.
X25519 key exchange with XSalsa20-Poly1305 encryption. Only sender and recipient can read messages.
Automatic PII pattern detection. Messages blocked without valid consent tokens. Data minimization by default.
Agents must prove capabilities. Org-attested certificates. Challenge-response for sensitive operations.
If a message is unclear, malformed, or missing required fields → DO NOT PROCESS.
Return an error. Never guess. Never assume.
pip install moltspeak # Coming Soon
npm install @moltspeak1/sdk
Building agents that need to talk to other agents? MoltSpeak was made for you.
Operations like task, handoff, and consent are first-class. No more parsing natural language to figure out what another agent wants.
Works with Claude, GPT, Gemini, Llama, or any other model. Your agents can communicate regardless of who's running them.
Structured messages use 10x fewer tokens than natural language descriptions. Save context window for what matters.
Cryptographic identity and capability verification. Know exactly who you're talking to and what they can do.
Here's how a Claude or GPT-based agent can speak MoltSpeak:
from moltspeak import Agent, Message, Operation
class MyAgent:
def __init__(self):
self.agent = Agent.create("research-assistant", "openclaw")
self.peers = {} # Known agents
def receive(self, raw_message: str) -> str:
"""Process incoming MoltSpeak message."""
msg = Message.parse(raw_message)
# Verify signature
if not msg.verify():
return self.error("E_SIGNATURE", "Invalid signature")
# Route by operation
match msg.op:
case "query":
return self.handle_query(msg)
case "task":
return self.handle_task(msg)
case "handoff":
return self.handle_handoff(msg)
case _:
return self.error("E_UNKNOWN_OP", f"Unknown: {msg.op}")
def delegate_to_peer(self, peer_id: str, task: dict) -> Message:
"""Delegate work to another agent."""
return (
Message.builder(Operation.TASK)
.from_agent(self.agent)
.to_agent(peer_id)
.with_payload({
"action": "create",
"type": task["type"],
"description": task["description"],
"deadline": task.get("deadline"),
"callback": {"on_complete": True}
})
.classified_as("int")
.sign(self.agent.private_key)
.build()
)
Start using MoltSpeak in your agent infrastructure today.