composio-core

[DEPRECATED] Core package to act as a bridge between composio platform and other services. Please use 'composio' instead.

222 个版本 Python <4,>=3.9
Utkarsh <utkarsh@composio.dev>
安装
pip install composio-core
poetry add composio-core
pipenv install composio-core
conda install composio-core
描述

EN | CN | JP

Composio logo Composio Logo

Read the Docs

PyPI NPM Downloads

Production Ready Toolset for AI Agents

Composio MCP Servers

Composio Cursor

🚀 Now launching Composio MCP🚀

We're excited to announce the launch of Composio MCP Servers! Connect Claude, Cursor and Windsurf to 100+ fully-managed MCP Servers with built-in auth! Check it out here

Learn More About MCP Servers

What is Composio?

Composio provides production-ready toolset for AI agents, offering:

  • Support for over 250+ tools across multiple categories:
    • Software tools like GitHub, Notion, Linear, Gmail, Slack, Hubspot, Salesforce & more
    • OS operations including file tool, shell tool, code analysis tool & more
    • Search capabilities through Google, Perplexity, Tavily, and Exa & more
  • Comprehensive framework support including OpenAI, Groq, Claude, LlamaIndex, Langchain, CrewAI, Autogen, Gemini, and more
  • Managed authentication supporting multiple protocols (OAuth, API Keys, Basic JWT)
  • Up to 40% improved tool call accuracy through optimized design
  • Whitelabel solution for backend integration
  • Pluggable architecture supporting custom tools and extensions

Table of contents

Getting Started with Python

1. Installation

Start by installing the package

pip install composio-core

If you want to install the 'composio' package along with its openai plugin: pip install composio-openai.

2. Creating an agent & executing a tool

Let's create an AI Agent using OpenAI and use Composio's GitHub tool to star a GitHub repository

[!NOTE] Set your COMPOSIO_API_KEY & OPENAI_API_KEY in your environment variables.

Connect your GitHub account to Composio

composio add github # Run this in terminal

from openai import OpenAI
from composio_openai import ComposioToolSet, App, Action

# Initialize OpenAI client
openai_client = OpenAI(
    api_key="{{OPENAIKEY}}"
)

# Initialize the Composio Tool Set
composio_tool_set = ComposioToolSet()

# Get GitHub tools that are pre-configured
actions = composio_tool_set.get_actions(
    actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER]
)

my_task = "Star a repo composiodev/composio on GitHub"

# Setup OpenAI assistant
assistant_instruction = "You are a super intelligent personal assistant"
assistant = openai_client.beta.assistants.create(
    name="Personal Assistant",
    instructions=assistant_instruction,
    model="gpt-4-turbo",
    tools=actions,
)

# Create a thread
thread = openai_client.beta.threads.create()

# Add user message to thread
message = openai_client.beta.threads.messages.create(
    thread_id=thread.id,
    role="user",
    content=my_task
)

# Execute Agent with integrations
run = openai_client.beta.threads.runs.create(
    thread_id=thread.id,
    assistant_id=assistant.id
)

# Execute Function calls
response_after_tool_calls = composio_tool_set.wait_and_handle_assistant_tool_calls(
    client=openai_client,
    run=run,
    thread=thread,
)

print(response_after_tool_calls)

Getting Started with JavaScript

To get started with the Composio SDK in JavaScript, follow these steps:

1. Installation:

npm install composio-core

2. Creating an agent & executing a tool

Let's create an AI Agent using OpenAI and use Composio's GitHub tool to star a GitHub repository

[!NOTE] Set your COMPOSIO_API_KEY & OPENAI_API_KEY in your environment variables.

Connect your GitHub account to Composio

composio add github # Run this in terminal
import { OpenAIToolSet } from "composio-core";
import OpenAI from "openai";

const toolset = new OpenAIToolSet({ apiKey: process.env.COMPOSIO_API_KEY });
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const tools = await toolset.getTools({ 
  actions: ["GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"] 
});

async function createGithubAssistant(openai, tools) {
  return await openai.beta.assistants.create({
    name: "Github Assistant",
    instructions: "You're a GitHub Assistant, you can do operations on GitHub",
    tools: tools,
    model: "gpt-4o"
  });
}

async function executeAssistantTask(openai, toolset, assistant, task) {
  const thread = await openai.beta.threads.create();
  
  const run = await openai.beta.threads.runs.create(thread.id, {
    assistant_id: assistant.id,
    instructions: task,
    tools: tools,
    model: "gpt-4o",
    stream: false
  });
  
  const call = await toolset.waitAndHandleAssistantToolCalls(openai, run, thread);
  console.log(call);
}

(async () => {
  const githubAssistant = await createGithubAssistant(openai, tools);
  
  await executeAssistantTask(
    openai,
    toolset,
    githubAssistant,
    "Star the repository 'composiohq/composio'"
  );
})();

Examples

Python Examples

Javascript Examples

Star History

Star HistoryChart

Getting help

Contributions

We're an open-source project and welcome contributions. Please read the contributing guide for more information and check our code of conduct before you start.

Request a feature

  • If you have a feature request, please open an issue, make a pull request, or submit it in our feature requests channel.
  • If you have ideas for improvements, you can also start a discussion in our GitHub repository.

Thanks To All Contributors

List of Contributors



discord     youtube     x     linkedin

版本列表
0.7.21 2025-09-09
0.7.20 2025-07-03
0.7.19 2025-06-19
0.7.18 2025-06-13
0.7.17 2025-06-12
0.7.16 2025-05-27
0.7.15 2025-04-07
0.7.14 2025-04-02
0.7.13 2025-04-01
0.7.12 2025-03-27
0.7.11 2025-03-25
0.7.10 2025-03-18
0.7.9 2025-03-17
0.7.8 2025-03-14
0.7.7 2025-03-10
0.7.6 2025-03-06
0.7.5 2025-03-05
0.7.4 2025-02-20
0.7.3 2025-02-20
0.7.2 2025-02-11
0.7.1 2025-02-05
0.7.0 2025-02-04
0.7.19rc1 2025-06-19
0.7.16rc1 2025-04-21
0.6.19 2025-01-28
0.6.18 2025-01-24
0.6.17 2025-01-24
0.6.16 2025-01-20
0.6.15 2025-01-15
0.6.14 2025-01-14
0.6.13 2025-01-09
0.6.12 2025-01-07
0.6.11 2025-01-03
0.6.11.post1 2025-01-03
0.6.10 2025-01-02
0.6.9 2024-12-31
0.6.8 2024-12-31
0.6.7 2024-12-24
0.6.6 2024-12-23
0.6.5 2024-12-20
0.6.4 2024-12-20
0.6.3 2024-12-18
0.6.2 2024-12-16
0.6.1 2024-12-16
0.6.0 2024-12-12
0.6.20rc1 2025-02-03
0.6.19rc1 2025-01-28
0.6.0rc1 2024-12-11
0.5.51 2024-12-05
0.5.50 2024-11-28
0.5.49 2024-11-26
0.5.47 2024-11-25
0.5.46 2024-11-23
0.5.45 2024-11-22
0.5.44 2024-11-21
0.5.43 2024-11-20
0.5.42 2024-11-14
0.5.41 2024-11-11
0.5.40 2024-11-06
0.5.39 2024-11-06
0.5.38 2024-11-04
0.5.37 2024-10-28
0.5.36 2024-10-25
0.5.35 2024-10-23
0.5.34 2024-10-17
0.5.33 2024-10-17
0.5.31 2024-10-11
0.5.30 2024-10-05
0.5.28 2024-09-25
0.5.27 2024-09-23
0.5.26 2024-09-23
0.5.25 2024-09-19
0.5.24 2024-09-18
0.5.23 2024-09-14
0.5.22 2024-09-13
0.5.21 2024-09-13
0.5.20 2024-09-13
0.5.19 2024-09-12
0.5.18 2024-09-12
0.5.17 2024-09-11
0.5.16 2024-09-10
0.5.15 2024-09-05
0.5.14 2024-09-05
0.5.13 2024-09-03
0.5.12 2024-09-03
0.5.11 2024-08-31
0.5.10 2024-08-29
0.5.9 2024-08-28
0.5.8 2024-08-27
0.5.7 2024-08-27
0.5.6 2024-08-25
0.5.5 2024-08-24
0.5.4 2024-08-24
0.5.3 2024-08-22
0.5.2 2024-08-22
0.5.1 2024-08-12
0.5.0 2024-08-21
0.5.52rc2 2024-12-08
0.5.52rc1 2024-12-08
0.5.51rc1 2024-12-11
0.5.48rc1 2024-11-25
0.5.38rc2 2024-11-02
0.5.37rc1 2024-11-01
0.5.0rc2 2024-08-21
0.5.0rc1 2024-08-21
0.5.0rc0 2024-08-21
0.4.5 2024-08-19
0.4.4 2024-08-17
0.4.3 2024-08-16
0.4.2 2024-08-13
0.4.1 2024-08-05
0.4.0 2024-07-31
0.4.5rc1 2024-08-20
0.4.5rc0 2024-08-19
0.4.2rc2 2024-08-19
0.4.2rc1 2024-08-16
0.3.30 2024-07-26
0.3.29 2024-07-26
0.3.28 2024-07-24
0.3.27 2024-07-23
0.3.26 2024-07-23
0.3.25 2024-07-19
0.3.24 2024-07-19
0.3.23 2024-07-16
0.3.22 2024-07-16
0.3.20 2024-07-12
0.3.19 2024-07-10
0.3.18 2024-07-09
0.3.17 2024-07-09
0.3.16 2024-06-28
0.3.15 2024-06-27
0.3.14 2024-06-25
0.3.13 2024-06-21
0.3.12 2024-06-19
0.3.11 2024-06-18
0.3.10 2024-06-18
0.3.9 2024-06-08
0.3.7 2024-06-01
0.3.6 2024-06-01
0.3.5 2024-06-01
0.3.4 2024-06-01
0.3.3 2024-05-31
0.3.2 2024-05-30
0.3.1 2024-05-30
0.3.0 2024-05-30
0.3.9rc4 2024-06-08
0.3.9rc3 2024-06-08
0.3.9rc2 2024-06-07
0.3.9rc1 2024-06-06
0.3.23rc0 2024-07-17
0.3.20rc1 2024-07-15
0.3.20rc0 2024-07-15
0.3.18rc2 2024-07-11
0.3.18rc1 2024-07-11
0.3.18rc0 2024-07-10
0.2.64 2024-05-23
0.2.63 2024-05-23
0.2.60 2024-05-14
0.2.59 2024-05-13
0.2.56 2024-05-10
0.2.55 2024-05-10
0.2.54 2024-05-10
0.2.52 2024-05-07
0.2.51 2024-05-06
0.2.50 2024-05-06
0.2.49 2024-05-06
0.2.48 2024-05-05
0.2.47 2024-05-02
0.2.46 2024-05-01
0.2.44 2024-05-01
0.2.41 2024-05-02
0.2.40 2024-05-01
0.2.39 2024-05-01
0.2.38 2024-04-30
0.2.37 2024-04-30
0.2.36 2024-04-30
0.2.35 2024-04-30
0.2.34 2024-04-30
0.2.33 2024-04-30
0.2.32 2024-04-30
0.2.22 2024-04-24
0.2.21 2024-04-24
0.2.20 2024-04-24
0.2.19 2024-04-24
0.2.18 2024-04-24
0.2.17 2024-04-24
0.2.16 2024-04-23
0.2.15 2024-04-23
0.2.14 2024-04-23
0.2.12 2024-04-19
0.2.11 2024-04-18
0.2.10 2024-04-18
0.2.9 2024-04-18
0.2.8 2024-04-18
0.2.7 2024-04-17
0.2.6 2024-04-16
0.2.5 2024-04-16
0.2.4 2024-04-16
0.2.3 2024-04-16
0.2.2 2024-04-16
0.2.1 2024-04-15
0.2.0 2024-04-15
0.2.36rc2 2024-05-30
0.2.36rc1 2024-05-30
0.1.101 2024-04-12
0.1.100 2024-04-12
0.1.99 2024-04-12
0.1.98 2024-04-12
0.1.97 2024-04-12
0.1.96 2024-04-12
0.1.95 2024-04-12
0.1.94 2024-04-12
0.1.93 2024-04-12
0.1.92 2024-04-12
0.1.91 2024-04-12
0.1.90 2024-04-12
0.1.89 2024-04-12
0.1.88 2024-04-11
0.1.87 2024-04-11
0.1.84 2024-04-07
0.1.83 2024-04-07
0.1.82 2024-04-07