Skip to main content

composio-langgraph

Adapts Composio tools to LangChain's StructuredTool format for use in LangGraph agents and graph workflows, giving them access to 1000+ apps through a single Composio session.

Installation

pip install composio composio-langgraph langgraph langchain langchain-openai

Set COMPOSIO_API_KEY (get one from dashboard.composio.dev/settings) and OPENAI_API_KEY in your environment:

export COMPOSIO_API_KEY=xxxxxxxxx
export OPENAI_API_KEY=xxxxxxxxx

Quickstart

Create a session for your user, fetch its tools, and hand them to your agent. The wrapped tools also work anywhere LangGraph accepts LangChain tools, such as a ToolNode in a custom graph.

from composio import Composio
from composio_langgraph import LanggraphProvider
from langchain.agents import create_agent
from langchain_openai import ChatOpenAI

composio = Composio(provider=LanggraphProvider())
llm = ChatOpenAI(model="gpt-5.2")

# Each session is scoped to one of your users
session = composio.create(user_id="user_123")
tools = session.tools()

agent = create_agent(tools=tools, model=llm)
result = agent.invoke(
    {
        "messages": [
            (
                "user",
                "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'",
            )
        ]
    }
)

print(result["messages"][-1].content)

Error handling

Each wrapped tool builds its args_schema from the Composio tool's input schema. When argument validation fails, the tool does not raise; it returns a structured result:

{"successful": False, "error": "<validation message>", "data": None}

Check successful in tool output instead of wrapping calls in try/except.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

composio_langgraph-0.18.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

composio_langgraph-0.18.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file composio_langgraph-0.18.0.tar.gz.

File metadata

  • Download URL: composio_langgraph-0.18.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for composio_langgraph-0.18.0.tar.gz
Algorithm Hash digest
SHA256 46eff0cbf24efb79ecd458ef79a856e1b1ff420b6b346d4767f1c13c9d1ff043
MD5 27b5f69b879c927a2a696de50d12ba9d
BLAKE2b-256 6106a45f9ba6b9caaba139a540c95abfb6ecb573d9d03f0a51e0b43f2c51f3d0

See more details on using hashes here.

File details

Details for the file composio_langgraph-0.18.0-py3-none-any.whl.

File metadata

File hashes

Hashes for composio_langgraph-0.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f77b8955ef99e8035b7f2c2596dddad644b29f6ad94f8e57cb31b48d9f6cc74f
MD5 f95c42faf710e9263ae60909f9564928
BLAKE2b-256 75045c024f79b602a121ee0edbd6b4cc76ef17ca93134758ad70a80bd0ca341e

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page