Expose LangChain and LangGraph agents through ACP Kit.
Project description
langchain-acp
langchain-acp exposes LangChain, LangGraph, and DeepAgents graphs through ACP Kit.
It keeps ACP Kit's adapter architecture intact while staying graph-centric on the LangChain side:
graph=...graph_factory=...graph_source=...
Install
uv add langchain-acp
pip install langchain-acp
With optional DeepAgents compatibility:
uv add "langchain-acp[deepagents]"
pip install "langchain-acp[deepagents]"
Contributor setup from the monorepo root:
uv sync --extra dev --extra langchain
Quickstart
from langchain.agents import create_agent
from langchain_acp import run_acp
graph = create_agent(model="openai:gpt-5", tools=[])
run_acp(graph=graph)
If ACP session state should affect graph construction, use graph_factory=:
from langchain.agents import create_agent
from langchain_acp import AcpSessionContext, create_acp_agent
def graph_from_session(session: AcpSessionContext):
mode_name = session.session_mode_id or "default"
return create_agent(model="openai:gpt-5", tools=[], name=f"graph-{mode_name}")
acp_agent = create_acp_agent(graph_factory=graph_from_session)
What The Adapter Covers
langchain-acp carries the same ACP Kit seams that matter elsewhere in the repo, but mapped onto graph ownership instead of agent ownership:
- session stores and transcript replay
- model, mode, and config-option providers
- native plan state through
TaskPlan - approval bridging from
HumanInTheLoopMiddleware - capability bridges and graph-build contributions
- tool projection maps and event projection maps
graph,graph_factory, andgraph_source- DeepAgents compatibility helpers where they add truthful ACP behavior
That means the adapter can expose:
- plain LangChain
create_agent(...)graphs - compiled LangGraph graphs
- DeepAgents graphs
without collapsing everything into a bespoke ACP runtime.
Session-owned Graph Rebuilds
If ACP session state should decide which graph gets built, graph_factory= is the intended seam:
from langchain.agents import create_agent
from langchain_acp import AcpSessionContext, AdapterConfig, MemorySessionStore, run_acp
def graph_from_session(session: AcpSessionContext):
mode_name = session.session_mode_id or "default"
model_name = session.session_model_id or "openai:gpt-5-mini"
return create_agent(
model=model_name,
tools=[],
name=f"graph-{mode_name}",
system_prompt=f"Operate in {mode_name} mode.",
)
run_acp(
graph_factory=graph_from_session,
config=AdapterConfig(session_store=MemorySessionStore()),
)
Use this when workspace path, mode, model, or session metadata should rebuild the graph dynamically.
DeepAgents Compatibility
DeepAgents graphs are supported as compiled LangGraph targets.
Use the compatibility helpers only when they add real value:
DeepAgentsCompatibilityBridgeDeepAgentsProjectionMap
Maintained examples:
Docs:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_acp-0.9.0.tar.gz.
File metadata
- Download URL: langchain_acp-0.9.0.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09850b75f2a16f54428d513f7c559b55d7836ef7557747a3c3f8bb92cf9494f2
|
|
| MD5 |
38529fd3aa356ecf051e5c38566ee22c
|
|
| BLAKE2b-256 |
1ce8fb117e5273d1a8caf223c8de706daf4f704631361aaa9eed17bf8148f67a
|
File details
Details for the file langchain_acp-0.9.0-py3-none-any.whl.
File metadata
- Download URL: langchain_acp-0.9.0-py3-none-any.whl
- Upload date:
- Size: 41.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b75fc4d92b1ed1e3c3ed655b1e52feafaf989cb5ca4955847027960f3b5f6a4
|
|
| MD5 |
83fae71d2d6800e4117d3afdf9dc82e0
|
|
| BLAKE2b-256 |
ea7d13ae2bd63d22bd5121e04c1c7f8e3a8ec5f9c2ad6f3fae93e92d2a2a8d99
|