Skip to main content

Agent Client Protocol integration for Deep Agents

Project description

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/deepagents.git

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

cd deepagents/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="deepagents-acp"

Finally, add this to your Zed settings.json:

{
  "agent_servers": {
    "DeepAgents": {
      "type": "custom",
      "command": "/your/absolute/path/to/deepagents-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 deepagents-acp
import asyncio

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

from deepagents_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 deepagents_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.

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_acp-0.0.7.tar.gz (13.0 MB view details)

Uploaded Source

Built Distribution

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

deepagents_acp-0.0.7-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file deepagents_acp-0.0.7.tar.gz.

File metadata

  • Download URL: deepagents_acp-0.0.7.tar.gz
  • Upload date:
  • Size: 13.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for deepagents_acp-0.0.7.tar.gz
Algorithm Hash digest
SHA256 acd50daabd33319fa1b9a8ffe8c406cd7ccdfe50802adc653db67c2cb2c30b9e
MD5 d3623583ee57988449137fcc23e2a4bd
BLAKE2b-256 d5f80ed7b07ef7a28a89ab10267ac018c2a88dd970698ea6fad73ed2162a6ea4

See more details on using hashes here.

File details

Details for the file deepagents_acp-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: deepagents_acp-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for deepagents_acp-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 748400d3c62b10059b351bbb84de204101eb73042399b6839ec277314231acc8
MD5 c4889c8a7f41556a8a6e2c5af1f5dab7
BLAKE2b-256 cf230adabc5b879902d6dec1a70e652864de8408d842cc1d0fc8c3be5a289ab4

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