Skip to main content

deepagents-serve

Universal agent server. Wraps any LangGraph graph and exposes it over standard agent protocols — Vercel AI SDK, Claude Code, TUIs, and more.

Quick start

from deepagents_serve import DeepAgentsServeApp
from deepagents import create_deep_agent
import uvicorn

agent = create_deep_agent(
    model="anthropic:claude-opus-4-8",
    skills=["myskillsregistry/skills"],
    system_prompt="You are a helpful assistant."
)

app = DeepAgentsServeApp(agent)

uvicorn.run(app.build(), host="0.0.0.0", port=8000)

Endpoint design

POST /chat/stream

Stateless. One request, one SSE stream, done. No session state is kept between calls.

Request

{
  "messages": [
    {"role": "user", "content": "List the files in the working directory."}
  ]
}

Response — Content-Type: text/event-stream

Uses the Vercel AI Data Protocol. Each line is data: <json>:

data: {"type": "text-start", "id": "msg_01"}
data: {"type": "text-delta", "id": "msg_01", "delta": "Here are the files:\n"}
data: {"type": "text-end", "id": "msg_01"}

data: {"type": "tool-input-start", "toolCallId": "tc_01", "toolName": "bash"}
data: {"type": "tool-input-delta", "toolCallId": "tc_01", "inputTextDelta": "{\"command\":\"ls\"}"}
data: {"type": "tool-output-available", "toolCallId": "tc_01", "output": "README.md\nsrc/"}

data: {"type": "reasoning-start", "id": "r_01"}
data: {"type": "reasoning-delta", "id": "r_01", "delta": "I should list the files..."}
data: {"type": "reasoning-end", "id": "r_01"}

data: {"type": "error", "errorText": "something went wrong"}
data: {"type": "abort", "reason": "user cancelled"}
data: {"type": "finish"}

Signal diagram

Client (Vercel SDK / Claude Code / TUI)
  │
  │  POST /chat/stream
  │  {"messages": [{"role": "user", "content": "..."}]}
  ▼
┌──────────────────┐
│  Input Parser    │  extract last user message from messages array
└────────┬─────────┘
         │ {"role": "user", "content": "..."}
         ▼
┌──────────────────┐
│  LangGraph Graph │  graph.astream({"messages": [...]}, stream_mode=["messages"])
└────────┬─────────┘
         │ (stream_part, metadata) chunks
         ▼
┌──────────────────┐
│  Normaliser      │  LangGraph messages → canonical AgentEvent
│                  │
│  AIMessage       │→  TextDelta | ReasoningDelta
│  ToolCall        │→  ToolInputDelta
│  ToolMessage     │→  ToolOutputAvailable
│  Error           │→  Error | Abort
└────────┬─────────┘
         │ AgentEvent
         ▼
┌──────────────────┐
│  Vercel Adapter  │  AgentEvent → Vercel SSE stream parts
└────────┬─────────┘
         │ text/event-stream
         ▼
Client

Roadmap

Near-term

  • Input parsing — read request body, extract messages
  • Complete normaliser — tool calls, tool results, reasoning deltas from LangGraph
  • Request validation — reject malformed payloads at the boundary

Protocol compatibility

  • Claude Managed Agents endpoints — /v1/sessions, /v1/sessions/{id}/events, /v1/sessions/{id}/events/stream
  • Claude Managed Agents SSE encoding — agent.message, agent.tool_use, session.status_idle event types
  • Agent metadata endpoint — GET /v1/agents/default

Statefulness

  • Session layer — LangGraph thread_id checkpointing, session_id → thread_id mapping
  • Multi-turn conversations — persist conversation history across requests
  • Interrupt support — user.interrupt event stops graph mid-execution

Deployment

  • kagent packaging — Kubernetes-compatible worker pattern

Eval

  • Event history capture — persist full turn events with timestamps and token counts
  • Session replay — re-run a captured session for regression testing

Skills

  • Skill registry compatibility — discover and invoke skills from a registry
  • Finetune on skills — export session history as structured training data

Metadata

Release files for deepagents-serve 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deepagents-serve 0.1.0
File Size Uploaded
deepagents_serve-0.1.0.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deepagents-serve 0.1.0
File Interpreter ABI Platform
deepagents_serve-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.4 kB

Release files / deepagents_serve-0.1.0.tar.gz

Download URL deepagents_serve-0.1.0.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
abb125278a16e4ebe62f4a0e5dde9ed943f1f4c7cd332899dbe1061f383f46bc
BLAKE2b-256 checksum
How to use checksums
b0a8a759f954f6c715ca4fb89848c34616b701da9e6555b3e047dfed85458fca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / deepagents_serve-0.1.0-py3-none-any.whl

Download URL deepagents_serve-0.1.0-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
936ff4b5b85d7e4bf0ee59242bb6491ba68311dc20cd832f330b96cdc692cff3
BLAKE2b-256 checksum
How to use checksums
0c8ada8e5bbe7813badb63c8333f6bb6a8f94624ff94d361922d94725a3a0705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page