Data-driven product research powered by Composio, Jungle Scout, and Semrush
An AI-powered competitive analysis agent that transforms your Shopify store into a strategic research hub. Validate product demand, discover real competitors, and get actionable traffic insights β all through a conversational chat interface.
This agent follows a structured validate-then-analyze workflow that mimics how successful e-commerce entrepreneurs research products:
- Extract Keywords β Uses your product name as the seed keyword
- Validate Demand β Checks Amazon sales data via Jungle Scout before deep-diving
- Find Competitors β Discovers real DTC stores ranking for your keywords via Semrush
- Generate Insights β Provides actionable recommendations on traffic strategy
| Step | Tool | Purpose |
|---|---|---|
| πͺ Knowledge | Shopify | Extract "seed" keywords from your product catalog |
| β Validation | Jungle Scout | Prove demand exists (revenue >$10k/mo threshold) |
| π Intelligence | Semrush | Find real competitors & their traffic sources |
flowchart LR
User([οΏ½ User]) --> Hero[Hero Page]
Hero --> Onboard[Onboarding]
Onboard --> Chat[Chat UI]
Chat -->|POST /api/chat| Agent[π§ GPT-4o-mini]
Agent -->|streaming| Chat
Agent -->|tool calls via MCP| Composio[π§ Composio]
Composio --> JS[(Jungle Scout)]
Composio --> SR[(Semrush)]
Composio --> SH[(Shopify)]
Agent -->|analysis text| ChartGen[π Chart Generator]
ChartGen --> Dashboard[Results Dashboard]
style Composio fill:#6366f1,stroke:#333,color:#fff
style JS fill:#ff9900,stroke:#333,color:#000
style SR fill:#ff642b,stroke:#333,color:#fff
style SH fill:#96bf48,stroke:#333,color:#000
flowchart LR
A[π Product Name] --> B[Jungle Scout\nDemand Check]
B --> Check{Revenue\n> $10k/mo?}
Check -->|β
Yes| C[Semrush\nCompetitor Analysis]
Check -->|β No| Stop[Stop\nLow Demand]
C --> D[π Report]
style B fill:#ff9900,stroke:#333,color:#000
style C fill:#ff642b,stroke:#333,color:#fff
style D fill:#4a90d9,stroke:#333,color:#fff
style Stop fill:#e74c3c,stroke:#333,color:#fff
| Category | Technology |
|---|---|
| Framework | Next.js 14.1 (App Router) |
| Language | TypeScript 5 |
| AI/LLM | OpenAI GPT-4o-mini via Vercel AI SDK (ai v6) |
| Tool Orchestration | Composio Core (@composio/core) + AI SDK MCP Client (@ai-sdk/mcp) |
| Styling | Tailwind CSS + Framer Motion |
| Charts | Recharts |
| UI Components | Radix UI + shadcn/ui + Lucide Icons |
| 3D/Visual | Three.js + ShaderGradient |
| Validation | Zod |
| Testing | Vitest + Testing Library |
Composio acts as a universal tool gateway via the MCP (Model Context Protocol) standard. It hosts third-party API integrations (Jungle Scout, Semrush, Shopify) behind an MCP server, so the AI model can invoke those APIs as tool calls without any custom API integration code.
- Initialize β
new Composio({ apiKey })creates the Composio client - Create Session β
composio.create(userId, { toolkits: ["junglescout", "semrush", "shopify"] })creates a per-user tool session and returns an MCP endpoint URL + auth headers - Connect MCP β
experimental_createMCPClient({ transport: { type: "http", url, headers } })connects to Composio's MCP server using the Vercel AI SDK - Fetch Tools β
client.tools()retrieves all available tool definitions from the MCP server - Stream β Tools are passed into
streamText({ tools: mcpTools })so the LLM can autonomously call Jungle Scout/Semrush during its reasoning loop
-
Main Analysis (GPT-4o-mini with tools, streaming): Executes Jungle Scout and Semrush API calls via Composio MCP, validates demand, identifies competitors, and generates strategic recommendations.
-
Chart Data Extraction (GPT-4o-mini, non-streaming): Parses the analysis text to extract structured JSON data for visualizations (revenue trends, traffic distribution).
shopify-helper-agent/
βββ src/
β βββ app/
β β βββ api/
β β β βββ auth/[toolkit]/route.ts # OAuth URL generation
β β β βββ chat/route.ts # Main chat endpoint (streaming, MCP)
β β β βββ connection-status/route.ts # Check toolkit connections
β β β βββ disconnect/[toolkit]/route.ts # Disconnect a toolkit
β β β βββ parse-dashboard/route.ts # Parse agent output for dashboard
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Main page (Hero β Onboarding β Chat)
β βββ components/
β β βββ CompetitorCard.tsx # Competitor display card
β β βββ DashboardCharts.tsx # Revenue & traffic charts
β β βββ DemandIndicator.tsx # Demand score visualization
β β βββ Hero.tsx # Landing hero section
β β βββ Onboarding.tsx # Toolkit connection wizard
β β βββ ResultsDashboard.tsx # Main results display
β β βββ chat/
β β β βββ ChatInput.tsx # Chat input component
β β β βββ ChatMessage.tsx # Chat message renderer
β β βββ ui/ # Reusable UI components (shadcn/ui)
β βββ hooks/
β β βββ useConnections.ts # Toolkit connection status hook
β βββ lib/
β βββ agent.ts # AI agent logic, system prompt & chart generation
β βββ auth.ts # Composio auth helpers
β βββ composio.ts # Composio SDK initialization
β βββ types.ts # TypeScript types & interfaces
β βββ utils.ts # Utility functions
βββ tests/ # Test suite (Vitest)
β βββ api/ # API route handler tests
β βββ lib/ # Agent & library tests
β βββ utils/ # Test utilities & helpers
βββ .env.example # Environment variables template
βββ next.config.js # Next.js + Webpack config
βββ vitest.config.ts # Vitest configuration
βββ package.json
βββ tailwind.config.ts
βββ tsconfig.json
- Node.js 18+
- npm or yarn
- OpenAI API key
- Composio API key (Get one here)
git clone <repository-url>
cd shopify-helper-agent
npm installcp .env.example .envEdit .env with your credentials:
# Composio - MCP Tool Gateway
COMPOSIO_API_KEY=your_composio_api_key
# OpenAI - Agent LLM
OPENAI_API_KEY=your_openai_api_key
# App URL (for OAuth callbacks)
NEXT_PUBLIC_APP_URL=http://localhost:3000
# User ID (for demo/MVP - in production this comes from auth)
DEFAULT_USER_ID=shopify_demo_usernpm run devVisit http://localhost:3000
- Hero Page β Land on the animated hero section, click "Get Started"
- Onboarding β Connect your Jungle Scout, Semrush, and Shopify toolkits via OAuth
- Chat β Enter a product name (e.g., "Clay Mask") in the chat interface
- Analysis β The agent streams its analysis in real-time:
- Validates demand via Jungle Scout
- Finds DTC competitors via Semrush (only if demand > $10k/mo)
- Generates a strategic recommendation
- Dashboard β View visualized results with revenue charts, traffic distribution, and competitor cards
| Product | Expected Result |
|---|---|
| Clay Mask | β High demand ($52k/mo), focus on Google Ads |
| Snail Mucin | π₯ Explosive trend (+200% YoY), huge branding opportunity |
| Beetroot Scrub | β Low demand, recommend pivoting |
Comprehensive test suite covering all critical paths:
npm test # Run all tests
npm run test:ci # Run tests (CI mode, no watch)
npm run test:ui # Vitest UI
npm run test:coverage # Generate coverage report- Unit Tests: Agent logic, Composio integration, auth helpers, React hooks
- Component Tests: AnalysisForm, ResultsDashboard with user interactions
- API Tests: All route handlers (analyze, auth, chat, connection-status, disconnect)
- Integration Tests: End-to-end workflow validation
- Error Handling: CAPTCHA detection, API failures, network errors
Tests use Vitest with mocked Composio SDK and Vercel AI SDK for isolated, fast execution.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
MIT License - see LICENSE for details.
Built with β€οΈ using Composio
Powered by Jungle Scout β’ Semrush β’ OpenAI
