AI AI Sales Agent with Real-Time Data IntegrationSales Agent with Real-Time Data Integration



This content originally appeared on DEV Community and was authored by Paulo

# AI Sales Agent with Real-Time Data Integration  
_Submission for the AI Agents Challenge powered by n8n and Bright Data_

## What I Built
An AI Sales Agent that marries n8n’s low-code automation with **Bright Data’s real-time web intelligence** to solve one of B2B’s biggest pains: **hyper-personalized, data-driven sales outreach that is always up-to-date**.

### Key Capabilities
| Feature | Benefit |
|---|---|
| **Natural-language query input** | Users simply ask “Tell me about Acme Corp”. |
| **Real-time company research** | Scrapes live web + LinkedIn via Bright Data. |
| **AI email generation** | Google Gemini crafts “I’ll show you how to fix X” copy with a **relevant MediaMarkt offer**. |
| **Daily lead enrichment** | Cron-triggered workflow re-scores and re-emails every morning. |
| **Live dashboard** | Webhook-driven front-end to monitor KPIs in real time. |

### Demo Links
| Asset | URL |
|---|---|
| **Video Demo** | [youtu.be/H9ITJmg5_Hk](https://youtu.be/H9ITJmg5_Hk) |
| **Agent Interface** | [brightdata.app.n8n.cloud/webhook/agent](https://brightdata.app.n8n.cloud/webhook/agent) |
| **Dashboard** | [brightdata.app.n8n.cloud/webhook/dashboard](https://brightdata.app.n8n.cloud/webhook/dashboard) |
| **Workflow JSON** | [GitHub Gist](https://gist.github.com/PauloTuppy/55afad076d2f0cdbfe7eae3fe9867438) |

---

## Technical Deep-Dive
### Architecture Overview


mermaid
graph TD
User(Web Interface) –>|POST query| Webhook
Webhook –> Extract[Regex Extract Company]
Extract –> BD_Bright(Bright Data nodes)
BD_Bright –> Company(Company Intel)
BD_Bright –> LinkedIn(LinkedIn Jobs)
BD_Bright –> Products(MediaMarkt Products)
Company & LinkedIn & Products –> Gemini(Google Gemini)
Gemini –> Sheets(Google Sheets)
Sheets –> Dashboard
Cron –> Sheets[Daily Re-enrichment]


### Model Choice
| Model | Reason |
|---|---|
| **Google Gemini 1.5 Flash** | Fast, stateless, excellent at short persuasive copy. |

### Memory & Context
- **Session IDs** generated per user.  
- **Conversation history** appended to each prompt.  
- **Google Sheets** = long-term memory & CRM.

### Daily Automation
- **Cron node** fires at 09:00 UTC → re-scrapes → re-scores → re-emails.

---

## Bright Data Verified Nodes in Action
| Task | Dataset / Node | Value |
|---|---|---|
| **Company Intel** | Bright Data Web Scraper | Live profile, news, competitors. |
| **Job Insights** | LinkedIn Jobs Dataset | Growth signals & pain points from postings. |
| **Product Mapping** | MediaMarkt.de Dataset | Relevant offers tied to detected pain. |
| **Lead Enrichment** | Same nodes | Fresh data every 24 h. |

> **Design Decision**: Dropped the complex MCP SSE stream for **direct verified-node calls**—far more stable and debuggable.

---

## Journey & Lessons Learned
### Phase 1 – MCP SSE Struggles
- **Problem**: Auth failures & streaming complexity.  
- **Pivot**: Direct Bright Data nodes ➜ 10× more reliable.

### Phase 2 – Data Flow Refactoring
- **Challenge**: Passing context between nodes.  
- **Fix**: Unified JSON schema + explicit variable mapping.

### Phase 3 – Frontend & Response
- **Bug**: “Workflow started” instead of full response.  
- **Solution**: Re-wired webhook **Respond** node to return final Gemini output.

### Key Takeaways
1. **Simplicity > Complexity** – direct integrations beat fancy protocols.  
2. **Real-time data changes everything** – static AI feels dated the moment context expires.  
3. **n8n + Bright Data** = production-grade AI agents without writing backend services.

---

> From fragile prototype to **production-ready sales engine** in one week—proving the future of AI agents is **real-world, real-time, and no-code friendly**.


This content originally appeared on DEV Community and was authored by Paulo