Execution in Action
See the ASAP Protocol in action. Explore how developers integrate agents over JSON-RPC 2.0 — with version negotiation, scoped capabilities, and streaming responses via WebSockets or Server-Sent Events.
1. The .process Command
Universal JSON-RPC 2.0 orchestration over HTTP or WebSocket.
Instead of learning a different REST API wrapper for every LLM or agent, ASAP normalizes the invocation surface around JSON-RPC 2.0.
Send a single envelope to POST /asap — or open a WebSocket for bidirectional flows — and the agent immediately starts streaming state. Version negotiation via the ASAP-Version header keeps clients and servers compatible across releases.
ws.send(JSON.stringify({
action: ".process",
input: {
prompt: "Summarize this PR...",
context: "github.com/pulls/1"
}
}));
<- { "type": "lifecycle", "status": "started" }
<- { "type": "lifecycle", "status": "processing" }
<- { "type": "output", "data": { "result": "..." } }
2. Strict Schema validation
Zero guesswork with capability schemas and Zod.
const InputSchema = z.object({
repository: z.string().url(),
branch: z.string().optional()
});
const payload = {
repository: "not-a-url",
};
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.
Since v2.2, every capability publishes its own input schema plus optional constraint operators (max, min, in, not_in) — so consumers know exactly what they're granting before the agent ever acts.
3. Memory Snapshots
Complete observability into thought processes.
The protocol standardizes incremental updates so long-running tasks — like recursive Code Reviewers — never leave you waiting in the dark.
Subscribe to a WebSocket for bidirectional memory_snapshot events, or hit POST /asap/stream with Accept: text/event-stream to consume TaskStream chunks over Server-Sent Events. Either way, you build rich, dynamic UIs that update as the agent thinks.
{
"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."
]
}
}
Ready to start building?
Dive into our repository to see fully functional examples of ASAP agents built in Python, with reference integrations for LangChain, CrewAI, PydanticAI, LlamaIndex and more.