# AgentOS now supports Claude Code, LangGraph, and DSPy
**作者**: Ashpreet Bedi
**日期**: 2026-04-29T15:30:28.000Z
**来源**: [https://x.com/ashpreetbedi/status/2049511642946249143](https://x.com/ashpreetbedi/status/2049511642946249143)
---

Today we're shipping AgentOS support for Claude Code (via the Claude Agent SDK), LangGraph, and DSPy. Alpha release, expect things to break.
Here's how you can serve a Claude Code agent and an Agno agent in the same AgentOS, sharing one db, one API, one UI:
```
from agno.agent import Agent
from agno.agents.claude import ClaudeAgent
from agno.db.sqlite import SqliteDb
from agno.os import AgentOS
from agno.tools.workspace import Workspace
# Claude Code agent
claude_agent = ClaudeAgent(
name="Claude Code Agent",
model="claude-sonnet-4-6",
allowed_tools=["Read", "Edit", "Bash"],
permission_mode="acceptEdits",
max_turns=10,
)
# Agno agent
agno_agent = Agent(
name="Agno Agent",
model="openai:gpt-5.4",
tools=[
Workspace(
root=".",
allowed=["read", "list", "search"],
confirm=["write", "edit", "delete", "shell"],
)
],
)
agent_os = AgentOS(
tracing=True,
agents=[agno_agent, claude_agent],
db=SqliteDb(db_file="tmp/agentos.db"),
)
app = agent_os.get_app()
```
This gives you a FastAPI backend you can run in your cloud. Multi-user auth, JWT-backed RBAC, streaming, background tasks, scheduling, observability. Everything built-in. Scale horizontally as traffic grows.
LangGraph and DSPy agents work the same way. All three integrations are in early support. Lots we don't cover yet. Please report any sharp edges.
# SDKs and harnesses
There are two common starting points for building agents today: an SDK, or a packaged harness.
An SDK is a set of primitives for building agentic software. Some SDKs hand you a default loop. Most let you compose it yourself: single agent, multi-agent, step-based workflow. You pick the model, sometimes a different model for each step. You wire the tools and the permissions. Tool shape often shifts based on the role of the user the agent is talking to. You decide when to compact, when to spawn a subagent, when to ask for approval, when to stop.
Agno is an SDK: a software development kit for building agentic software.
A harness is an opinionated execution environment around a model. The loop is designed. The tools are pre-built. The working environment is set. The permissions model is part of the system. You invoke it with a prompt and a configuration and let it run. Claude Code, Codex, and Cursor's background agent are all harnesses. Some are products you run. Some expose the loop programmatically through an SDK (the Claude Agent SDK does this for Claude Code). The point is the architecture comes designed.
Both are valid and you'll often use both together.
Rule of thumb: if you need to customize the architecture for your users, your product, or your environment, you need an SDK. If the task fits a harness, use a harness. Harness teams have spent real engineering time on the inner loop. Take advantage of it.
Starting today, you don't have to choose. AgentOS runs both. Early support with rough edges we'll fix as we find them.
# Why agents need a production service
Coding agents kicked off the Cambrian explosion of agents. A year ago agents were research demos. Today every engineer has multiple running, and it's hard to imagine writing code by hand again.
Coding agents run as CLIs and use the local filesystem for storage because that's the right shape for a developer running one locally. It's absolutely the wrong shape for a team running fifty of them in parallel against a shared codebase, on a schedule, behind SSO, with audit logs.
Anthropic's Scaling Managed Agents post walks through their journey. They started with session, agent harness, and sandbox all sharing one container (like a local coding agent setup). The setup ran into problems as you'd expect.
What they learned is that the three layers need to be separate: the agent loop (harness), the sandbox (the code execution environment), and session storage. When they're independent, you can scale them independently. You can spin sandboxes up and tear them down on demand. You can persist sessions across restarts. You can swap harnesses without rewriting your auth layer.
With AgentOS, you get this out of the box.
- First the easy one: sessions and runs live in a database. This gives you durability across restarts. AgentOS supports every database provider.
- Then the harness, the agent loop. This is what AgentOS is built for. It runs the loop, handles failures gracefully, isolates requests, and prevents memory or data leaks across users. Some people are calling the harness "the backend". That framing is incorrect. The agent loop will crash often. That's the nature of agents. When it crashes, your server should keep running. The harness is managed by your backend. It's not the backend.
- Finally the sandbox, the code execution environment. AgentOS treats it as a tool call like any other. Spin one up per session. Tear it down when done. If the sandbox dies, the agent loop catches the failure and passes it back to the model, just like any other tool call.
If you're running agents in a cloud environment serving multiple users, you need multi-tenant auth, role-based access control, cron and event-driven scheduling, full observability with traces and costs and tool calls, and human-in-the-loop approval gates for any tool call you flag as sensitive.
If you're building a product on top of agents, you need clean API endpoints for all of these operations. Your product hits /run to start an agent. The agent runs until it needs human approval, then pauses. Your product hits /continue with the input. The agent picks up where it left off.
Any agent that goes beyond serving one user needs a production service.
AgentOS gives you that for any agent architecture, out of the box.
# What you can build with this
AgentOS is designed for teams building agentic products for end users. Teams that need a well-designed API to build on top of. Teams that need multi-user, multi-tenant authentication. Teams that need RBAC. Teams that need to run agents in batch, streaming, or background mode.
You build the agent in Agno, LangGraph, DSPy, or the Claude Agent SDK, then serve it through one API surface with auth, sessions, observability, and approval flows built in. Scale horizontally as your traffic grows.
The second use case we're passionate about are internal agent platforms.
Every company will have one. We're a small team of 10 and run many agents internally. Three I've shared publicly: Coda (slack-native code companion), Dash (self-learning data agent), Scout (company intelligence agent).
In both cases (agentic products and internal platforms), the agents needs to serve multiple users, handle errors gracefully, and meet users where they are: the product UI, Slack, Discord, Telegram, or pigeon mail.
# Take it for a spin
Read the docs for the architecture. Run the examples to see all four frameworks side by side. Star the repo to follow along.
## 相关链接
- [Ashpreet Bedi](https://x.com/ashpreetbedi)
- [@ashpreetbedi](https://x.com/ashpreetbedi)
- [8.8K](https://x.com/ashpreetbedi/status/2049511642946249143/analytics)
- [Scaling Managed Agents](https://www.anthropic.com/engineering/managed-agents)
- [Coda](https://github.com/agno-agi/coda)
- [Dash](https://github.com/agno-agi/dash)
- [Scout](https://github.com/agno-agi/scout)
- [docs](https://docs.agno.com/)
- [examples](https://github.com/agno-agi/agno/tree/main/cookbook/frameworks/00_quickstart)
- [Star the repo](https://github.com/agno-agi/agno)
- [Upgrade to Premium](https://x.com/i/premium_sign_up)
- [11:30 PM · Apr 29, 2026](https://x.com/ashpreetbedi/status/2049511642946249143)
- [8,835 Views](https://x.com/ashpreetbedi/status/2049511642946249143/analytics)
---
*导出时间: 2026/4/30 11:30:00*
---
## 中文翻译
# AgentOS 现已支持 Claude Code、LangGraph 和 DSPy
**作者**: Ashpreet Bedi
**日期**: 2026-04-29T15:30:28.000Z
**来源**: [https://x.com/ashpreetbedi/status/2049511642946249143](https://x.com/ashpreetbedi/status/2049511642946249143)
---

今天,我们发布了 AgentOS 对 Claude Code(通过 Claude Agent SDK)、LangGraph 和 DSPy 的支持。这是 Alpha 版本,请预期可能会出现问题。
以下是如何在同一个 AgentOS 中部署 Claude Code 代理和 Agno 代理,共享同一个数据库、同一个 API 和同一个 UI:
```
from agno.agent import Agent
from agno.agents.claude import ClaudeAgent
from agno.db.sqlite import SqliteDb
from agno.os import AgentOS
from agno.tools.workspace import Workspace
# Claude Code agent
claude_agent = ClaudeAgent(
name="Claude Code Agent",
model="claude-sonnet-4-6",
allowed_tools=["Read", "Edit", "Bash"],
permission_mode="acceptEdits",
max_turns=10,
)
# Agno agent
agno_agent = Agent(
name="Agno Agent",
model="openai:gpt-5.4",
tools=[
Workspace(
root=".",
allowed=["read", "list", "search"],
confirm=["write", "edit", "delete", "shell"],
)
],
)
agent_os = AgentOS(
tracing=True,
agents=[agno_agent, claude_agent],
db=SqliteDb(db_file="tmp/agentos.db"),
)
app = agent_os.get_app()
```
这为你提供了一个可以在云环境中运行的 FastAPI 后端。多用户认证、基于 JWT 的 RBAC、流式传输、后台任务、调度、可观测性。一切均为内置。随着流量的增长,可以横向扩展。
LangGraph 和 DSPy 代理的工作方式相同。这三项集成目前均处于早期支持阶段。还有许多功能尚未覆盖。如遇任何问题,请报告反馈。
# SDK 与 Harness(运行环境)
目前构建代理有两个常见的起点:SDK 或打包的 Harness。
SDK 是用于构建代理软件的原语集。某些 SDK 会为你提供一个默认循环。大多数允许你自己组合:单代理、多代理、基于步骤的工作流。你可以选择模型,有时甚至为每个步骤选择不同的模型。你需要连接工具并设置权限。工具形态通常会根据代理对话的用户的角色而发生变化。你需要决定何时压缩上下文、何时生成子代理、何时请求批准以及何时停止。
Agno 是一个 SDK:一个用于构建代理软件的软件开发工具包。
Harness 是围绕模型的一种固守己见的执行环境。循环是预先设计好的。工具是预构建的。工作环境已设置好。权限模型是系统的一部分。你需要通过提示词和配置来调用它,然后让其运行。Claude Code、Codex 和 Cursor 的后台代理都是 Harness。有些是你运行的产品。有些通过 SDK 以编程方式公开循环(Claude Agent SDK 为 Claude Code 实现了这一点)。关键在于架构是预先设计好的。
两者都是有效的,你通常会同时使用两者。
经验法则:如果你需要针对你的用户、产品或环境定制架构,你需要一个 SDK。如果任务适合 Harness,请使用 Harness。Harness 团队在内部循环上投入了大量的工程时间。充分利用这一点。
从今天起,你不必再做选择。AgentOS 两者皆可运行。早期支持可能存在粗糙的边缘,我们会在发现时进行修复。
# 为什么代理需要生产级服务
代码代理引发了代理领域的寒武纪大爆发。一年前,代理还只是研究演示。如今,每个工程师都在运行多个代理,很难再想象手动编写代码的场景。
代码代理作为 CLI 运行并使用本地文件系统进行存储,因为这对于本地运行的开发者来说是合适的形态。但对于一个团队来说,如果要在共享代码库上按计划并行运行五十个代理,并在 SSO 之后运行且具有审计日志,这种形态绝对是错误的。
Anthropic 的《规模化托管代理》文章详细介绍了他们的历程。他们最初将会话、代理 harness 和沙箱全部共享在一个容器中(就像本地代码代理设置一样)。正如预期的那样,这种设置遇到了问题。
他们的经验是,这三层需要分离:代理循环、沙箱(代码执行环境)和会话存储。当它们独立时,你可以独立扩展它们。你可以按需启动和销毁沙箱。你可以在重启后持久化会话。你可以在不重写认证层的情况下更换 harness。
使用 AgentOS,你可以开箱即用地获得这些功能。
- 首先是简单的一点:会话和运行记录存储在数据库中。这为你提供了重启后的持久性。AgentOS 支持所有数据库提供商。
- 然后是 Harness,即代理循环。这就是 AgentOS 的构建目的。它运行循环,优雅地处理故障,隔离请求,并防止跨用户的内存或数据泄漏。有些人将 Harness 称为“后端”。这种框架是不正确的。代理循环经常会崩溃。这是代理的本质。当它崩溃时,你的服务器应该继续运行。Harness 由你的后端管理。它不是后端。
- 最后是沙箱,即代码执行环境。AgentOS 将其视为像任何其他工具一样的工具调用。每个会话启动一个。完成后将其销毁。如果沙箱死机,代理循环会捕获故障并将其传回给模型,就像任何其他工具调用一样。
如果你在云环境中运行代理服务于多个用户,你需要多租户认证、基于角色的访问控制、Cron 和事件驱动的调度、包含链路、成本和工具调用的完全可观测性,以及针对你标记为敏感的任何工具调用的人工介入批准门槛。
如果你要在代理之上构建产品,你需要为所有这些操作提供干净的 API 端点。你的产品调用 /run 来启动代理。代理运行直到需要人工批准,然后暂停。你的产品携带输入调用 /continue。代理从中断的地方恢复运行。
任何超越为一个用户服务的代理都需要生产级服务。
AgentOS 为你针对任何代理架构开箱即用地提供了这一服务。
# 你可以用它构建什么
AgentOS 专为为最终用户构建代理产品的团队而设计。这些团队需要设计良好的 API 作为构建基础。这些团队需要多用户、多租户认证。这些团队需要 RBAC。这些团队需要以批处理、流式或后台模式运行代理。
你可以在 Agno、LangGraph、DSPy 或 Claude Agent SDK 中构建代理,然后通过一个 API 表面提供服务,并内置认证、会话、可观测性和批准流程。随着流量的增长,可以横向扩展。
我们热衷的第二个用例是内部代理平台。
每个公司都会有一个。我们是一个 10 人的小团队,但在内部运行着许多代理。我已经公开分享了三个:Coda(slack 原生代码助手)、Dash(自学习数据代理)、Scout(公司情报代理)。
在这两种情况下(代理产品和内部平台),代理都需要为多个用户服务,优雅地处理错误,并在用户所在的地方满足他们的需求:产品 UI、Slack、Discord、Telegram 或 pigeon mail。
# 试用一下
阅读有关架构的文档。运行示例以并排查看所有四个框架。给仓库点星以关注进展。
## 相关链接
- [Ashpreet Bedi](https://x.com/ashpreetbedi)
- [@ashpreetbedi](https://x.com/ashpreetbedi)
- [8.8K](https://x.com/ashpreetbedi/status/2049511642946249143/analytics)
- [Scaling Managed Agents](https://www.anthropic.com/engineering/managed-agents)
- [Coda](https://github.com/agno-agi/coda)
- [Dash](https://github.com/agno-agi/dash)
- [Scout](https://github.com/agno-agi/scout)
- [docs](https://docs.agno.com/)
- [examples](https://github.com/agno-agi/agno/tree/main/cookbook/frameworks/00_quickstart)
- [Star the repo](https://github.com/agno-agi/agno)
- [Upgrade to Premium](https://x.com/i/premium_sign_up)
- [11:30 PM · Apr 29, 2026](https://x.com/ashpreetbedi/status/2049511642946249143)
- [8,835 Views](https://x.com/ashpreetbedi/status/2049511642946249143/analytics)
---
*导出时间: 2026/4/30 11:30:00*