Skip to main content

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

Project description

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."}
  ]
}

ResponseContent-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_idthread_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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepagents_serve-0.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepagents_serve-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file deepagents_serve-0.1.0.tar.gz.

File metadata

  • Download URL: deepagents_serve-0.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for deepagents_serve-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abb125278a16e4ebe62f4a0e5dde9ed943f1f4c7cd332899dbe1061f383f46bc
MD5 b7bc49c2bab8ab2851d7cc95c9ce9034
BLAKE2b-256 b0a8a759f954f6c715ca4fb89848c34616b701da9e6555b3e047dfed85458fca

See more details on using hashes here.

File details

Details for the file deepagents_serve-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deepagents_serve-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 936ff4b5b85d7e4bf0ee59242bb6491ba68311dc20cd832f330b96cdc692cff3
MD5 89350acd2c8da9e1ebb596bb3e5c8b72
BLAKE2b-256 0c8ada8e5bbe7813badb63c8333f6bb6a8f94624ff94d361922d94725a3a0705

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page