An advanced multi-agent research system with a modern web interface that autonomously gathers, validates, and synthesizes public data (Financials, News, Social, Competitive) into professional investment reports. Powered by LangGraph for resilient, reasoning-aware research workflows and React + Vite for a premium user experience.
The system utilizes a state-driven LangGraph orchestrator to manage specialized research nodes. This allows for parallel execution, structured reasoning, and graceful fallbacks across multiple LLM providers.
graph TD
Start((Start)) --> Orchestrator{Orchestrator}
Orchestrator --> Profile[Company Profile]
Orchestrator --> Financial[Financial Research]
Orchestrator --> News[News Intelligence]
Orchestrator --> Sentiment[Sentiment Analysis]
Orchestrator --> Competitive[Competitive Intel]
Profile --> Aggregator[State Aggregator]
Financial --> Aggregator
News --> Aggregator
Sentiment --> Aggregator
Competitive --> Aggregator
Aggregator --> Synthesis[Insight Synthesis]
Synthesis --> Report[Report Generator]
Report --> End((Finished))
- Framework: React 19 with TypeScript
- Build Tool: Vite for fast development and optimized builds
- Routing: React Router DOM for seamless navigation
- Animations: Framer Motion for smooth UI transitions
- Styling: Custom CSS with modern design patterns
- API Communication: Axios for backend integration
- Company Profile Agent: Validates company identity and extracts Wikipedia-based historical context.
- Financial Research Agent: Parses SEC filings with automated anomaly detection (flagging unusual growth/margins).
- News Intelligence Agent: Uses ScrapingBee (Main) or SerpAPI (Fallback) to build chronological event timelines from real news.
- Sentiment Analysis Agent: Implements multi-stage fallback (Social/Reddit/Reviews) when news data is sparse.
- Competitive Intelligence Agent: Maps competitors, SWOT, and market positioning.
- Synthesis Engine: Performs reasoning-aware data aggregation to resolve contradictions and surface "non-obvious" insights.
- Premium Design: Sleek, professional UI with smooth animations and transitions
- Real-time Progress: Live updates on research progress with detailed agent status
- Interactive Reports: Sidebar navigation with downloadable PDF reports
- Responsive Layout: Works seamlessly across desktop and mobile devices
- Dark Mode Support: Eye-friendly interface for extended research sessions
- ScrapingBee & SerpAPI Integration: Multi-layered news and search sourcing with JS-rendering support
- Wikipedia History Extraction: Automatically parses founding, IPO, and M&A history
- SEC EDGAR Parsing: Direct extraction of income statements and balance sheets from official filings
- Automated logic to flag data points requiring human review:
- Unusual revenue/earnings growth (>100% YoY)
- Significant negative margins
- Conflicts between different financial data points
Supports automatic provider-switching to maintain 100% uptime using free-tier APIs:
- OpenAI GPT 4o-mini (Primary)
- Groq (Llama 3.3 70B - High speed)
- Google Gemini 2.0 Flash / Cohere / Together AI / Hugging Face
Before setting up CompAI, ensure you have the following installed:
- Python 3.9+ - For the backend research agents
- Node.js 18+ and npm - For the frontend application
- Git - For cloning the repository
git clone https://github.com/your-repo/CompAI.git
cd CompAI# Create virtual environment
python -m venv .venv
# Activate virtual environment
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate
# Install dependencies
pip install -r backend/requirements.txtCreate a .env file in the backend/ directory:
# LLM Providers (At least one required)
GOOGLE_API_KEY=your_google_api_key_here
GROQ_API_KEY=your_groq_api_key_here
COHERE_API_KEY=your_cohere_api_key_here
# Scraping / Data Sources
SCRAPINGBEE_API_KEY=your_scrapingbee_key_here # Primary Scraper & Search
SERPAPI_API_KEY=your_serpapi_key_here # Fallback for Rich News & SearchImportant
You need at least one LLM provider API key and one scraping API key for the system to function properly.
cd backend
python -m uvicorn app.main:app --reload --port 8000The backend API will be available at http://localhost:8000
cd frontend
npm installCreate a .env file in the frontend/ directory if you need to customize the API endpoint:
VITE_API_URL=http://localhost:8000npm run devThe frontend will be available at http://localhost:5173
- Open your browser and navigate to
http://localhost:5173 - Enter a company name (e.g., "Apple Inc", "Tesla", "Microsoft")
- Watch the real-time progress as agents gather and analyze data
- Review the comprehensive report generated
- Start both backend and frontend servers (see setup instructions above)
- Navigate to
http://localhost:5173in your browser - Enter a company name in the search field
- Monitor progress as the AI agents research the company
- Review the report with interactive navigation
- Download PDF for offline access
For programmatic access or automation:
cd backend
python run_cli.py --company "NVIDIA" --ticker NVDA--company: Full name of the company (required)--ticker: Stock symbol for faster financial discovery (optional)--no-parallel: Run agents sequentially for debugging (optional)
CompAI/
βββ backend/ # Python backend with LangGraph agents
β βββ app/
β β βββ agents/ # Research agent implementations
β β β βββ company_profile_agent.py
β β β βββ financial_research_agent.py
β β β βββ news_intelligence_agent.py
β β β βββ sentiment_analysis_agent.py
β β β βββ competitive_intelligence_agent.py
β β β βββ orchestrator.py
β β βββ api/ # FastAPI routes
β β β βββ routes.py
β β βββ core/ # Core configuration and state
β β β βββ config.py
β β β βββ llm_manager.py
β β β βββ state.py
β β βββ synthesis/ # Insight synthesis engine
β β β βββ synthesizer.py
β β βββ reporting/ # Report generation
β β β βββ report_generator.py
β β βββ utils/ # Utilities (scrapers, parsers)
β β βββ schemas/ # Pydantic models
β β βββ services/ # Business logic services
β β βββ main.py # FastAPI application entry point
β βββ reports/ # Generated research reports
β βββ annual_reports/ # Downloaded SEC filings
β βββ cache/ # Agent response cache
β βββ requirements.txt # Python dependencies
β βββ .env.example # Example environment variables
β βββ run_cli.py # CLI entry point
β
βββ frontend/ # React + TypeScript frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β β βββ Home.tsx # Landing page
β β β βββ Research.tsx # Research progress page
β β β βββ Report.tsx # Report display page
β β β βββ History.tsx # Research history
β β βββ styles/ # CSS stylesheets
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Frontend utilities
β β βββ App.tsx # Main application component
β β βββ main.tsx # Application entry point
β βββ public/ # Static assets
β βββ package.json # Node dependencies
β βββ tsconfig.json # TypeScript configuration
β βββ vite.config.ts # Vite configuration
β βββ .env.example # Example frontend environment
β
βββ README.md # This file
The agent produces comprehensive, structured reports containing:
- Executive Summary - High-level overview with key insights
- Company Overview - Historical context from Wikipedia and validated company information
- Financial Highlights - Key metrics with anomaly warnings and trend analysis
- Business & Industry Analysis - Market positioning and competitive dynamics
- Recent News & Key Events - Categorized timeline of significant developments
- Public & Social Sentiment - Trust-weighted sentiment analysis from multiple sources
- Opportunities & Risks - AI-synthesized insights on potential upsides and concerns
- Key Observations - Non-obvious patterns and contradictions surfaced by the synthesis engine
- Data Sources & Trust Scores - Complete transparency on data provenance and reliability
- Research Metadata - Provider usage, reasoning steps, and execution details
# Build production environment
pip install -r backend/requirements.txt
# Run with production ASGI server
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4# Build optimized production bundle
cd frontend
npm run build
# The dist/ folder contains the production-ready static files
# Deploy to any static hosting service (Vercel, Netlify, AWS S3, etc.)- Python 3.9+ - Core language
- FastAPI - Modern web framework
- LangGraph - Agent orchestration
- Pydantic - Data validation
- Uvicorn - ASGI server
- ScrapingBee / SerpAPI - Web scraping
- Multiple LLM Providers - OpenAI, Gemini, Groq, Cohere, Huggingface
- React 19 - UI framework
- TypeScript - Type safety
- Vite - Build tool and dev server
- React Router DOM - Client-side routing
- Framer Motion - Animations
- Axios - HTTP client
- Synthesis Over Collection: Focus on "Why" and "So What?", not just "What"
- Source Transparency: Every data point includes a trust score (0-1.0) and source link
- Privacy First: Research is performed on public endpoints only
- User-Centric Design: Premium, intuitive interface for professional researchers
Contributions are welcome! Please feel free to submit a Pull Request.
Built with: LangGraph, FastAPI, React, Vite, ScrapingBee, SerpAPI, and Multiple LLM Providers
- Clean, modern interface for entering company names to begin research*
- Overview of the features of the application*
- Real-time progress tracking with detailed agent status and estimated time remaining*
- Interactive report with sidebar navigation and comprehensive company analysis*



