Skip to content

Repository files navigation

Python Gemini JSON UI License

πŸš€ Composio API Research Agent

Enterprise-grade B2B API research and agentic buildability evaluator β€” fully automated, end-to-end.

Feed it a target app list β†’ Get structured developer portal audit data, auth methods, gating protocols, and an interactive intelligence dashboard. Zero manual steps.

Quick Start β€’ Architecture β€’ Pipeline Stages β€’ Demo β€’ Engineering β€’ Roadmap


πŸ“Œ Problem Statement

Auditing external SaaS APIs before building agent toolkits is slow, manual, and doesn't scale across hundreds of integrations:

Manual Workflow (per App) Time Spent
πŸ” Researching developer documentation ~15 min
πŸ”‘ Identifying supported API auth methods ~10 min
πŸ›‘οΈ Auditing developer account access & gates ~15 min
πŸ“‹ Evaluating toolkit buildability & blockers ~10 min
Total for 100 apps ~83 Hours

This agentic pipeline reduces the entire 100-app audit to under 3 minutes.


πŸ›οΈ Architecture & Data Flow

                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚   πŸ“‹ App Target List β”‚
                        β”‚      (100 Apps)     β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  STAGE 1 β€” Target Parser    β”‚
                    β”‚  Loads name & hints         β”‚
                    β”‚  Excludes local dev cache   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  STAGE 2 β€” Grounded Agent   β”‚
                    β”‚  Gemini 2.5-Flash + Search  β”‚
                    β”‚  Queries docs & extracts infoβ”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  STAGE 3 β€” Verification Loopβ”‚
                    β”‚  verify_agent.py (Audit)     β”‚
                    β”‚  Compares passes vs targets β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  STAGE 4 β€” Data Clustering   β”‚
                    β”‚  analyze_data.py            β”‚
                    β”‚  Auth/Access Stats Summary  β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  STAGE 5 β€” HTML Compiler     β”‚
                    β”‚  build_dashboard.py         β”‚
                    β”‚  Generates index.html UI    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Each stage's output feeds directly into the next, culminating in a single portable, interactive HTML dashboard.


πŸ—‚οΈ Project Structure

composio-api-research-agent/
β”‚
β”œβ”€β”€ πŸ“„ research_agent.py              # Stage 1 & 2 β€” Research pipeline & structured extraction
β”œβ”€β”€ πŸ“„ verify_agent.py                # Stage 3 β€” Validation loop (15-app audit)
β”œβ”€β”€ πŸ“„ analyze_data.py                # Stage 4 β€” Statistical clustering & segmentation
β”œβ”€β”€ πŸ“„ build_dashboard.py              # Stage 5 β€” HTML dashboard compilation
β”‚
β”œβ”€β”€ πŸ“‚ screenshots/                   # Project visual assets
β”‚   └── dashboard_preview.png         # Full interactive case study screenshot
β”‚
β”œβ”€β”€ πŸ“„ index.html                     # Final self-contained interactive dashboard
β”œβ”€β”€ πŸ“„ raw_results.json               # Raw JSON database for all 100 apps
β”œβ”€β”€ πŸ“„ analysis_summary.json          # Statistical aggregates and easy wins
β”œβ”€β”€ πŸ“„ verification_report.json       # Audit details and accuracy shift logs
β”œβ”€β”€ πŸ“„ requirements.txt               # Python dependencies
β”œβ”€β”€ πŸ“„ .env.example                   # Environment template
└── πŸ“„ .env                           # Local credentials (git-ignored)

⚑ Engineering Highlights

What makes this implementation production-grade:

🎨 Decoupled Static UI Compilation

The final dashboard is built by a compilation script (build_dashboard.py) that reads JSON aggregates and injects them directly into the HTML file. This ensures the output is 100% portable and runs offline without CORS errors.

🧠 Grounded LLM Agent

Uses the new google-genai SDK with Google Search grounding enabled. The agent crawls the web, reads current API documentation, and extracts info into structured Pydantic models.

πŸ›‘οΈ Double-Pass Verification

Features a dedicated validation script (verify_agent.py) that selects a random 15-app sample, compares unverified first-pass outputs with manual docs, and tracks accuracy progression.

πŸ”‘ Unicode & Legacy Terminal Protection

Includes print fallbacks that clean stdout strings, preventing terminal crashes on systems using older CP1252/ASCII character mappings.

🧹 Automatic Dependency-Free Dotenv

Includes a built-in .env parser requiring no third-party libraries, loading configurations and keeping API keys protected.


πŸ” Pipeline Stages β€” Deep Dive

Stage 1 β€” Grounded Research (research_agent.py)

Detail Value
Core Client google-genai Client
Model gemini-2.5-flash
Grounding Google Search tool
Output Schema Pydantic AppResearchResult

Stage 2 β€” Verification Audit (verify_agent.py)

Detail Value
Verification Sample 15 random apps across categories
First-Pass Accuracy 40.0% (missed specific enterprise limits)
Final Accuracy 100.0% (after grounded verification & audit)
Accuracy Shift +60.0%

Stage 3 β€” Aggregation & Clustering (analyze_data.py)

Detail Value
Auth Distribution API Keys (57%), OAuth2 (57%), Tokens (29%)
Access Types Self-Serve (75%) vs Gated (25%)
Easy Wins 75 apps (100% self-serve & buildable today)
Gated Blocker Paid plan required (47.8%), Partner outreach (39.1%)

πŸ“Έ Demo & Screenshots

πŸ–₯️ Full Interactive Case Study Dashboard

The fully compiled dashboard features category-wise sorting, instant search, metric cards, and responsive Chart.js data visualizations:

Dashboard Preview

πŸ“Š Section-by-Section Preview

Dashboard Header & Stats Key Patterns & Strategic Insights
Stats Preview Insights Preview
Agentic Workflow Pipeline Interactive 100-App Matrix
Agent Preview Matrix Preview

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • Google Gemini API key (optional - falls back to pre-researched cache if omitted)

1. Clone the Repository

git clone https://github.com/Subodh26oct/composio-api-research-agent.git
cd composio-api-research-agent

2. Set Up Virtual Environment

On Windows:

python -m venv .venv
.venv\Scripts\activate

On macOS/Linux:

python3 -m venv .venv
source .venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Key

Create a .env file in the root folder:

GEMINI_API_KEY="your-gemini-api-key-here"

5. Run the Pipeline

# Run research data extraction
python research_agent.py

# Execute verification audit
python verify_agent.py

# Generate statistics
python analyze_data.py

# Compile HTML dashboard
python build_dashboard.py

πŸ› οΈ Technology Stack

Layer Technology Purpose
Language Python 3.10+ Core scripting
Cognitive Agent Gemini 2.5-Flash Search-grounded content generation
Validation Pydantic Structured JSON schema formatting
Aggregation Pandas Statistical clustering & groupings
Visual Library Chart.js Dynamic client-side graphs
Presentation HTML5 / CSS3 / JavaScript Interactive single-page case study

πŸ—ΊοΈ Future Roadmap

Planned pipeline enhancements:

Priority Feature Description
πŸ”΄ P0 Multi-Agent Consensus Parallel research instances voting on auth patterns to minimize hallucinations
🟠 P1 Auto-Spec Crawler Automatically extracting OpenAPI / GraphQL specs from evidence URLs
🟑 P2 YAML Exporter Directly generating Composio-ready integration configuration manifests
🟒 P3 Credentials Verifier Live test integrations verifying sandbox access automatically

πŸ‘¨β€πŸ’» Author

Subodh AI & Software Engineer

GitHub


Built for the Composio AI Product Ops Intern take-home assignment.

About

An automated, search-grounded agent pipeline that audits 100 SaaS APIs across 10 categories to evaluate auth standards, developer gating protocols, and agent toolkit buildability. Includes an interactive case-study dashboard compiled into a portable, single-page UI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages