# Composio

> Tooling SDK that connects AI agents to external apps and APIs

- Category: Agents & Automation / Agent Frameworks & Builders
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/ComposioHQ/composio
- Website: https://docs.composio.dev
- Canonical page: https://ai-tldr.dev/tools/composio/

## In short

Composio is the official SDK for the Composio platform, available for both Python and TypeScript. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in TypeScript and licensed MIT. To get started: install the core SDK.

## Overview

Composio is the official SDK for the Composio platform, available for both Python and TypeScript. It lets you give AI agents a set of tools so they can take real actions, such as reading a Hacker News post or calling another app's API, instead of only generating text.

Rather than writing custom integration code for each agent framework, you fetch a toolkit through Composio and pass those tools straight into your agent. The SDK works with many frameworks and model providers, including OpenAI, OpenAI Agents, Anthropic, LangChain, LangGraph, LlamaIndex, CrewAI, AutoGen, the Vercel AI SDK, Google Gemini, and Mastra.

## What it does

- Official SDKs for both Python (3.10+) and TypeScript, the latter usable in Node.js and browser environments with full type definitions.
- Provider packages that plug Composio tools into popular agent frameworks like OpenAI Agents, Anthropic, LangChain, LangGraph, LlamaIndex, CrewAI, and AutoGen.
- Toolkit-based access: pull a named toolkit (for example HACKERNEWS) and hand the returned tools directly to your agent.
- Per-user tool calls through a user_id, so tools are fetched in the context of a specific end user.
- Custom provider support to integrate Composio with any AI framework that is not already covered.
- OpenAPI-based specification that the SDK documentation is generated from and can be refreshed during the build.

## Getting started

Composio ships as separate Python and TypeScript SDKs. Install the core package, initialize the client, then add a provider package for the agent framework you use.

1. Install the core SDK

   Use pip or poetry for Python, or npm, yarn, or pnpm for TypeScript.

```bash
pip install composio
# or
npm install @composio/core
```

2. Initialize the client (Python)

   Create a Composio client. You can pass an API key, or rely on environment configuration.

```python
from composio import Composio

composio = Composio(
  # api_key="your-api-key",
)
```

3. Add a provider and fetch tools

   Install the provider package for your framework, then fetch a toolkit and pass the tools to your agent. This example uses the OpenAI Agents provider.

```bash
pip install composio_openai_agents openai-agents
```

4. Build and run an agent

   Get tools for a user and toolkit, attach them to an agent, then run the agent.

```python
from agents import Agent, Runner
from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider

composio = Composio(provider=OpenAIAgentsProvider())

user_id = "user@acme.org"
tools = composio.tools.get(user_id=user_id, toolkits=["HACKERNEWS"])

agent = Agent(
    name="Hackernews Agent",
    instructions="You are a helpful assistant.",
    tools=tools,
)
```

## When to use it

- Give an agent built with OpenAI Agents, LangChain, CrewAI, or another supported framework the ability to call external apps and APIs.
- Fetch a ready-made toolkit, such as Hacker News, and let an agent answer questions using live data from that service.
- Avoid writing custom integration glue for each framework by sharing one tooling layer across Python and TypeScript projects.
- Build a custom provider to bring Composio tools into an AI framework that is not supported out of the box.
