deepagents 架构讲解:后端与代理循环分离,本地 TUI 和云端沙箱都能跑,Slack/Web 共用后端。
deepagents 把代理循环与后端分开:后端只需暴露读写等文件系统类操作,若做成沙箱还要提供 execute 执行命令。这套架构基于 LangGraph 构建,可通过 MCP、A2A 等标准端点部署。本地编码场景可把沙箱放在同目录,用轻量服务器加 TUI 前端(如 dcode)连接;云端场景可用 LangSmith Deployments 连接 Modal、Daytona 或 E2B 上的沙箱,并让 Slack 与 Web UI 共用同一后端。不执行代码的智能体可以换用“假后端”,只保留文件交互能力。
totally agree! here's how we architected deepagents to enable this deepagents runs connected to a "...
totally agree! here's how we architected deepagents to enable this deepagents runs connected to a "backend". this backend needs to expose filesystem like operations, but it does not have to be a filesystem. it could be a database, object storage, or a real filesystem - it just has to expose read/write/edit etc operations this backend could also be what we call a "sandbox". if a sandbox, it needs to expose an "execute" command which lets it execute code this backend is SEPARATE from where the agent loop runs. this allows us to "separate the brains from the hands" ( anthropic.com/engineering/ma… ) deepagents is built on top of langgraph, which means we can easily deploy it with MCP, a2a, and other standard endpoints we use this architecture to power many different types of experiences first, we can create a classic TUI like coding experience. we do this by giving deepagents a "sandbox" that is running locally in the same directory; deloying deepagents locally behind a light weight server; and then connecting to it with the TUI acting like a frontend. see dcode for an example of this docs.langchain.com/oss/deepagents… second, we can create a cloud coding experience. we can do this by running deepagents on LangSmith deployments for a production scale deployment, and connecting to a sandbox running on modal, daytona, e2b that is running elsewhere. we can then build a frontend to connect to langsmith deployments and let users interract with it there, and also expose it in slack to let users interract with it there. note: both slack and web ui connect to the same backend, so you can switch between them seamlessly. code: github.com/langchain-ai/o… of course - deepagents can be used to create agents that are NOT coding agents. a lot of agents still need to write and execute code, so this architecture is still very useful. but for some the code execution is overkill, and thats where you can swap to a "fake" backend, and still let it have the ability to interract with files (good for context engineering!) without having to spin up a full sandbox. for a really easy way to create these types of agents - see managed deepagents: langch.in/u8s5cgu Patrick Collison @patrickc I love agentic coding harnesses, but they shouldn't be primarily terminal-based. The terminal is great for quick and precise commands, but information density is extremely low and UI affordances are minimal. Maybe provision of TUIs is worthwhile for occasional use (when establishing a tunnel is too annoying, or something), but it feels very strange for this to be the default modality. It took a long time for dynamic language REPLs to break out of the terminal (Jupyter notebooks and similar); I hope we don't have to wait as long for the harnesses. 🔗 View Quoted Tweet 💬 8 🔄 1 ❤️ 30 👀 4149 📊 12 ⚡