Skip to main content

Deep Agents ACP integration

This directory contains an Agent Client Protocol (ACP) connector that allows you to run a Python Deep Agent within a text editor that supports ACP such as Zed.

Deep Agents ACP Demo

It includes an example coding agent that uses Anthropic's Claude models to write code with its built-in filesystem tools and shell, but you can also connect any Deep Agent with additional tools or different agent architectures!

Getting started

First, make sure you have Zed and uv installed.

Next, clone this repo:

git clone git@github.com:langchain-ai/docagent.git

Then, navigate into the newly created folder and run uv sync:

cd docagent/libs/acp
uv sync --group examples

Rename the .env.example file to .env and add your Anthropic API key. You may also optionally set up tracing for your Deep Agent using LangSmith by populating the other env vars in the example file:

ANTHROPIC_API_KEY=""

# Set up LangSmith tracing for your Deep Agent (optional)

# LANGSMITH_TRACING=true
# LANGSMITH_API_KEY=""
# LANGSMITH_PROJECT="docagent-acp"

Finally, add this to your Zed settings.json:

{
  "agent_servers": {
    "DeepAgents": {
      "type": "custom",
      "command": "/your/absolute/path/to/docagent-acp/run_demo_agent.sh"
    }
  }
}

You must also make sure that the run_demo_agent.sh entrypoint file is executable - this should be the case by default, but if you see permissions issues, run:

chmod +x run_demo_agent.sh

Now, open Zed's Agents Panel (e.g. with CMD + Shift + ?). You should see an option to create a new Deep Agent thread:

And that's it! You can now use the Deep Agent in Zed to interact with your project.

If you need to upgrade your version of Deep Agents, pull the latest changes and re-sync:

git pull && uv sync --group examples

Or for specific packages:

uv lock --upgrade-package langchain_anthropic # for example

Launch a custom Deep Agent with ACP

uv add docagent-acp
import asyncio

from acp import run_agent
from docagent import create_deep_agent
from langgraph.checkpoint.memory import MemorySaver

from docagent_acp.server import AgentServerACP


async def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"It's always sunny in {city}!"


async def main() -> None:
    agent = create_deep_agent(
        tools=[get_weather],
        system_prompt="You are a helpful assistant",
        checkpointer=MemorySaver(),
    )
    server = AgentServerACP(agent)
    await run_agent(server)


if __name__ == "__main__":
    asyncio.run(main())

Launch with Toad

uv tool install -U batrachian-toad --python 3.14

toad acp "python path/to/your_server.py" .
# or
toad acp "uv run python path/to/your_server.py" .

Model Switching

The ACP adapter supports dynamic model switching using Session Config Options. This allows users to switch between different LLM models mid-session without losing conversation history.

Quick Example

from docagent_acp.server import AgentServerACP, AgentSessionContext

# Define available models
models = [
    {"value": "anthropic:claude-opus-4-6", "name": "Claude Opus 4"},
    {"value": "anthropic:claude-sonnet-4", "name": "Claude Sonnet 4"},
    {"value": "openai:gpt-4-turbo", "name": "GPT-4 Turbo"},
]

# Create an agent factory that uses the model from context
def build_agent(context: AgentSessionContext):
    model = context.model

    # Pass model string directly - it handles provider:model-name format
    return create_deep_agent(
        model=model,
        checkpointer=checkpointer,
        backend=create_backend,
    )

# Pass models to the server
server = AgentServerACP(agent=build_agent, models=models)

You can see a full example here with LangChain's model profile feature.

Release files for docagent-acp 0.0.4

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

Source distribution (sdist)

Source distribution for docagent-acp 0.0.4
File Size Uploaded
docagent_acp-0.0.4.tar.gz 13.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for docagent-acp 0.0.4
File Interpreter ABI Platform
docagent_acp-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 MB

Release files / docagent_acp-0.0.4.tar.gz

Download URL docagent_acp-0.0.4.tar.gz
Size 13.0 MB
Tags Source
SHA-256 checksum
How to use checksums
d19d41d1b1bb9c6a06a8bd6ef8aec2e32195a4b6a87ac81894665b4951137254
BLAKE2b-256 checksum
How to use checksums
10bb2521f92a500895413b0769584cec292caf4f4bd70e0d0e45cff2da9306b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.0

Release files / docagent_acp-0.0.4-py3-none-any.whl

Download URL docagent_acp-0.0.4-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fdf0be8ae61eec84179b4cd21d24d88cb977f559e10d6ebea48e802aa3ce0fb
BLAKE2b-256 checksum
How to use checksums
90ebadb6bde30ab625fb2bdfd6def05573bf38faa527304225502dd64cd716d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.0

Release history Release notifications | RSS feed

This release

0.0.4 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