Metadata-Version: 2.4
Name: swarmd-langchain
Version: 0.3.2
Summary: SwarmD integration for LangChain
Author-email: SwarmD <support@swarmd.ai>
License: MIT
Project-URL: Homepage, https://swarmd.ai
Project-URL: Documentation, https://docs.swarmd.ai
Keywords: swarmd,agent,langchain,a2a
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: swarmd-sdk>=0.2.0
Requires-Dist: langchain>=0.3.0
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: langchain-openai>=0.2.0
Requires-Dist: langchain-mcp-adapters>=0.1.0
Requires-Dist: mcp<2,>=1.0
Requires-Dist: a2a-sdk<1.0,>=0.3.9
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: starlette>=0.37.0
Requires-Dist: uvicorn[standard]>=0.32.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: aiosqlite>=0.20.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-mock>=3.12.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.2.0; extra == "dev"
Requires-Dist: respx>=0.21.0; extra == "dev"
Requires-Dist: ruff>=0.3.0; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"

# swarmd-langchain

[Swarmd](https://swarmd.ai) integration for LangChain. Wires a LangChain agent
into the Swarmd platform: authenticated A2A clients, discovery of the agents
and MCP servers you are subscribed to, a polling tool that proxies to remote
A2A agents, and an executor that bridges incoming A2A requests into a LangChain
`AgentExecutor`.

```bash
pip install swarmd-langchain
```

Requires Python 3.9+. Pulls in [`swarmd-sdk`](https://pypi.org/project/swarmd-sdk/)
and `langchain`.

## Quick start

```python
from swarmd_langchain import create_runtime, create_llm_agent, fetch_remote_agents, serve

runtime = create_runtime()

agent = create_llm_agent(
    runtime,
    name="my_agent",
    description="Does the thing",
    instruction="You are a helpful assistant.",
    tools=fetch_remote_agents(runtime),
)

serve(agent, runtime)
```

`create_runtime()` reads the same `SWARMD_*` environment variables as
`swarmd-sdk` — see that package for the full list.

## What's in the box

| | |
|---|---|
| `create_runtime` | a `SwarmDRuntime` wired for LangChain |
| `create_llm_agent` | a LangChain agent configured against the platform |
| `fetch_remote_agents` | the agents you are subscribed to, as LangChain tools |
| `fetch_mcp_tools` | the MCP servers you are subscribed to, as LangChain tools |
| `create_a2a_client_factory` | authenticated A2A clients |
| `PollingA2aTool` | tool that proxies to a remote A2A agent, polling non-terminal states |
| `LangChainA2aExecutor` | serves an `AgentExecutor` over the A2A protocol |
| `serve` | serve the agent over A2A with the admin/webhook app mounted |

## Documentation and support

Full documentation is at [docs.swarmd.ai](https://docs.swarmd.ai). For help,
email <support@swarmd.ai>.

MIT licensed.
