An open API service indexing awesome lists of open source software.

https://github.com/the-developer-306/comp_intell-ai-competitor-intelligence-system

An intelligent, file-aware platform that helps businesses analyze competitors, extract insights from internal documents, and generate detailed strategy + SWOT reports using LLMs and RAG.
https://github.com/the-developer-306/comp_intell-ai-competitor-intelligence-system

Last synced: 11 months ago
JSON representation

An intelligent, file-aware platform that helps businesses analyze competitors, extract insights from internal documents, and generate detailed strategy + SWOT reports using LLMs and RAG.

Awesome Lists containing this project

README

          

# 🧠 AI Competitor Intelligence System

An intelligent, file-aware platform that helps businesses analyze competitors, extract insights from internal documents, and generate detailed strategy + SWOT reports using LLMs and RAG.

![Streamlit Screenshot](./assets/ss/home.jpg)

---

## 🚀 Features

- 🔍 **Competitor Discovery** using Exa AI neural search

- 🌐 **Web Data Extraction** via Firecrawl structured scraping

- 📄 **RAG (Retrieval-Augmented Generation)** with FAISS and HuggingFace for file-based insights

- 🧠 **Strategy & SWOT Generation** powered by DeepSeek API

- 📊 **Markdown-Based Comparison Table** across 6 key business dimensions

- 📥 **PDF Report Export** with all results in a clean downloadable format

- 📂 Supports **PDF, DOCX, TXT** files for company knowledge

---

## 🎯 Use Case

For any startup or business that wants to:

- Identify 3--5 real competitors with similar offerings

- Compare pricing, features, tech stack, and positioning

- Upload internal documents and get actionable growth strategies

- Generate a SWOT analysis tailored to their current situation

- Export a fully structured PDF report

---

## 🧩 Tech Stack

| **Layer** | **Technology / Tool** | **Purpose** |
| --- | --- | --- |
| **Frontend** | Streamlit | User interface for interaction and results display |
| **LLM (Language Model)** | DeepSeek API | Generates growth strategy and SWOT analysis |
| **File Processing** | PyPDFLoader, Docx2txtLoader, TextLoader | Loads and parses PDF, DOCX, and TXT files |
| **Embeddings** | HuggingFaceEmbeddings (`all-MiniLM-L6-v2`) | Converts text into vector form for retrieval |
| **Vector DB** | FAISS (Facebook AI Similarity Search) | Stores document vectors for semantic search |
| **RAG Engine** | LangChain + FAISS + HuggingFace | Retrieval-Augmented Generation from uploaded documents |
| **Web Scraping** | Firecrawl API | Extracts structured business info from URLs |
| **Search Engine** | Exa AI | Finds real competitors from a description or website |
| **PDF Export** | FPDF (Python) | Generates a clean, downloadable business intelligence report as PDF |
| **Prompt Handling** | Custom Prompt Templates (`prompts.py`) | Defines LLM behavior for comparison, strategy, and SWOT generation |
---

## 📁 Directory Structure

```
project_root/

├── app.py # Streamlit UI
├── agents/
│ ├── deepseek_agent.py # DeepSeek-based strategy + SWOT
│ ├── rag_agent.py # RAG chain using uploaded files
│ └── firecrawl_agent.py # Scrapes and extracts info

├── tools/
│ ├── exa_tool.py # Wraps Exa API calls
│ ├── deepseek_llm.py # Custom wrapper for DeepSeek API
│ └── rag_tools.py # RAG vector store + retriever setup

├── components/
│ └── pdf_exporter.py # Converts everything into PDF

├── data/
│ └── uploaded_docs/ # Temporary upload path

└── utils/
└── prompts.py # Prompt templates

```
## 🔑 API Keys Required

Create a `.env` or use Streamlit sidebar to provide:

- `DEEPSEEK_API_KEY` -- for strategy generation

- `FIRECRAWL_API_KEY` -- for structured website crawling

- `EXA_API_KEY` -- for competitor discovery

---

## 📦 Installation

```bash

git clone https://github.com/yourusername/ai-competitor-intelligence.git

cd ai-competitor-intelligence

pip install -r requirements.txt

streamlit run app.py

```

📊 Sample Output
----------------

- ✅ Top 5 Competitor URLs

- ✅ Comparison Table (Markdown)

- ✅ Strategy Suggestions (LLM-generated)

- ✅ SWOT Analysis (LLM-generated)

- ✅ File-aware Insights via RAG

- ✅ Exportable PDF Report

📈 Metrics
----------

- Reduced competitor research time by **80%**

- LLM-based strategy rated **90%+ relevance** by testers

- Processed **20+ page docs** in under **10 seconds**

- Exported PDF formatting accuracy: **~95%**

🛡️ License
-----------

MIT License. Use freely and contribute if you love it!

* * * * *

🙌 Acknowledgements
-------------------

- [DeepSeek AI](https://deepseek.com)

- [Exa AI](https://exa.ai)

- [Firecrawl](https://firecrawl.dev)

- [LangChain](https://python.langchain.com/)

- [Streamlit](https://streamlit.io)

* * * * *

📬 Contact
----------

Built by [Pratham](https://the-developer-306.github.io/Portfolio-PrathamKhanna/) -- passionate about automation, AI, and making business tools smarter.

For any questions or suggestions, feel free to reach out:

- GitHub: [the-developer-306](https://github.com/the-developer-306)
- Email: [whilealivecode127.0.0.1@gmail.com](mailto:whilealivecode127.0.0.1@gmail.com)