Skip to content

Harshithk951/sales-intelligence-agent

Repository files navigation


     



     



Typing SVG

🎯 What Is This?

A 4-agent enterprise pipeline that replaces 10+ hours of manual B2B sales research with a single company name.

Sales teams spend 2–3 hours per prospect researching companies, finding decision-makers, analyzing pain points, and crafting personalized outreach. This system does all of it — automatically, consistently, at scale.

Built as a capstone for the Google AI Agents Intensive (Nov 2025), delivering 6 out of 3 required features — all 3 core + 3 bonus.


⚡ Live Demo

Interface URL
🌐 Production Dashboard sales-intelligence-agent.vercel.app
🗺️ Agent Orchestration View /dashboard/workflow
📋 Terminal Log Viewer /dashboard/logs
📊 Intelligence Overview /dashboard

🏗️ System Architecture

╔══════════════════════════════════════════════════════════════╗
║                        USER INPUT                            ║
║                   "Company Name: Acme Corp"                  ║
╚═══════════════════════════╦══════════════════════════════════╝
                            ║
                            ▼
╔══════════════════════════════════════════════════════════════╗
║                   ORCHESTRATOR AGENT                         ║
║         Coordinates all agents │ Manages memory & state      ║
║              Handles errors │ Structured logging              ║
╚═══════════════════════════╦══════════════════════════════════╝
                            ║
          ╔═════════════════╩══════════════════╗
          ║        SEQUENTIAL AGENT FLOW        ║
          ╚═════════════════╦══════════════════╝
                            ║
         ┌──────────────────▼──────────────────┐
         │         1. RESEARCH AGENT           │
         │  Tools: Google Search API           │
         │  Output: Company overview + news    │
         └──────────────────┬──────────────────┘
                            │
         ┌──────────────────▼──────────────────┐
         │         2. ANALYSIS AGENT           │
         │  Tools: Gemini 2.0 Flash            │
         │  Output: Challenges + opportunities │
         └──────────────────┬──────────────────┘
                            │
         ┌──────────────────▼──────────────────┐
         │         3. CONTACT AGENT            │
         │  Tools: Search + custom logic       │
         │  Output: Prioritized contact list   │
         └──────────────────┬──────────────────┘
                            │
         ┌──────────────────▼──────────────────┐
         │         4. OUTREACH AGENT           │
         │  Tools: Gemini 2.0 Flash            │
         │  Output: Personalized emails        │
         └──────────────────┬──────────────────┘
                            │
         ┌──────────────────▼──────────────────┐
         │           FINAL OUTPUT              │
         │  📊 Complete Intelligence Report    │
         │  👥 Decision maker contacts         │
         │  📧 Ready-to-send email drafts      │
         └─────────────────────────────────────┘

Cross-Cutting Architecture Concerns

┌─────────────────────────────────────────────────────────┐
│                  CROSS-CUTTING LAYER                    │
├──────────────┬──────────────┬──────────────┬───────────┤
│ Memory Bank  │Session State │Observability │  Error    │
│ JSON cache   │ Context across│ Latency +    │ Handling  │
│ across runs  │  executions  │ token logging│ Recovery  │
└──────────────┴──────────────┴──────────────┴───────────┘

✅ Feature Checklist

# Feature Status Details
1 Multi-Agent System ✅ Core 4 specialized agents with class-based abstractions
2 Tools Integration ✅ Core Google Search API + custom business logic tools
3 Long-Term Memory ✅ Core JSON memory bank persists research across sessions
4 Session & State Management ✅ Bonus SessionState maintains context across agent executions
5 Observability ✅ Bonus Per-agent logging: latency, error level, token usage
6 Gemini Integration ✅ Bonus Analysis + Outreach agents powered by Gemini 2.0 Flash

Result: 6/3 required features — all 3 core + 3 bonus


🖥️ Production Frontend

Built with Next.js 15 App Router, React Flow, and Framer Motion — deployed to Vercel.

Dashboard Overview (/dashboard)

  • 4 live metrics cards: companies researched, contacts found, emails generated, cache hit rate
  • Agent execution timeline with animated status chips per agent
  • Company intelligence summary panel
  • Memory bank visualization with cached entries + timestamps
  • Outreach email preview with per-contact tabs

Orchestration View (/dashboard/workflow)

  • Full React Flow agent graph with animated data-flow edges
  • Per-node status indicators: idle → running → complete → error
  • Animated bezier connections showing pipeline execution state
  • Custom node components matching the agent console design system

Terminal Log Viewer (/dashboard/logs)

  • Dark monospace terminal UI
  • Columns: timestamp │ agent │ level │ message
  • Auto-scroll during live execution

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Node.js 18+ (for frontend)
  • Google AI Studio API key → Get one here

Backend Setup

# 1. Clone
git clone https://github.com/Harshithk951/sales-intelligence-agent
cd sales-intelligence-agent

# 2. Python environment
python3 -m venv venv
source venv/bin/activate        # Mac/Linux
# venv\Scripts\activate         # Windows

# 3. Install dependencies
pip install -r requirements.txt

# 4. Configure
cp .env.example .env
# Add your GOOGLE_API_KEY to .env

# 5. Run
python main.py

Frontend Setup

cd frontend
npm install
cp .env.example .env.local
# Set NEXT_PUBLIC_API_URL=http://localhost:8000
npm run dev
# → http://localhost:3000

Output Files Generated

reports/          ← JSON intelligence reports per company
logs/             ← agent_YYYYMMDD.log with per-agent metrics
memory_bank.json  ← Research cache (persists across runs)

📁 Project Structure

sales-intelligence-agent/
│
├── agents/                    # Core agent implementations
│   ├── research_agent.py      # Google Search → company overview
│   ├── analysis_agent.py      # Gemini → challenges & opportunities
│   ├── contact_agent.py       # Search + logic → decision makers
│   └── outreach_agent.py      # Gemini → personalized emails
│
├── tools/
│   └── search_tool.py         # Google Search API wrapper
│
├── utils/
│   ├── memory.py              # Memory bank + session state
│   └── logger.py              # Per-agent observability logging
│
├── frontend/                  # Next.js 15 production dashboard
│   ├── src/app/
│   │   ├── page.tsx           # Landing page
│   │   └── dashboard/         # Dashboard + workflow + logs
│   └── src/components/
│       └── workflow/          # React Flow agent graph
│
├── main.py                    # Orchestrator entry point
├── requirements.txt
└── .env.example

🔧 Configuration

# .env

# Required
GOOGLE_API_KEY=your_api_key_here

# Optional
MODEL_NAME=gemini-2.0-flash-exp   # or gemini-pro
MAX_RETRIES=3
TIMEOUT_SECONDS=30

Change number of contacts generated:

# agents/outreach_agent.py, line 45
for contact in contacts[:3]:  # ← adjust here

📊 Example Output

📊 SALES INTELLIGENCE REPORT: Acme Corporation
════════════════════════════════════════════════════

🏢 Company:   Acme Corporation | Technology/SaaS | 100-500 employees

🎯 Challenges Identified (3):
   1. Scaling infrastructure under rapid growth
   2. Managing technical debt accumulation
   3. Integrating disparate internal systems

👥 Decision Makers Found (3):
   • John Smith       — Chief Technology Officer
   • Sarah Johnson    — VP of Engineering
   • Michael Chen     — Director of Product

📧 Outreach Emails Generated: 3
📁 Report saved → reports/acme_corporation_20251115.json
⚡ Total execution time: 47.3s
💾 Research cached → memory_bank.json

🧪 Testing

# Test with known companies
python main.py
# Enter: Salesforce

# Verify memory caching (2nd run should be instant)
python main.py
# Enter: Salesforce
# → "Found cached research for Salesforce (saved 38.2s)"

📚 Technical Decisions

Decision Choice Reason
Agent topology Sequential Each agent requires previous agent's output as context
Memory layer JSON file Portable, zero-dependency, sufficient for demo scale
LLM Gemini 2.0 Flash Fast, cost-effective, strong at analysis + generation
Frontend Next.js 15 App Router Production deployment, React Flow support, Vercel-native
Observability File + console logging Dual output — human-readable in terminal, parseable for dashboard
API layer Stubbed with hot-swap interface Decouples frontend from backend; single env var to connect real Python backend

🗺️ Roadmap

  • Wire live Python backend to Next.js dashboard via FastAPI
  • Real Google Custom Search API integration (replace mock)
  • LinkedIn API for verified contact data
  • Async parallel agent execution for sub-10s pipeline
  • Email sending via SendGrid/Gmail API
  • Multi-company batch processing mode
  • Deploy backend to Google Cloud Run
  • Vector store integration (ChromaDB) for semantic memory

👨‍💻 Author

Harshith Kumar Mannepalli

Portfolio GitHub LinkedIn


🙏 Acknowledgments

  • Google AI & Kaggle — AI Agents Intensive Course (Nov 2025)
  • Google ADK team — Multi-agent orchestration framework

⭐ Star this repo if it helped you build something.

About

Smart Sales Intelligence Agent with multi-agent architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors