Competitor Research Agent
Competitor Research Agent
Enter a competitor URL to get comprehensive competitive intelligence. Uses Firecrawl Map + Parallel Scrape for fast extraction (~3-5s). Analyzes positioning, pricing, features, tech stack, and generates sales battle cards.
Problems solved
- Extract competitor site data with Firecrawl map and scrape
- Analyze positioning, pricing tiers, and feature matrices
- Detect technologies used on competitor properties
- Generate sales battle cards from live competitor pages
Use cases
- Sales competitive intelligence
- Pricing strategy research
- Feature gap analysis
- Product roadmap inputs from competitor sites
- Battle cards for account executives
Setup
Requirements, wiring steps, and what this pattern adds to your project.
Getting started
Pick how you want to pull this pattern in. Then wire env vars and routes the same way.
- 1
Download → Next.js app
Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).
- 2
Extract the zip and install dependencies
Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.
- 3
Fill .env.local
The download includes .env.local placeholders when needed. Add real values for: OPENAI_API_KEY, FIRECRAWL_API_KEY.
- 4
Customize the agent and tool files
Adapt prompts, tools, and stop conditions in the generated project for your product.
- 5
Run the app and open the pattern route
Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.
Environment variables
Capabilities
AI SDK APIs
useChatgatewayToolLoopAgenttoolhasToolCallstepCountIscreateAgentUIStreamResponseInferAgentUIMessageDefaultChatTransportUIMessageProviders
External services
Files added
16 filesapp/page.tsxapp/layout.tsxapp/api/competitor-agent/route.tslib/actions.tslib/competitor-types.tslib/rate-limit.tslib/agent-research.tslib/transform-utils.tslib/ai/competitor-agent.tslib/ai/tools/analyze-positioning.tslib/ai/tools/extract-pricing.tslib/ai/tools/identify-features.tslib/ai/tools/analyze-tech-stack.tslib/ai/tools/find-weaknesses.tslib/ai/tools/generate-battlecard.tsREADME.md
Dependencies
14 totalnpm packages
8
Registry components
Critical files
competitor-agent/route.tsAPI route using createAgentUIStreamResponse with competitorContext via callOptions.
ai/competitor-agent.tsToolLoopAgent with 6 competitor analysis tools, callOptionsSchema + prepareCall for context injection.
lib/actions.tsServer action implementing Firecrawl-based competitor scraping pipeline: map website, identify key pages, parallel scrape, LLM extraction via generateObject.
lib/agent-research.tsDeep research functions (researchPricing, researchFeatures, researchTechStack, researchReviews) with detailed Zod schemas for structured extraction.
tools/analyze-positioning.tsTool for extracting value propositions, target audience, and competitive positioning.
tools/extract-pricing.tsTool for structuring pricing tiers, models, and billing options from competitor data.
tools/identify-features.tsTool for building categorized feature matrices from competitor websites.
tools/analyze-tech-stack.tsTool for detecting frontend/backend technologies, infrastructure, and third-party services.
tools/find-weaknesses.tsTool for identifying feature gaps, UX issues, and competitive opportunities.
tools/generate-battlecard.tsTool for generating comprehensive sales battle cards with objection handling.
Requirements
- Complexity
- Advanced
- Setup time
- ~10 minutes
- Node
- 24+
- Memory
- 256MB









