Tagline: An automated reporting pipeline that converts raw ad campaign logs into executive-ready PDF briefings with AI-generated narratives in under 30 seconds.
Context: In the AdTech industry, reporting is a massive bottleneck. Account Managers currently spend 4-6 hours every week downloading CSVs from different DSPs, manually aggregating data in Excel, and taking screenshots to paste into PowerPoint decks.
The Pain Point:
- Latency: Data is often days old by the time the client sees it.
- Error Rate: Manual copy-pasting leads to human error in critical metrics like Spend and CPA.
- Wasted Talent: Highly paid strategists are doing low-value data entry work instead of optimizing campaigns.
My Solution: I built AdPulse, a streamlined insight engine. The user uploads a raw data file, and the system instantly standardizes the data, calculates the math deterministically, and uses Generative AI to write a strategic summary. The output is a finalized PDF ready to be emailed to a CMO.
For the User:
- Input: Upload a raw CSV file (Campaign Performance Report).
- Action: Click "Generate Executive Report".
- Output: A downloadable, professional PDF containing:
- Hard KPIs (Total Spend, Conversions, CPA) calculated with 100% precision.
- An AI-written executive summary explaining why a specific campaign is winning or losing.
I designed this system to prioritize accuracy and speed, moving away from "chatbots" to a functional business tool.
System Architecture:
-
Ingestion Layer (Streamlit):
- Acts as the frontend interface for secure file handling.
- Provides immediate visual feedback and data preview.
-
Data Engine (Pandas):
- Decision: I chose Pandas over pure AI processing for the calculations.
- Reasoning: LLMs are probabilistic and often fail at basic arithmetic (hallucinations). I strictly used Pandas for all aggregations (Sum, Avg, CPA calculation) to ensure financial accuracy.
-
Intelligence Layer (Google Gemini):
- We pass the aggregated metadata (not the raw rows) to Google Gemini.
- Prompt Engineering: Used a "Role-Playing" prompt to force the model to act as a Senior Analyst, focusing on actionable insights rather than generic observations.
-
Reporting Engine (FPDF):
- Programmatically renders the final PDF. This ensures a consistent corporate layout that is difficult to achieve with simple HTML-to-PDF converters.
- Language: Python 3.10+
- Frontend: Streamlit
- Data Processing: Pandas (NumPy backend)
- AI Model: Google Gemini API (via LangChain)
- Document Generation: FPDF
- Environment Management: Python Dotenv
-
Clone Repository
git clone https://github.com/manojkp08/GroundTruthAIHackathon2025_Manoj.git
-
Install Dependencies
pip install -r requirements.txt
-
Configure API Key Create a
.envfile in the root directory:GEMINI_API_KEY="your_google_api_key_here" -
Run the Application
streamlit run app.py
-
Test with Sample Data
- Use the
custom_csv/campaign_data.csvprovided in the repo to test the pipeline.
- Use the