Save your spot

Live eventA single Agent, 3 surfaces

How to Bring Your LangChain Agents into OpenBot as AI Coworkers

By Anmol Baranwal
November 18, 2026
Cover image on a light lavender background with a faint dot pattern: the LangChain logo in a white tile, above the headline “Bring your LangChain agents into OpenBot”, the line “Your AI coworker with a computer of its own.” and a dark open.bot button.

LangChain Deep Agents give you a ready-made agent harness on top of LangGraph, with planning, subagents, a virtual filesystem and context management built in. It's made for long, multi-step workflows.

But bringing a Deep Agent into an agent workspace as an AI coworker with its own computer takes a lot of work: rules for what it can do, scheduled runs, access to third-party tools, audit logs and maintaining it all as it grows.

OpenBot (open.bot) is an open-source agent workspace where all of that comes built in. Bring your Deep Agent in with two simple steps, and your whole team can chat with it, schedule it and hand it work, with its own rules, boundaries and admin controls.

OpenBot works with any model behind an OpenAI-compatible endpoint, even local ones (DeepSeek, Mistral, Kimi, Ollama, etc). Your Bots also learn from their mistakes and improve over time with Automatic Learning. Your agent code stays yours, and the workspace around it is fully customizable.

This guide walks through connecting your Deep Agent to OpenBot, giving it OpenBot's tools and deploying it on LangSmith with auth.

1. What are LangChain Deep Agents

Deep Agents is LangChain's agent harness, built for long, multi-step workflows. It runs the same tool-calling loop as any agent, with planning, subagents, a virtual filesystem and context management already built in.

To create a Deep Agent, you call create_deep_agent, which gives you:

  • Planning: once turned on, the agent breaks the task into a todo list and updates it as it learns.
  • Subagents: the agent hands a subtask to a subagent with its own prompt, tools and context, and gets one clean report back.
  • Filesystem: a virtual filesystem holds the agent's notes and drafts, so its context window stays small.
  • Sandboxes: the agent can run code and shell commands in an isolated sandbox, like LangSmith Sandboxes, Daytona, E2B or Modal.
  • Context management: large tool results are saved to files, long threads get summarized, and prompt caching cuts latency and cost on Anthropic and Bedrock models.

Here's a mental model of how a run flows.

User goal
  ↓
Deep Agent
  ├── Plan: writes and updates a todo list (when turned on)
  ├── Delegate: hands subtasks to subagents
  └── Keep notes: reads and writes files
  ↓
Final answer

Deep Agents is the top of a three-part stack. LangChain gives you the building blocks like create_agent and middleware, LangGraph is the runtime underneath, and Deep Agents wires it all into a ready-made harness. If you're starting a serious agent on LangChain today, this is where you start.

deep agents stack

OpenBot is built on CopilotKit, which already integrates with Deep Agents, so the same agent works here too.

2. Bring your LangChain Deep Agent into OpenBot

OpenBot talks to agents over AG-UI (Agent-User Interaction Protocol), the open standard for connecting agents to user-facing applications. If your Deep Agent already exposes an AG-UI endpoint, its deployed address is all OpenBot needs.

Open OpenBot in your browser at my.open.bot, or in the desktop app from open.bot. Then go to New Bot > Bring your own agent > LangChain, paste your agent's address, put Bearer <token> in the Key field if it needs one, and click Create Bot.

Before saving, OpenBot runs a quick test against your agent, so you'll know right away if the address is wrong. Once it passes, your Deep Agent shows up in your workspace as an AI coworker, right next to OpenBot's built-in Bots.

basic chat

Expose your Deep Agent as an AG-UI endpoint

If your agent doesn't have an AG-UI endpoint yet, ag-ui-langgraph adds one, and LangSmith serves it right next to your agent. Add a requirements.txt next to your agent with these packages:

deepagents
ag-ui-langgraph[fastapi]
copilotkit
langchain-openai

Then install them, along with the LangGraph CLI:

pip install -r requirements.txt "langgraph-cli[inmem]"

Then add the endpoint to your agent file, agent.py. Here's a simple Deep Agent with the endpoint added:

from ag_ui_langgraph import LangGraphAgent, add_langgraph_fastapi_endpoint
from deepagents import create_deep_agent
from fastapi import FastAPI
from langgraph.checkpoint.memory import MemorySaver

agent = create_deep_agent(
    model="openai:gpt-5.5",
    system_prompt="You are a helpful research assistant.",
)

app = FastAPI()
add_langgraph_fastapi_endpoint(
    app,
    LangGraphAgent(name="deep_agent", graph=agent.copy(update={"checkpointer": MemorySaver()}), config={"recursion_limit": 1000}),
    path="/agent",
)

Next, create a langgraph.json file. It points LangSmith to your agent and its AG-UI endpoint:

{
  "dependencies": ["."],
  "graphs": { "deep_agent": "./agent.py:agent" },
  "http": { "app": "./agent.py:app" },
  "env": ".env"
}

Add your OpenAI key to a .env file next to your agent:

OPENAI_API_KEY=your-openai-api-key

Start the server locally:

langgraph dev

Your agent should now be live at http://localhost:2024/agent. Paste that address into OpenBot Desktop the same way as above, and your Deep Agent is ready to use.

Here's how each run flows between OpenBot and your agent:

OpenBot calling a Deep Agent on LangSmith over AG-UI

That's the basic setup. The next few sections go further, giving your agent OpenBot's tools and taking it to production on LangSmith.

3. Give your agent OpenBot's tools

To use these tools, your agent needs two middleware. CopilotKitMiddleware hands OpenBot's tools to your model, and RunGuidanceMiddleware gives it the Bot's instructions. We'll also turn on Deep Agents' planning with TodoListMiddleware, so the agent plans its work before it starts researching.

The Bot's instructions start reaching your agent once you switch to the production endpoint in section 4.

The prompt matters just as much, because it tells the model when to reach for each tool. Here's the updated agent:

from ag_ui_langgraph import RunGuidanceMiddleware
from copilotkit import CopilotKitMiddleware
from deepagents import create_deep_agent
from langchain.agents.middleware import TodoListMiddleware

agent = create_deep_agent(
    model="openai:gpt-5.5",
    tools=[get_github_repo],        # the agent's own tool
    subagents=[repo_researcher],    # researches one repo at a time
    system_prompt=(
        "You are an open source research assistant. Plan multi-step work with your todo list, "
        "hand each repository to the repo-researcher subagent and answer with the facts you found. "
        "When you compare numbers and the workspace offers a chart tool (such as showBarChart), "
        "show them as a chart in a step of its own. To open issues or post messages, use the "
        "person's connected apps."
    ),
    middleware=[
        TodoListMiddleware(),       # turns on planning
        CopilotKitMiddleware(),     # hands OpenBot's tools to the model
        RunGuidanceMiddleware(),    # passes along the Bot's instructions
    ],
)

The agent's tool reads public stats from the GitHub API, and the subagent uses that same tool to research one repo and report back:

import httpx

def get_github_repo(owner: str, repo: str) -> dict:
    """Look up a public GitHub repository: stars, open issues, last push."""
    response = httpx.get(f"https://api.github.com/repos/{owner}/{repo}", timeout=15)
    if response.status_code == 404:
        return {"error": f"{owner}/{repo} was not found or is private."}
    data = response.json()
    return {
        "full_name": data["full_name"],
        "stars": data["stargazers_count"],
        "open_issues": data["open_issues_count"],
        "pushed_at": data["pushed_at"],
        "url": data["html_url"],
    }


repo_researcher = {
    "name": "repo-researcher",
    "description": "Looks up one GitHub repository and returns a short factual profile of it.",
    "system_prompt": "You research one GitHub repository with get_github_repo. Return the facts as a short list.",
    "tools": [get_github_repo],
}

The agent has no tool of its own that writes anything. Issues go through the person's GitHub app in OpenBot, so OpenBot asks before every write and you don't write any approval code.

Before you try it, two quick things in OpenBot:

  • Connect GitHub under Connections and give the app to the Bot.
  • Charts and approval cards work for every Bot by default. An admin can limit them per Bot under Admin > UI components.
OpenBot's Components gallery, showing the components it can draw using generative UI

Restart langgraph dev, and your agent can now use OpenBot's tools.

4. Deploy it on LangSmith with auth

So far, your agent runs on your own machine, and only OpenBot Desktop can reach it there. To run it in production, where your whole team can use it from the desktop app or the browser at my.open.bot, it needs to be deployed with auth.

LangSmith Deployment is LangChain's standard way to host agents. Your AG-UI endpoint already runs on LangSmith's server, so it deploys right along with your agent.

Protect your agent with auth

OpenBot sends whatever you put in the Bot's Key field as the Authorization header on every request. LangSmith's custom auth checks that key in front of everything your deployment serves, and turns away requests without it. Create auth.py next to your agent:

import hmac
import os

from langgraph_sdk import Auth


def key_is_valid(authorization: str | None) -> bool:
    """True when the header is `Bearer <OPENBOT_AGENT_KEY>`."""
    expected = os.environ.get("OPENBOT_AGENT_KEY", "")
    if not expected or not authorization:
        return False
    scheme, _, token = authorization.partition(" ")
    return scheme.lower() == "bearer" and hmac.compare_digest(token.strip(), expected)


auth = Auth()


@auth.authenticate
async def authenticate(authorization: str | None) -> Auth.types.MinimalUserDict:
    if not key_is_valid(authorization):
        raise Auth.exceptions.HTTPException(status_code=401, detail="Invalid or missing key")
    return {"identity": "openbot", "is_authenticated": True}

Update the endpoint for OpenBot

The endpoint we added in section 2 reuses one checkpoint for every run. That's fine for a first test, but OpenBot resends the whole conversation each time, so old copies of messages pile up in longer chats.

The production endpoint fixes that and handles two more things:

  • Starts each run fresh, so messages never show up twice.
  • Puts back the first system message, where the Bot's instructions arrive. The adapter would otherwise drop it.
  • Trusts those instructions only from callers with your key.

Replace the endpoint part of agent.py with this:

from contextlib import aclosing

from ag_ui_langgraph import RunGuidanceAgentMixin, add_langgraph_fastapi_endpoint
from copilotkit import LangGraphAGUIAgent
from fastapi import FastAPI, HTTPException, Request
from langchain_core.messages import SystemMessage
from langgraph.checkpoint.memory import MemorySaver

from auth import key_is_valid


class OpenBotDeepAgent(RunGuidanceAgentMixin, LangGraphAGUIAgent):
    """OpenBot sends the whole conversation on every run, so each run starts fresh."""

    async def run(self, input, **kwargs):
        shared = self.graph
        self.graph = shared.copy(update={"checkpointer": MemorySaver()})
        try:
            thread = [m for m in input.messages if m.role != "reasoning"]
            run_input = input.model_copy(update={"resume": None, "messages": thread})
            async with aclosing(super().run(run_input, **kwargs)) as events:
                async for event in events:
                    yield event
        finally:
            self.graph = shared

    def langgraph_default_merge_state(self, state, messages, input):
        merged = super().langgraph_default_merge_state(state, messages, input)
        first = messages[0] if messages else None
        # Put back the first system message, which the adapter drops.
        if isinstance(first, SystemMessage) and first.content:
            merged["messages"] = [first, *merged["messages"]]
        return merged


def openbot_is_caller(request: Request) -> bool:
    if not key_is_valid(request.headers.get("authorization")):
        raise HTTPException(status_code=401, detail="Invalid or missing key")
    return True


app = FastAPI()
add_langgraph_fastapi_endpoint(
    app=app,
    agent=OpenBotDeepAgent(name="deep_agent", graph=agent, config={"recursion_limit": 1000}),
    path="/agent",
    authorize_guidance=openbot_is_caller,
)

The recursion_limit gives your Deep Agent room to plan, call subagents and draw charts in one run. Without it, the adapter caps every run at 25 steps.

Then add auth to langgraph.json:

{
  "dependencies": ["."],
  "graphs": { "deep_agent": "./agent.py:agent" },
  "auth": { "path": "./auth.py:auth", "allow_langsmith_api_keys": true },
  "http": { "app": "./agent.py:app", "enable_custom_route_auth": true },
  "env": ".env"
}

Keep enable_custom_route_auth on. Without it, LangSmith skips your auth on the AG-UI endpoint, so anyone with the URL could call your agent. allow_langsmith_api_keys keeps LangSmith Studio working with your LangSmith API key.

Test it locally

Add the other two keys to your .env file. The OpenBot key is a long random string you make yourself, and openssl rand -hex 32 works:

OPENAI_API_KEY=your-openai-api-key
OPENBOT_AGENT_KEY=your-long-random-key
LANGSMITH_API_KEY=your-langsmith-api-key

Then start the server again and call it with your key. You should get JSON back, and a 401 without the header:

langgraph dev
curl -H "Authorization: Bearer $OPENBOT_AGENT_KEY" http://127.0.0.1:2024/agent/capabilities

Locally, langgraph dev also lets requests with no header through. Once deployed, every request needs your key or a LangSmith API key.

Deploy

Before you deploy, make sure you have a LangSmith account, then add a .dockerignore so your .env never ends up in the image:

.env
.venv
__pycache__
.langgraph_api

Then deploy from the project folder with the LangGraph CLI:

langgraph deploy --name openbot-deep-agent --agent-server-type dedicated

The CLI builds the image, creates the deployment and saves the keys from your .env as secrets. We use a dedicated server so your agent is always running. The default serverless option sleeps when idle, which works for testing but adds a slow start to scheduled runs. To ship a change later, run the same command again.

Copy your deployment's URL from LangSmith. Your OpenBot address is that URL plus /agent:

curl -H "Authorization: Bearer $OPENBOT_AGENT_KEY" <your-deployment-url>/agent/capabilities

Now create the Bot with this address and Bearer <your OPENBOT_AGENT_KEY> in the Key field, the same way as in section 2. It works in the desktop app, the browser or your own OpenBot install.

See CopilotKit's Deploy to LangSmith guide, and LangChain's Deploy to Cloud for logs, scaling and deploying from GitHub.

5. See it work: generative UI, routines and artifacts

Here's the agent at work in OpenBot, using the tools from section 3.

Answer with charts using generative UI

Your Bot gets OpenBot's generative UI out of the box, so it can answer with charts, tables and cards in place of plain text. Here, the Bot compares GitHub stars for CopilotKit/CopilotKit, ag-ui-protocol/ag-ui and CopilotKit/OpenBot.

It plans the work with its todo list, hands each repo to its subagent, then draws the stars as a bar chart right in the conversation, with the sources and date underneath.

Open Source Scout comparing GitHub stars for three repos in a bar chart

Set up a weekly routine

A one-off comparison is useful, but most teams want to keep watching. For instance, here we tell the Bot: "Check CopilotKit/CopilotKit, ag-ui-protocol/ag-ui and CopilotKit/OpenBot every Monday at 9am and post their updated stars and open issues here".

OpenBot shows an approval card first, since a routine changes something in your workspace. Choose Allow once, and the Bot confirms the schedule in the chat.

The new routine shows up in the Routines tab, and OpenBot runs it every Monday on its own, even when nobody has the app open.

Create artifacts like dashboards and decks

Like artifacts in Claude, your Bot in OpenBot can create documents, decks, sheets and dashboards right from the conversation. Your team can open them again later, comment on them, share them or export them to PDF, Word, PowerPoint or Excel.

For instance, here we asked the Bot to build a dashboard artifact for the same three repos, with headline numbers for stars, open issues and last push.

Every artifact the Bot makes is saved in the Artifacts tab, next to the ones your other Bots create.

That's just a small fraction of what OpenBot can do. Your Bot can also browse sites on its own computer, hand work to other Bots, and run within boundaries, admin controls and a full audit log. Check the changelog for the latest updates, and try OpenBot with your own Deep Agent.

FAQ

Can I bring my other LangChain and LangGraph agents into OpenBot?

Yes. Any agent built with create_agent or a custom LangGraph graph connects the same way: serve it with ag-ui-langgraph and pick LangChain in OpenBot.

Do I need LangSmith to connect a Deep Agent to OpenBot?

No. OpenBot only needs your agent's address. LangSmith takes care of hosting, scaling and deploys for you, but the same endpoint runs on any server.

Can I use Managed Deep Agents instead?

Not yet. Managed Deep Agents doesn't support custom routes, and OpenBot needs the AG-UI endpoint, so this guide uses a LangSmith deployment.

Can my Deep Agent use my team's apps?

Yes. Apps connected in OpenBot, like GitHub, Slack or Linear, reach your agent as tools. They run with each person's own account, and OpenBot asks before anything gets sent or changed.

Does OpenBot ask before my agent's own tools run?

OpenBot asks before its own tools and connected apps send or change anything. Your agent's own tools run in your code, so they need their own checks. That's why the agent in this guide sends writes, like opening GitHub issues, through the connected GitHub app, where OpenBot asks first.

Can my Deep Agent work with other Bots?

Yes. Bots work as subagents in OpenBot, so your Deep Agent can hand part of a task to another Bot, like a Designer Bot for the cover, or run a part on another model you've connected. In a team, you choose which Bots can work with which.

Which models can my Deep Agent use?

Any model your agent supports. Your agent keeps its own model, and OpenBot doesn't change it.

Get Started

You can now bring your LangChain Deep Agents into a workspace you own, as AI coworkers. They run in production on LangSmith with auth, and get generative UI, routines, artifacts and more out of the box.

For companies and teams, OpenBot adds SSO, boundaries, a complete audit trail and admin controls. Book a call to see it in action.

To learn more:

Follow OpenBot on Twitter for updates. If you get stuck or have feedback, reach out on GitHub or in the CopilotKit and AG-UI communities. We'd love to hear from you.

Top posts

See All
OpenBot vs Instinct: Open-Source Alternative to the AI Personal Assistant
Anmol Baranwal and Eli BermanDecember 3, 2026
OpenBot vs Instinct: Open-Source Alternative to the AI Personal AssistantOpenBot vs Instinct: an open-source alternative to the AI personal assistant you text or call. Instinct runs personal errands on undisclosed models, by invite only, while OpenBot gives every team AI coworkers for work, with any model and your own agents, in an enterprise-ready workspace. See how they compare on models, agents, data, controls and pricing, and when to choose which.
OpenBot vs Viktor: Open-Source Alternative With Self-Hosted AI Employees
Anmol Baranwal and Eli BermanDecember 3, 2026
OpenBot vs Viktor: Open-Source Alternative With Self-Hosted AI EmployeesOpenBot vs Viktor: a self-hosted, open-source alternative to the hosted AI employee. Viktor runs one shared AI employee per workspace in its own cloud on credits, while OpenBot gives every team AI coworkers with their own computers, any model and your own agents, in an enterprise-ready workspace priced per user. See how they compare on models, agents, data, controls and pricing, and when to choose which.
OpenBot vs Paperclip: Open-Source AI Agents With Their Own Computers
Anmol Baranwal and Eli BermanDecember 3, 2026
OpenBot vs Paperclip: Open-Source AI Agents With Their Own ComputersOpenBot vs Paperclip: an open-source alternative to the app for managing a team of AI agents. Paperclip organizes agents you bring and run yourself, while OpenBot comes with self-learning AI coworkers that are ready to work, each on its own computer. You can use any model and run your own agents under the hood. See how they compare on agents, setup, controls, sign-in and pricing, and when to choose which.
Are you ready?

Stay in the know

Subscribe to our blog and get updates on CopilotKit in your inbox.