Automated competitor discovery, website analysis, and strategic reporting powered by AI
A production-ready agent that performs deep competitive intelligence using web search and scraping
Your competitor-analysis-agent is a sophisticated AI agent that:
- Automatically discovers competitors for any company using web search
- Scrapes and analyzes competitor websites using Firecrawl
- Generates comprehensive competitive intelligence reports with:
- SWOT analysis for each competitor
- Feature comparison matrices
- Pricing analysis
- Market positioning insights
- Strategic recommendations
git clone https://github.com/Paraschamoli/competitor-analysis-agent.git
cd competitor-analysis-agent
uv venv --python 3.12
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv sync# Copy environment template
cp .env.example .env
# Edit .env and add your keys:
# FIRECRAWL_API_KEY (required) - from https://firecrawl.dev
# OPENAI_API_KEY or OPENROUTER_API_KEY (required for LLM)
# MEM0_API_KEY (optional) - for memory operations# Start the agent server
python -m competitor_analysis_agent
# Agent runs on http://localhost:3773# Use curl or your preferred tool to test
curl -X POST http://localhost:3773/a2a \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "Analyze competitors for Notion and provide a competitive analysis report"}
]
}'# Start with Docker Compose (auto-builds from Dockerfile.agent)
docker-compose up --build
# Or run in background
docker-compose up -d# Build the agent image
docker build -t competitor-analysis-agent -f Dockerfile.agent .
# Run the container
docker run -p 3773:3773 \
-e FIRECRAWL_API_KEY=your_key \
-e OPENROUTER_API_KEY=your_key \
competitor-analysis-agent{
"name": "competitor-analysis-agent",
"description": "AI Competitive Intelligence Agent",
"version": "1.0.0",
"deployment": {
"url": "http://0.0.0.0:3773",
"expose": true
},
"environment_variables": [
{"key": "FIRECRAWL_API_KEY", "required": true},
{"key": "OPENAI_API_KEY", "required": false},
{"key": "OPENROUTER_API_KEY", "required": false},
{"key": "MEM0_API_KEY", "required": false}
]
}Your agent uses:
- bindu (2026.1.7) - Agent framework
- agno (β₯2.2.0) - Agent orchestration
- firecrawl-py - Web scraping and search
- openai - LLM integration
- mem0ai - Memory management
- arxiv & pypdf - Research paper analysis tools
- fastmcp - Model Context Protocol tools
Your agent follows this intelligent five-phase workflow:
-
Phase 1: Initial Research & Discovery
- Searches for target company information
- Identifies competitors using web search
- Maps the competitive landscape
-
Phase 2: Competitor Website Analysis
- Scrapes competitor websites using Firecrawl
- Extracts product information, pricing, features
- Analyzes site structure and user experience
-
Phase 3: Deep Analysis
- Performs SWOT analysis for each competitor
- Creates feature comparison matrices
- Analyzes market positioning and pricing strategies
-
Phase 4: Strategic Synthesis
- Generates strategic recommendations
- Identifies market opportunities and threats
- Provides actionable insights
-
Phase 5: Research Integration
- Analyzes relevant research papers using Arxiv tools
- Incorporates academic insights into competitive analysis
- Uses memory tools for context-aware analysis
{
"messages": [
{
"role": "user",
"content": "Perform competitive analysis for Slack. Identify top 3 competitors and analyze their features."
}
]
}{
"messages": [
{
"role": "user",
"content": "Analyze the project management software market. Compare Asana, Monday.com, and ClickUp."
}
]
}{
"messages": [
{
"role": "user",
"content": "Based on analysis of Canva and Figma, what market opportunities exist for a new design tool?"
}
]
}{
"messages": [
{
"role": "user",
"content": "Analyze the competitive landscape for AI coding assistants. Include relevant research papers and academic insights."
}
]
}competitor-analysis-agent/
βββ competitor_analysis_agent/ # Main agent package
β βββ __init__.py # Public API exports
β βββ main.py # Main agent implementation
β βββ agent_config.json # Agent configuration
β βββ skills/ # Agent skills
β βββ competitor-analysis/ # Skill implementation
β βββ skill.yaml # Skill configuration
βββ Dockerfile.agent # Multi-stage Docker build
βββ docker-compose.yml # Docker orchestration
βββ pyproject.toml # Python dependencies
βββ uv.lock # Dependency lock file
βββ .env.example # Environment template
βββ .github/workflows/ # CI/CD workflows
β βββ build-and-push.yml # Docker build and push
βββ tests/ # Test files
β βββ test_main.py # Agent tests
βββ README.md # This file
Your agent (competitor_analysis_agent/main.py) features:
- Model Selection Logic: Automatically chooses between OpenAI and OpenRouter
- Firecrawl Integration: Web scraping and search capabilities
- Reasoning Tools: Built-in analysis and critical thinking
- Lazy Initialization: Optimized resource usage
- Comprehensive Instructions: Detailed five-phase analysis workflow
- MCP Tools Support: Model Context Protocol integration
- Memory Management: Mem0 integration for context-aware analysis
- Research Capabilities: Arxiv tools for academic research integration
- Get from: firecrawl.dev
- Used for web scraping and search functionality
- Essential for competitor website analysis
- OPENAI_API_KEY: For GPT-4o access (from OpenAI)
- OPENROUTER_API_KEY: Alternative LLM provider (from OpenRouter)
- For memory and context management
- Get from: app.mem0.ai
# Install dependencies
uv sync
# Run tests
uv run pytest
# Format code
uv run ruff format .
# Lint code
uv run ruff check --fix .
# Run agent directly
uv run python -m competitor_analysis_agent
# Run pre-commit checks
uv run pre-commit run --all-filesThe agent generates structured reports including:
# Competitive Analysis Report: {Company}
## Executive Summary
{High-level overview}
## Research Methodology
- Search queries used
- Websites analyzed
- Research papers reviewed
## Competitor Analysis
### Competitor 1: {Name}
- SWOT Analysis
- Products & Services
- Pricing Analysis
- Market Positioning
## Comparative Analysis
- Feature Comparison Matrix
- Pricing Comparison Table
- Market Positioning Map
## Strategic Insights
- Key findings with evidence
- Competitive advantages
- Market risks and challenges
## Strategic Recommendations
- Immediate Actions (0-3 months)
- Short-term Strategy (3-12 months)
- Long-term Strategy (12+ months)Make your agent discoverable worldwide:
# 1. Get Bindu API token from bindus.directory
# 2. Configure GitHub Secrets:
gh secret set BINDU_API_TOKEN --body "your_token"
gh secret set DOCKERHUB_TOKEN --body "your_docker_token"
# 3. Push to trigger auto-deployment
git push origin mainAuto-deployment features:
- Automatic Docker image building
- Multi-architecture support (linux/amd64, linux/arm64)
- Registration on bindus.directory
- Version tagging and caching
# Test the running agent (use /a2a endpoint)
curl -X POST http://localhost:3773/a2a \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "Analyze competitors for Trello"}
]
}'# Verify agent is running
curl http://localhost:3773/health
# Check deployment status
curl http://localhost:3773/deployment
# Get agent information
curl http://localhost:3773/agent/infoOpen your browser to http://localhost:3773/docs for interactive API documentation.
Common Issues:
-
"FIRECRAWL_API_KEY is required"
- Get a key from firecrawl.dev
- Add to
.envfile
-
Agent fails to initialize
- Check Python version (requires 3.12+)
- Verify all dependencies with
uv sync - Check API keys in
.envfile
-
Docker build fails
- Ensure Docker daemon is running
- Check
Dockerfile.agentsyntax - Verify Docker Hub credentials
-
No LLM API key provided
- Agent can start without LLM key, but will fail at runtime when LLM is needed
- Add either OpenAI or OpenRouter key
-
Permission errors on Windows
- Run terminal as administrator
- Check file permissions for
agent_config.json
-
Pre-commit hooks failing
- Install required dev dependencies:
uv sync --group dev - Run
uv run pre-commit installto install hooks - Fix formatting issues with
uv run ruff format .
- Install required dev dependencies:
MIT License - See LICENSE file for details.
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
- Issues: GitHub Issues
- Email: paras25619@gmail.com
- Documentation: In-code documentation and examples
- Community: Bindu Discord
Transform hours of competitive research into minutes of AI-powered insights
Built with Bindu β’ β Star this repo β’ π Register on bindus.directory