Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill provides comprehensive guidance for building AI agents using Composio SDK with various provider frameworks.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 193% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 102% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 277% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 141% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 144% | 0% |
This skill provides comprehensive guidance for building AI agents using Composio SDK with various provider frameworks.
Composio integrates with 10+ major AI agent frameworks, allowing you to add tools and external integrations to your agents. Each framework-specific skill provides:
If you're working within the Composio SDK repository itself, install packages from the workspace:
TypeScript:
bashpnpm i @composio/core @composio/<provider> --workspace
Example:
bashpnpm i @composio/core @composio/openai --workspace
For projects outside the Composio SDK repository, install from NPM/PyPI:
TypeScript:
bashnpm install @composio/core @composio/<provider>
Python:
bashpip install composio-<provider> # or uv pip install composio-<provider>
Examples:
bash# TypeScript npm install @composio/core @composio/openai # Python pip install composio-openai
Use /building-agents-using-<framework> to access specific guides:
Build agents using OpenAI's Chat Completions API, Assistants API, and Agents API.
Invoke: /building-agents-using-openai
Build agents using Anthropic's Codex API and Codex Agent SDK.
Invoke: /building-agents-using-anthropic
Build agents using LangChain and LangGraph for production workflows.
Invoke: /building-agents-using-langchain
Build stateful, durable agents using LangGraph (v1.0).
Invoke: /building-agents-using-langgraph
Build agents using Google's Gemini API and GenAI SDK.
Invoke: /building-agents-using-google
Build agents using Vercel AI SDK for TypeScript/JavaScript applications.
Invoke: /building-agents-using-vercel
Build RAG-enhanced agents using LlamaIndex.
Invoke: /building-agents-using-llamaindex
Build agents using Mastra, the modern TypeScript framework from the Gatsby team.
Invoke: /building-agents-using-mastra
Build edge-deployed agents using Cloudflare Workers AI and Agents SDK.
Invoke: /building-agents-using-cloudflare
Build multi-agent teams using CrewAI for collaborative AI.
Invoke: /building-agents-using-crewai
Build multi-agent conversational systems using Microsoft AutoGen.
Invoke: /building-agents-using-autogen
Each skill includes commands to find the latest versions of both Composio packages and provider SDKs.
NPM (TypeScript):
bashnpm view @composio/<provider> version # Example npm view @composio/openai version
PyPI (Python):
bashpip index versions composio-<provider> | grep "Available versions" | head -1 # Example pip index versions composio-openai | grep "Available versions" | head -1
NPM (TypeScript):
bashnpm view <provider-package> version # Example npm view openai version
PyPI (Python):
bashpip index versions <provider-package> | grep "Available versions" | head -1 # Example pip index versions openai | grep "Available versions" | head -1
Composio SDK supports two integration methods based on the provider type:
These frameworks support full modifier capabilities and MUST use Tool Router for user-isolated sessions:
| Framework | Package | Why Tool Router | |-----------|---------|----------------| | Vercel AI SDK | @composio/vercel | Multi-agent support, modifiers | | LangChain | @composio/langchain | Complex chains, state management | | LangGraph | @composio/langchain | Stateful workflows, durability | | Mastra | @composio/mastra | Multi-provider routing | | LlamaIndex | @composio/llamaindex | RAG + agents, workflows | | Codex Agent SDK | @composio/Codex-agent-sdk | Codex agents framework | | OpenAI Agents | @composio/openai-agents | OpenAI Agents API | | Cloudflare | @composio/cloudflare | Edge agents, Durable Objects | | CrewAI | Python | Multi-agent teams | | AutoGen | Python | Multi-agent conversations |
Tool Router Benefits:
These providers only support schema modifiers and use direct tools approach:
| Framework | Package | Why Direct Tools | |-----------|---------|-----------------| | OpenAI | @composio/openai | Chat Completions, Assistants API | | Anthropic | @composio/anthropic | Codex Messages API | | Google Gemini | @composio/google | GenAI SDK |
Direct Tools Characteristics:
typescriptimport { Composio } from '@composio/core'; import { OpenAI } from 'openai'; const composio = new Composio(); const openai = new OpenAI(); async function runAgent(userId: string, prompt: string) { // Create isolated session for user const session = await composio.create(userId, { toolkits: ['github'], manageConnections: true // Enable auto-authentication }); // Get tools from session const tools = await session.tools(); // Use with OpenAI const response = await openai.chat.completions.create({ model: 'gpt-4o', messages: [{ role: 'user', content: prompt }], tools: tools, }); // Handle tool calls if (response.choices[0].message.tool_calls) { const result = await composio.provider.handleToolCalls(userId, response); return result; } } // Each user gets isolated tools await runAgent('user_123', 'Create a GitHub issue'); await runAgent('user_456', 'Check my Gmail'); // Different user, different session
Each framework skill includes Tool Router examples. See:
/building-agents-using-openai - Tool Router with OpenAI/building-agents-using-anthropic - Tool Router with Codex/building-agents-using-vercel - Tool Router with Vercel AI SDKFor comprehensive Tool Router documentation, use:
bash/composio-tool-router
Here's a quick example using OpenAI with direct tools (single-user):
typescriptimport { Composio } from '@composio/core'; import { OpenAI } from 'openai'; const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY }); const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY }); // Get tools const tools = await composio.tools.get('default', { toolkits: ['github'] }); // Use with OpenAI const response = await openai.chat.completions.create({ model: 'gpt-4o', messages: [{ role: 'user', content: 'Create a GitHub issue' }], tools: tools, }); // Handle tool calls if (response.choices[0].message.tool_calls) { const result = await composio.provider.handleToolCalls('default', response); console.log(result); }
pythonfrom composio_openai import ComposioToolSet, Action from openai import OpenAI openai_client = OpenAI(api_key="YOUR_OPENAI_KEY") composio_toolset = ComposioToolSet(api_key="YOUR_COMPOSIO_KEY") # Get tools tools = composio_toolset.get_tools(actions=[Action.GITHUB_CREATE_ISSUE]) # Use with OpenAI response = openai_client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Create a GitHub issue"}], tools=tools, ) # Handle tool calls result = composio_toolset.handle_tool_calls(response)
| Provider | Languages | Best For | Complexity | Maturity | |----------|-----------|----------|------------|----------| | OpenAI | TS, Py | General purpose, function calling | Low | Mature | | Anthropic | TS, Py | Complex reasoning, long context | Low | Mature | | LangChain | TS, Py | Prototyping multi-agent workflows | Medium | Mature | | LangGraph | TS, Py | Production stateful agents | High | Mature (v1.0) | | Google Gemini | TS, Py | Compositional function calling | Low | Mature | | Vercel AI SDK | TS | Full-stack web applications | Low | Mature (v6.0) | | LlamaIndex | TS, Py | RAG + agents | Medium | Mature | | Mastra | TS | Modern TypeScript apps | Low | New (v1.0 2026) | | Cloudflare | TS | Edge-deployed agents | Medium | Growing | | CrewAI | Py | Multi-agent teams | Medium | Mature | | AutoGen | Py | Research multi-agent systems | High | Mature |
All frameworks support these Composio features:
typescript// Get tools by app const tools = await composio.tools.get('default', { apps: ['github', 'slack'] }); // Get specific actions const tools = await composio.tools.get('default', { actions: ['GITHUB_CREATE_ISSUE'] }); // Get by toolkit const tools = await composio.tools.get('default', { toolkits: ['github'] });
typescript// Manage user integrations const account = await composio.connectedAccounts.initiate({ integrationId: 'github', entityId: 'user-123', });
typescriptimport { experimental_createTool } from '@composio/core'; import { z } from 'zod'; // Custom tools are session-scoped: define a local tool, then attach it // when creating a Tool Router session. const myTool = experimental_createTool('MY_TOOL', { name: 'My Tool', description: 'Tool description', inputParams: z.object({ param: z.string() }), execute: async input => ({ result: input.param }), }); const session = await composio.create('user-id', { experimental: { customTools: [myTool] }, });
Most examples require:
bash# Composio COMPOSIO_API_KEY=... # LLM Provider (choose one or more) OPENAI_API_KEY=sk-... ANTHROPIC_API_KEY=sk-ant-... GOOGLE_API_KEY=...
ts/examples/ and python/examples/ in this repository/building-agents-using-openai)Other measured skills in the registry, with their headline benchmark lift.