rkt-protocol
v1.0.0
Published
RKT — Rukkit Transfer Protocol: The AI-native communication protocol for agent-to-agent and AI-to-AI communication
Maintainers
Readme
⚡ RKT Protocol
Rukkit Transfer Protocol — The AI-native communication standard.
RKT is an open protocol for AI-to-AI, agent-to-agent, and agent-to-service communication. Where HTTP serves humans and web browsers, RKT serves AI.
rkt://weather.ai
rkt://calendar.ai/create_event
rkt://maps.ai/navigate?from=Seoul&to=Busan
rkt://memory.local/user
rkt://market.agent/search?q=translationWhy RKT?
Today's AI agents waste compute on things humans designed for humans:
| HTTP (for humans) | RKT (for AI) |
|---|---|
| Find the correct URL | Just know rkt://weather.ai |
| Read API documentation | RNS gives you everything automatically |
| Handle OAuth flows | HELLO → HELLO_ACK in 1 round trip |
| Parse JSON schema | Send intent: "forecast" — done |
| Manage results manually | Built-in streaming, memory, payments |
Protocol Stack
Application (RKT)
↑
TLS 1.3
↑
TCP / QUIC
↑
IPAlso supports WebSocket over HTTPS.
Quickstart
# Install globally — gives you the rkt CLI
npm i -g rkt-protocol
# Or install as a library in your project
npm install rkt-protocolCLI (after global install)
rkt serve --port 7749 --caps weather,forecast # start a server
rkt connect rkt://weather.ai # connect to any agent
rkt discover rkt://weather.ai # print capabilities
rkt ping rkt://weather.ai # measure latency
rkt resolve weather.ai # DNS/RNS lookup
rkt help # all commandsServer
import { RKTServer, buildResponse } from "rkt-protocol";
const server = new RKTServer({
port: 7749,
identity: "rkt://weather.ai",
capabilities: ["weather", "forecast", "alerts"],
});
server.handle("weather.current", async (msg, session, send) => {
const { city } = msg.body.params;
send(buildResponse(session.sessionId, msg.headers["Message-ID"], {
city, temperature: 22, condition: "Sunny"
}));
});
await server.listen();Client
import { RKTClient } from "rkt-protocol";
const client = new RKTClient({ userAgent: "MyAgent/1.0" });
await client.connect("rkt://weather.ai");
const weather = await client.request("weather.current", { city: "Seoul" });
console.log(weather); // { city: "Seoul", temperature: 22, condition: "Sunny" }
// Streaming
for await (const day of client.stream("weather.forecast", { days: 7 })) {
console.log(day);
}
// Memory
await client.memorySet("preferred_city", "Seoul");
// Payment
await client.pay(0.001, "RKTT", "API call", "rkt://weather.ai");
await client.disconnect();Core Features
- Intent-based messaging — send
intent: "forecast"instead ofGET /api/v2/weather/forecast - Capability negotiation — agents advertise what they can do in the handshake
- DID identity — every agent has a cryptographic identity, messages are signed
- Native streaming — STREAM_BEGIN / STREAM_DATA / STREAM_END are core primitives
- Shared memory — namespaced key-value memory accessible across agents
- Protocol payments — PAY / PAY_REQUEST built into the protocol
- Agent discovery (RNS) — DNS-based agent discovery with capability metadata
- Real-time events — SUBSCRIBE to push streams from any agent
Message Types
| Type | Description |
|------|-------------|
| HELLO / HELLO_ACK | Session handshake |
| REQUEST / RESPONSE | Intent-based request/response |
| STREAM_BEGIN/DATA/END | Streaming responses |
| AUTH / AUTH_OK | Authentication |
| DISCOVER / DISCOVER_RESPONSE | Capability discovery |
| MEMORY_GET / MEMORY_SET | Shared memory |
| PAY / PAY_OK | Payments |
| EVENT / SUBSCRIBE | Real-time events |
| PING / PONG | Heartbeat |
Status Codes
RKT uses HTTP-compatible status codes plus a 6xx range for AI-specific conditions:
| Code | Name | |------|------| | 600 | Unknown Agent | | 601 | Invalid Signature | | 602 | Capability Missing | | 603 | Version Unsupported | | 604 | Memory Locked | | 605 | Payment Required | | 606 | Trust Insufficient | | 607 | Context Expired |
Project Structure
spec/ RKT/1.0 Core Specification (Markdown)
src/
core/ Message parsing, serialization, session management
client.ts RKT WebSocket client
server.ts RKT WebSocket server
dns/ Rukkit Naming System (RNS)
registry/ Agent marketplace registry
memory/ Shared memory store
payment/ Micropayment processor
docs/ Landing page (GitHub Pages)
tests/ Unit tests
examples/ Server and client examplesRun Examples
# Terminal 1: Start the weather agent server
npx tsx examples/server-example.ts
# Terminal 2: Connect a client
npx tsx examples/client-example.tsTests
npm install
npm testSpecification
Full spec: spec/RKT-1.0-core.md
Landing page: danwoo.github.io/rkt-protocol (via GitHub Pages from /docs)
Extensions
| Extension | Status | Description | |-----------|--------|-------------| | RKT-DNS | Draft | Rukkit Naming System | | RKT-Discovery | Draft | Agent discovery | | RKT-Memory | Draft | Shared memory protocol | | RKT-Payment | Draft | Micropayment layer | | RKT-Event | Draft | Real-time event subscriptions | | RKT-Registry | Draft | Agent marketplace | | RKT-Trust | Draft | Trust scoring |
License
MIT — open for contributions.
