Examples
LangSmith + Vite
Agent graph on LangSmith Deployment; Vite + React UI streams from the Agent Server API.
Next.js
App Router route handlers implement the protocol under
/api/threads/.... Deploy to Vercel with one click.SvelteKit
SvelteKit server routes on Cloudflare Workers with
@langchain/svelte and per-thread Durable Objects for SSE replay.Nuxt
Nitro route handlers and
@langchain/vue composables in a single deployable Nuxt 4 app.Cloudflare Workers
Vite + React SPA and Hono API on one Worker with Workers Assets and Durable Objects.
Deno Deploy
Deno.serve + Hono serves the protocol API and a Vite-built React SPA from one entrypoint.
What goes into an agent deployment
Every example follows the same shape. The framework and hosting change; the responsibilities do not.Agent runtime
The agent itself, typically a LangGraph graph ordeepagents coordinator, with tools, optional subagents, and middleware. It is compiled with a checkpointer so conversation state survives across turns. Examples start with an in-memory MemorySaver for simplicity; production deployments swap in Redis (@langchain/langgraph-checkpoint-redis), Postgres (@langchain/langgraph-checkpoint-postgres), SQLite (@langchain/langgraph-checkpoint-sqlite), or platform-specific storage.
Protocol server
HTTP route handlers implement the Agent Streaming Protocol under/api/threads/....
Minimum (streaming chat)
These three endpoints are enough to run a single-threaded streaming chat withHttpAgentServerAdapter:
| Method | Path | Purpose |
|---|---|---|
POST | /api/threads/:threadId/commands | Accept commands (run.start, …) and start runs |
POST | /api/threads/:threadId/stream | SSE stream of protocol events for a run |
GET / POST | /api/threads/:threadId/state | Read and bootstrap checkpointed thread state |
Thread sidebar (all examples)
Every example also implements endpoints for the thread-history sidebar:| Method | Path | Purpose |
|---|---|---|
GET | /api/threads | List threads known to the checkpointer |
DELETE | /api/threads/:threadId | Delete a thread’s session and checkpoints |
POST | /api/threads/:threadId/history | Paginated checkpoint history |
Session and run management
Server-side logic tracks active runs, bridges commands to the agent, and fans out live events over SSE. A registry or session store lets clients reconnect to in-flight streams. On serverless or multi-instance hosts, this layer must be shared or colocated with the checkpointer.Chat frontend
A browser UI wired to the protocol throughHttpAgentServerAdapter, from @langchain/react, @langchain/vue, @langchain/svelte, or @langchain/angular. The client bootstraps thread state, submits messages, consumes the SSE stream, and renders tokens, tool calls, reasoning, and subagent activity.
These bindings ship no components of their own. Hooks like useStream return plain reactive state (messages, tool calls, loading flags, thread metadata) that you wire to whatever visual layer you prefer. For adapter patterns and trade-offs, see the frontend integrations overview.
See also
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

