Inspiration

Leads, recruiters, clients, and opportunities go silent every single day. Companies lose millions in potential revenue simply because humans forget to follow up, misjudge the timing, or don't know what to say next.

Standard CRMs are static databases that rely on humans to take action. Traditional marketing automation tools just blast generic "just following up" templates on a fixed 3-day schedule, which damages relationships.

We realized we didn't need another notification tool. We needed an autonomous worker. We built Ghosted to own the entire re-engagement workflow—inferring why a lead went silent, checking enterprise safety policies, and executing the next-best action entirely in the background.

What it does

Ghosted is a Next-Generation AI Agent that manages a sales pipeline autonomously through a Dual-App Ecosystem (CRM View and Agent Runtime).

When an opportunity goes silent, Ghosted doesn't remind a human to follow up. Instead, it wakes up and evaluates the situation:

  • Next-Best-Action Engine: It analyzes the context of the last interaction. If the last conversation was about pricing, it drafts a value-based ROI email. If it was technical, it sends documentation.
  • Stateful "Time" Management: Ghosted respects time. If a lead has only been silent for 2 days, the agent enforces a "Minimum 4-Day Interval" policy and places the lead on hold.
  • Contact Fatigue Safety: If a lead has been followed up with 3 times already, the agent enforces a "Max Contact" policy and abandons the lead to prevent spam.
  • Human-in-the-Loop (Enterprise Safety): For high-value deals (e.g., >$50,000), Ghosted drafts the email but places it in a "Human Approval" queue, requiring a manager to manually click "Authorize Send."

How we built it

We architected Ghosted as a distributed, event-driven enterprise application.

  • AI Brain: We utilized the brand new Gemini 3.5 Flash model via the Google Cloud Vertex AI SDK. The prompt is structured to output strict JSON telemetry, acting as a true reasoning engine rather than a chatbot.
  • Database: Google Cloud Firestore (Native Mode) serves as the central state manager.
  • Frontend: Built with Next.js 16 (Turbopack), Tailwind, and Framer Motion for a highly dynamic Kanban UI.
  • Zero-Trust Security: To meet strict enterprise governance, we completely avoided hardcoded API keys. We utilized Google Application Default Credentials (ADC) to securely bridge our Node.js backend with Vertex AI and Firestore.

Challenges we ran into

Moving from a simple "LLM Wrapper" to a stateful Agent was highly complex. Initially, the AI would just draft repetitive emails. We had to implement the "Next-Best-Action Engine" and write complex prompts to teach Gemini how to respect time (days silent) and fatigue (previous follow-ups). Furthermore, ensuring real-time UI synchronization between the CRM app and the Agent app without causing React re-render loops required deep integration with Firestore snapshot listeners and deep-equality checks.

Accomplishments that we're proud of

We are incredibly proud of our "Time Travel" and "Auto-Pilot" architecture. It is one thing to click a button and have an AI generate text. It is infinitely more impressive to turn on Auto-Pilot, manually advance the database clock by 5 days, and watch the agent independently realize a policy hold has expired, pull the lead back into the active queue, and execute a follow-up action with zero human intervention.

What we learned

We learned that the true power of Gemini 3.5 Flash is routing logic, not just text generation. By treating the LLM as a "Pipeline Director" and utilizing structured JSON, you can build reliable, production-ready enterprise software.

To formalize the agent's decision engine, we built a heuristic mathematical model into the prompt logic to evaluate the priority of a silent lead: $$ P(Recovery) = \left( \frac{\text{Value} \times \text{Intent}}{\text{Contact Fatigue}} \right) - (\text{Days Silent} \times \text{Decay Rate}) $$ By passing these variables into Gemini, the agent learned exactly who to prioritize, rather than just guessing.

What's next for Ghosted

  1. Multi-Channel Orchestration: Allowing Ghosted to decide between sending an Email, a LinkedIn message, or an SMS based on the lead's preferred channel.
  2. Sentiment Analysis: Upgrading the agent to read client replies and automatically draft calendar invite links if the sentiment is positive.
  3. Full Pub/Sub Integration: Moving the agent evaluation loop off the client UI and entirely into a nightly Google Cloud Scheduler + Cloud Run setup.

Built With

  • agentic-ai
  • artificial-intelligence
  • automation
  • crm
  • enterprise-software
  • firebase-admin
  • firestore
  • framer-motion
  • gemini-3.5-flash
  • google-cloud
  • lucide-react
  • next.js
  • node.js
  • react
  • tailwind-css
  • turbopack
  • typescript
  • vertex-ai
Share this project:

Updates