Protocol Showcase

Execution in Action

See the ASAP Protocol in action. Explore how developers integrate agents natively using WebSockets, structured schemas, and real-time state streaming.

1. The .process Command

Universal WebSocket orchestration.

Instead of learning a different REST API wrapper for every LLM or agent, ASAP normalizes the invocation workflow.

You open a WebSocket connection and send a single standard payload containing your input data mapped against the agent's registered schema. The agent immediately begins streaming states back.

client.ts
{/* 1. Client connects via WebSocket */}
const ws = new WebSocket('wss://agent.example.com/asap');

{/* 2. Client sends standard payload */}
ws.send(JSON.stringify({
  action: ".process",
  input: {
    prompt: "Summarize this PR...",
    context: "github.com/pulls/1"
  }
}));

{/* 3. Agent streams lifecycle and output */}
<- { "type": "lifecycle", "status": "started" }
<- { "type": "lifecycle", "status": "processing" }
<- { "type": "output", "data": { "result": "..." } }

2. Strict Schema validation

Zero guesswork with Zod schemas.

validator.ts
import { z } from "zod";

{/* Copied directly from Agent's Lite Registry Manifest */}
const InputSchema = z.object({
  repository: z.string().url(),
  branch: z.string().optional()
});

const payload = {
  repository: "not-a-url",
};

{/* Client validates *before* hitting network */}
const valid = InputSchema.safeParse(payload);

if (!valid.success) {
  console.error("Agent Rejected: Invalid Input URLs");
}

Every ASAP agent publishes a strict JSON Schema inside its registry manifest.

Because the orchestration data layer maps 1:1, developers can instantly wrap requests in Zod or TypeScript types, catching invalid inputs locally before they ever hit the agent's network boundaries.

3. Memory Snapshots

Complete observability into thought processes.

The protocol enforces a MemorySnapshot standard. Long-running tasks, like recursive Code Reviewers, no longer leave you waiting in the dark.

Agents stream continuous snapshots defining their internal context memory, tool invocations, and generated thoughts. Build rich, dynamic UIs that update as the agent thinks.

WebSocket Stream
<- WS Event Received
{
  "type": "memory_snapshot",
  "data": {
    "thought": "I found a bug in line 42. Calling AST parser...",
    "tool_calls": ["parse_typescript_ast"],
    "internal_logs": [
      "[INFO] Parsed 240 Nodes."
    ]
  }
}

{/* UI instantly renders the "thought" string to the user. */}

Ready to start building?

Dive into our repository to see fully functional examples of ASAP agents built in Python and TypeScript.