Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion python/uagents-adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This package provides adapters for integrating [uAgents](https://github.com/fetc
- **MCP Server Adapter**: Integrate Model Control Protocol (MCP) servers with uAgents
- **A2A Outbound Adapter**: Bridges uAgents and A2A servers
- **A2A Inbound Adapter**: Bridge Agentverse agents to A2A protocol for AI assistants
- **Composio Adapter**: Integrate Composio tools and create specialized multi-agent systems

## Installation

Expand All @@ -28,6 +29,9 @@ pip install "uagents-adapter[a2a-inbound]"

# Install with A2A Outbound support
pip install "uagents-adapter[a2a-outbound]"

# Install with Composio support
pip install "uagents-adapter[composio]"
```

## LangChain Adapter
Expand Down Expand Up @@ -339,7 +343,40 @@ python -m uagents_adapter.a2a_inbound.cli \

> **Security Note**: Always set `UAGENTS_BRIDGE_SEED` environment variable for production deployments to ensure consistent bridge agent addresses across restarts and prevent conflicts.


## Composio Adapter

The Composio adapter allows you to integrate Composio tools and create specialized agents that can interact with various external services through the Composio platform.

```python
import asyncio
from uagents import Agent
from uagents_adapter import ComposioConfig, ToolConfig, ComposioService

async def main():
# Configure tools
tool_config = ToolConfig.from_toolkit(
tool_group_name="GitHub Tools",
auth_config_id="your_github_auth_config_id",
toolkit="GITHUB",
limit=5
)

# Create Composio configuration
composio_config = ComposioConfig.from_env(tool_configs=[tool_config])

# Initialize agent
agent = Agent(name="My Composio Agent", seed="my_seed", port=8001, mailbox=True)

# Create and configure Composio service
async with ComposioService(composio_config=composio_config) as service:
agent.include(service.protocol, publish_manifest=True)
await agent.run_async()

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

The adapter supports multiple tool configurations, modifiers for customization, and multi-agent orchestration with specialized agents for different tool groups. See the [Composio documentation](src/uagents_adapter/composio/README.md) for advanced configuration options.

## Agentverse Integration

Expand Down
4,799 changes: 4,681 additions & 118 deletions python/uagents-adapter/poetry.lock

Large diffs are not rendered by default.

29 changes: 22 additions & 7 deletions python/uagents-adapter/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ description = "Adapters for uAgents to integrate with LangChain, CrewAI, MCP, an
authors = [{ name = "Fetch.AI Limited" }]
license = { text = "Apache 2.0" }
readme = "README.md"
keywords = ["uagents", "agents", "langchain", "crewai", "mcp", "a2a", "fetch.ai"]
requires-python = ">=3.10,<4.0"
keywords = ["uagents", "agents", "langchain", "crewai", "mcp", "a2a", "fetch.ai", "composio"]
requires-python = ">=3.10,<3.14"
dependencies = [
"uagents (>=0.22.3)",
"pydantic (>=2.8,<3.0)",
Expand All @@ -21,17 +21,22 @@ dependencies = [
[project.optional-dependencies]
# Base package dependencies (installed by default)
all = [
"langchain-core (>=0.3.52,<0.4.0)",
"langchain (>=0.3.0)",
"langchain-openai (>=0.2.0)",
"langchain-core (>=0.3.52)",
"crewai (==0.203.1)",
"mcp (>=1.8.1)",
"a2a-sdk[all,sqlite,sql] (>=0.2.11)",
"composio (>=0.8.16)",
"composio-langchain (>=0.8.14)",
"langchain-openai (>=0.3.33)",
"langchain (==1.0.2)",
"langgraph (>=0.6.8)",
"langgraph-checkpoint-postgres (>=2.0.24)",
"psycopg[pool] (>=3.2.10)",
]

# LangChain support
langchain = [
"langchain-core (>=0.3.52,<0.4.0)",
"langchain-core (>=0.3.52)",
"langchain (>=0.3.0)",
"langchain-openai (>=0.2.0)",
]
Expand All @@ -56,6 +61,16 @@ a2a-outbound = [
"a2a-sdk[all,sqlite,sql] (>=0.2.11)",
]

# Composio support
composio = [
"composio (>=0.8.16)",
"composio-langchain (>=0.8.14)",
"langchain-openai (>=0.3.33)",
"langchain (==1.0.2)",
"langgraph (>=0.6.8)",
"langgraph-checkpoint-postgres (>=2.0.24)",
"psycopg[pool] (>=3.2.10)",
]

[tool.poetry]
# install from src/uagents_adapter folder
Expand Down Expand Up @@ -95,4 +110,4 @@ select = [
ignore = ["PLR0913", "PLR0912", "PLR0911", "PLR2004", "PLR0915"]

[tool.ruff.lint.pycodestyle]
max-line-length = 100
max-line-length = 100
69 changes: 68 additions & 1 deletion python/uagents-adapter/src/uagents_adapter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Adapters for uAgents to integrate with LangChain, CrewAI, and MCP."""
"""Adapters for uAgents to integrate with LangChain, CrewAI, MCP, Composio and A2A."""

from importlib import metadata

Expand All @@ -22,6 +22,36 @@
A2A_AVAILABLE = False
# Do not define placeholders; raise a clear ImportError on access instead

try:
from .composio import (
AfterExecute,
AfterExecuteParam,
AuthConfigId,
AuthenticationError,
AuthResponse,
BeforeExecute,
BeforeExecuteParam,
ComposioConfig,
ComposioError,
ComposioService,
ConfigurationError,
ConnectionError,
ConnectionStatus,
Modifiers,
PostgresMemoryConfig,
SchemaModifier,
SchemaModifierParam,
SessionId,
ToolConfig,
ToolRetrievalError,
ToolSlug,
UserId,
)

COMPOSIO_AVAILABLE = True
except ImportError:
COMPOSIO_AVAILABLE = False

try:
__version__ = metadata.version(__package__)
except metadata.PackageNotFoundError:
Expand Down Expand Up @@ -52,3 +82,40 @@
"SingleA2AAdapter",
]
)
else:
print(
"A2A modules are not available. Please install the required dependencies to use A2A features."
)

if COMPOSIO_AVAILABLE:
__all__.extend(
[
# Main classes
"ComposioService",
"ComposioConfig",
"ToolConfig",
"Modifiers",
"PostgresMemoryConfig",
# Response models
"ConnectionStatus",
"AuthResponse",
# Exceptions
"ComposioError",
"AuthenticationError",
"ConnectionError",
"ConfigurationError",
"ToolRetrievalError",
# Type aliases
"UserId",
"AuthConfigId",
"ToolSlug",
"SessionId",
# Tool types
"SchemaModifier",
"BeforeExecute",
"AfterExecute",
"SchemaModifierParam",
"BeforeExecuteParam",
"AfterExecuteParam",
]
)
Loading