How composiohq/composio works
Composio is a multi-language SDK and CLI for giving AI agents authenticated access to app toolkits. The main workflow is to create a user-scoped session, expose its tools through a provider adapter (or MCP), let an agent discover and execute actions, and return results. Sessions also manage connected accounts, triggers, and files; the CLI offers a shell-based tool workflow. The Python session excerpts show local-versus-backend execution and file operations, while the TypeScript excerpts show session execution, file mounts, and deletion. Other subsystem links reflect README capabilities; unsampled implementation details are not inferred.
Main entry points: ToolRouterSession.ts Tool session · tool_router_session.py Tool session · tool_router.py Session creation · commands CLI workflows
Components 23
TypeScript SDK
- Tool session
ts/packages/core/src/models/ToolRouterSession.ts - Session files
ts/packages/core/src/models/ToolRouterSessionFileMount.ts - Session deletion
ts/packages/core/src/lib/toolRouterSessionDelete.ts - Session models
ts/packages/core/src/types/ToolRouterSessionFilesMount.types.ts - Telemetry
ts/packages/core/src/telemetry/Telemetry.ts
Python SDK
- Session creation
python/composio/core/models/tool_router.py - Tool session
python/composio/core/models/tool_router_session.py - Session files
python/composio/core/models/tool_router_session_files.py - Session deletion
python/composio/core/models/tool_router_session_delete.py - HTTP client
python/composio/client/__init__.py - Custom tools
python/composio/core/models/custom_tool.py - Tool schemas
python/composio/core/models/tools.py - Provider base
python/composio/core/provider/base.py - Authentication
python/composio/core/models/auth_configs.py - Connected accounts
python/composio/core/models/connected_accounts.py - Triggers
python/composio/core/models/triggers.py
Provider adapters
- Framework adapters
python/providers
Command line
- CLI workflows
ts/packages/cli/src/commands - Tool execution
ts/packages/cli/src/commands/tools/execute/tools.execute.handler.ts - Tool search
ts/packages/cli/src/commands/tools/search/tools.search.handler.ts
Other components
- SDK user
- AI agent
- Composio service
Connections 28
- SDK user → Tool session: creates session
README.md - Tool session → AI agent: provides tools
README.md - AI agent → Tool session: requests actions
README.md - Tool session → Composio service: executes remote tools
README.md - SDK user → Session creation: creates session
README.md - Session creation → Tool session: creates session
python/composio/core/models/tool_router.py - Tool session → HTTP client: calls API
python/composio/core/models/tool_router_session.py - Tool session → Custom tools: routes local tools
python/composio/core/models/tool_router_session.py - Tool session → Composio service: executes remote tools
python/composio/core/models/tool_router_session.py - Tool session → Tool schemas: uses tool models
python/composio/core/models/tool_router_session.py - Tool session → Provider base: wraps tools
python/composio/core/models/tool_router_session.py - Provider base → Framework adapters: adapted by
README.md - SDK user → AI agent: runs with tools
README.md - Tool session → Session files: mounts files
ts/packages/core/src/models/ToolRouterSession.ts - Tool session → Session deletion: deletes session
ts/packages/core/src/models/ToolRouterSession.ts - Session files → Session models: validates responses
ts/packages/core/src/models/ToolRouterSessionFileMount.ts - Tool session → Telemetry: records events
ts/packages/core/src/models/ToolRouterSession.ts - Tool session → Session files: manages files
python/composio/core/models/tool_router_session.py - Session creation → Session deletion: deletes session
python/composio/core/models/tool_router.py - Session deletion → HTTP client: calls API
python/composio/core/models/tool_router_session_delete.py - Session files → HTTP client: calls file API
python/composio/core/models/tool_router_session_files.py - Tool session → Authentication: supports authorization
README.md - Tool session → Connected accounts: manages connections
README.md - SDK user → Triggers: configures triggers
README.md - SDK user → CLI workflows: uses shell commands
README.md - CLI workflows → Tool search: searches tools
README.md - CLI workflows → Tool execution: executes tools
README.md - Tool execution → Composio service: runs actions
README.md