Composio Integration PRD - Automatos

Version: 1.0 Status: 🟡 Planning Phase Date: January 20, 2026 Author: DeepAgent


Executive Summary

This PRD outlines the integration of Composio (500+ tools) and AIML API (400+ LLMs) into Automatos, creating a truly provider-agnostic unified gateway system. The integration will:

  1. Replace manual tool management with specific Tool Router sessions for intent-based routing

  2. Add AIML API as the primary LLM gateway for 400+ models

  3. Redesign the Tools page to match the "Manage Apps" UI pattern (see screenshot)

  4. Simplify OAuth management by leveraging Composio's Hosted Authentication links

  5. Enable Event-Driven Architectures using Composio Triggers (Webhooks)

Key Benefits

  • 500+ pre-built tools via Composio (vs. current ~160k individual methods)

  • 400+ LLMs via AIML API (vs. current 7 provider-specific clients)

  • Simplified OAuth - Composio handles auth flows for all integrations

  • Reduced maintenance - Tool definitions managed by Composio

  • Faster time-to-value - New integrations available immediately


Table of Contents


Current State Analysis

Backend Architecture

Core Components

Component
Location
Purpose

Tool Catalog API

api/tool_catalog.py

Workspace-level tool enablement, agent assignments

Tools API

api/tools.py

CRUD operations for tool marketplace

MCP Tools API

api/mcp_tools.py

MCP-specific tool management

Unified Executor

modules/tools/execution/unified_executor.py

Routes tool calls to executors

MCP Executor

modules/tools/execution/mcp_executor.py

Executes MCP protocol tools

Credential Store

core/credentials/service.py

Encrypted credential management

Tool Access Service

modules/tools/services/tool_access_service.py

Access validation

Database Models

Model
Table
Purpose

Tool

tools

Tool registry with MCP config

TenantToolConfig

tenant_tool_config

Per-workspace tool enablement

AgentToolAssignment

agent_tool_assignments

Agent-to-tool mappings

Credential

credentials

Encrypted credential storage

MCPServer

mcp_servers

MCP server connections

LLM Client Architecture

Current provider-specific implementations:

Frontend Architecture

Key Components

Component
Location
Purpose

Tools Dashboard

components/tools/tools-dashboard.tsx

Main tools management UI

Agent Configuration

components/agents/agent-configuration.tsx

Agent settings with tool assignment

Tool Config Modal

components/tools/tool-config-modal.tsx

Tool configuration dialog

Tool Details Modal

components/tools/tool-details-modal.tsx

Tool information display

API Hooks

Hook
File
Purpose

useMCPTools

use-mcp-tools-api.ts

Fetch/manage MCP tools

useAgentTools

use-mcp-tools-api.ts

Get tools assigned to agent

useAssignToolToAgent

use-mcp-tools-api.ts

Tool-agent assignment

useCredentials

use-credentials-api.ts

Credential management

Current Tool Management Flow

Identified Issues

  1. 160k individual methods registered as tools - overwhelms LLM decision-making

  2. 7 separate LLM clients with duplicated logic

  3. Custom OAuth flows for each integration

  4. MCP complexity - requires Context Forge gateway

  5. No semantic grouping - tools not organized by capability


Composio Integration Strategy

What to REMOVE

Component
Reason

modules/tools/execution/mcp_executor.py

Replaced by Composio SDK

modules/tools/services/adapter_client.py

Composio handles tool discovery

modules/tools/services/adapter_tools_client.py

Composio handles tool definitions

modules/tools/services/mcp_tool_executor.py

Composio handles execution

modules/tools/executors/jit_mcp_client.py

MCP no longer needed

MCP-specific models in core/models/tools.py

MCPServer, MCPToolConnection

Individual LLM clients (6 of 7)

AIML API provides unified access

Files to DELETE:

What to REUSE

Component
Adaptation Needed

core/credentials/service.py

Keep encryption, adapt for Composio entity storage

core/credentials/encryption.py

No changes - continue using for local secrets

core/models/tool_assignments.py

Keep AgentToolAssignment, adapt TenantToolConfig

modules/tools/execution/unified_executor.py

Adapt routing to Composio

modules/tools/registry/tool_registry.py

Sync with Composio apps

modules/tools/services/tool_access_service.py

Keep access validation logic

api/tool_catalog.py

Adapt endpoints for Composio

api/credentials.py

Keep for local credential management

Frontend hooks structure

Adapt for Composio APIs

Agent configuration flow

Add Composio tool selection

What to CHANGE

Component
Changes

TenantToolConfig model

Add composio_connection_id, remove MCP fields

UnifiedToolExecutor

Route MCP-category tools to Composio SDK

LLMConfig/BaseLLMProvider

Add AIML API as primary provider

Tool routes map

Add Composio tool categories

Frontend Tools Dashboard

Redesign for "Manage Apps" pattern

Agent Configuration

Add app-level feature toggles

Credential resolution flow

Integrate Composio entity management

What to ADD

Component
Purpose

core/composio/client.py

Composio SDK wrapper

core/composio/entity_manager.py

Manage Composio entities (user connections)

core/composio/tool_executor.py

Execute tools via Composio

core/aiml/client.py

AIML API unified LLM client

api/composio.py

Composio-specific endpoints

ComposioConnection model

Track entity-app connections

Frontend: ManageAppsModal

App feature toggles UI

Frontend: ComposioOAuthButton

OAuth connection component

Redis caching layer

Cache Composio tool metadata


Provider-Agnostic Architecture

AIML API Integration

AIML API provides access to 400+ LLMs through a single OpenAI-compatible endpoint:

Supported Model Families:

  • OpenAI: GPT-4o, GPT-4-turbo, GPT-3.5-turbo, o1-preview

  • Anthropic: Claude 3.5 Sonnet, Claude 3 Opus/Haiku

  • Google: Gemini 1.5 Pro/Flash, Gemini 2.0

  • Meta: Llama 3.1 405B/70B/8B

  • Mistral: Mixtral, Mistral Large/Medium

  • And 380+ more...

Composio Integration

Updated LLM Manager



Event-Driven Architecture (Triggers)

Composio Triggers allow agents to be reactive rather than just proactive. Instead of an agent constantly polling "Do I have new mail?", the system wakes up when an event occurs.

Supported Triggers (User Examples)

  1. Communication: gmail_new_email_received, slack_new_message

  2. Development: github_pull_request_opened, github_issue_created

  3. Scheduling: google_calendar_event_start

  4. Manual: User manually triggers a workflow via UI ("Run Now").

Implementation Flow

  1. Registration:

    • User enables a "Trigger" in the "Manage Apps" UI (e.g., "Watch for PRs").

    • Backend calls Composio to register a webhook callback: POST /api/composio/webhook.

  2. Event Handling (/api/composio/webhook):

    • Verify: Check x-composio-signature.

    • Map: Identify which workspace_id and agent_id maps to the event's user_id.

    • Wake Up:

      • Scenario A (Workflow): Trigger a specific workflow_id.

      • Scenario B (Agent): Inject a "System Message" into the Agent's context: "EVENT: New PR #123 opened by @user. Title: Fix bug." and trigger a run.

Code Example: Trigger Registration

Tools Page Redesign

Current vs. New Design

Current Design:

  • Flat list of 160k+ individual tools

  • Category filtering

  • Per-tool install/configure

New Design (Manage Apps Pattern):

  • App-level organization (GitHub, Slack, etc.)

  • Per-app feature toggles

  • OAuth connection status

  • Grouped by provider

UI Components

Based on the screenshot provided, the new "Manage Apps" modal should have:

React Component Structure

Feature Card Component


Backend Refactoring Plan

Phase 1: Core Integration (Week 1-2)

1.1 Add Composio SDK

1.2 Create Composio Client Module

1.3 Create AIML Client Module

Phase 2: Database Changes (Week 2)

2.1 New Migration: Add Composio Fields

Phase 3: API Updates (Week 3)

3.1 New Composio Endpoints

3.2 Updated Agent Tools Endpoints

Phase 4: Executor Integration (Week 3-4)

4.1 Update Unified Executor


Frontend Updates Plan

Phase 1: New Hooks (Week 2-3)

Phase 2: New Components (Week 3-4)

Phase 3: Page Updates (Week 4)

Tools Page Redesign


Implementation Roadmap

Task Checklist

Phase 1: Foundation (Week 1-2)

Backend Setup

AIML API Integration

Database Preparation

Phase 2: API Layer (Week 2-3)

New Endpoints

Updated Endpoints

Authentication & Triggers

Phase 3: Execution Layer (Week 3-4)

Executor Updates

LLM Integration

Caching

Phase 4: Frontend (Week 4-5)

New Hooks

New Components

Page Updates

Phase 5: Cleanup & Migration (Week 5-6)

Remove Deprecated Code

Data Migration

Testing

Phase 6: Documentation & Launch (Week 6)

Documentation

Monitoring

Launch


Migration Strategy

For Existing Tool Configurations

For Agent Tool Assignments

Rollback Plan

  1. Feature Flag: All Composio features behind ENABLE_COMPOSIO flag

  2. Parallel Systems: Keep MCP executor until migration complete

  3. Data Backup: Full backup of tool configs before migration

  4. Gradual Rollout: 10% → 50% → 100% user rollout


Success Metrics

Quantitative

Metric
Current
Target
Measurement

Available Tools

160k methods

500+ apps

Composio catalog

LLM Providers

7 clients

400+ models

AIML API catalog

Tool Selection Accuracy

~60%

95%+

User feedback

OAuth Setup Time

Manual per-tool

One-click

Time to connect

New Integration Time

Weeks

Immediate

Composio availability

Maintenance Burden

High

Low

Dev hours/month

Qualitative

Technical Health

Metric
Target
Alert Threshold

Tool execution latency

< 2s

> 5s

OAuth success rate

> 99%

< 95%

Connection uptime

> 99.9%

< 99%

API error rate

< 0.1%

> 1%


Appendix

A. Composio App Categories

Category
Example Apps
Count

Developer Tools

GitHub, GitLab, Jira, Linear

50+

Communication

Slack, Discord, Teams, Email

30+

CRM & Sales

Salesforce, HubSpot, Pipedrive

40+

Productivity

Notion, Asana, Trello, Todoist

60+

Cloud & Infrastructure

AWS, GCP, Azure, Vercel

30+

Data & Analytics

Snowflake, BigQuery, Mixpanel

40+

Marketing

Mailchimp, SendGrid, Intercom

35+

Finance

Stripe, QuickBooks, Plaid

25+

Social Media

Twitter, LinkedIn, Instagram

20+

Other

100+ more apps

100+

B. AIML API Model Examples

C. Environment Variables


Document Version History

Version
Date
Author
Changes

1.0

2026-01-20

DeepAgent

Initial PRD

Last updated